RE: provide Helloworld application in Struts2.0

2011-11-17 Thread Praveen Jain

Dear 
Ilya Kazakevich, 

Thanks for your help in making my application I am providing you the required 
details .

Currently I am using 

1) Java Version  jdk1.5.0_05   

2) Tomcat version  Tomcat 5.0 
2) Struts Version 2.0  
3) Yes in  Endorse Folder of Tomcat I have two jar files named  xercesImpl.jar 
and xml-apis.  4) I am using Eclipse Ganymade Editor to develop this 
application. 

Thanks in advance for your co-operation . 
--- On Wed, 11/16/11, Ilya Kazakevich ilya.kazakev...@jetbrains.com wrote:

From: Ilya Kazakevich ilya.kazakev...@jetbrains.com
Subject: RE: provide Helloworld application in Struts2.0
To: 'Struts Users Mailing List' user@struts.apache.org
Date: Wednesday, November 16, 2011, 10:13 AM

 javax.xml.transform.TransformerFactoryConfigurationError: Provider
org.apache.xalan.processor.TransformerFactoryImpl not found
 
1) what is your java version?
2) what is your tomcat version?
3) struts version?
4) do you have any jars inside endorsed folder of your tomcat? If so --
what versions are they? (see META-INF/MANIFEST.MF)
 
Ilya Kazakevich,
Developer
JetBrains Inc
http://www.jetbrains.com http://www.jetbrains.com/ 
Develop with pleasure!




RE: provide Helloworld application in Struts2.0

2011-11-17 Thread Dave Newton
Is there anything in your startup logs? This could help things go more
quickly.
 On Nov 17, 2011 12:21 PM, Praveen Jain jain_praveen_mail...@yahoo.com
wrote:


 Dear
 Ilya Kazakevich,

 Thanks for your help in making my application I am providing you the
 required details .

 Currently I am using

 1) Java Version  jdk1.5.0_05

 2) Tomcat version  Tomcat 5.0
 2) Struts Version 2.0
 3) Yes in  Endorse Folder of Tomcat I have two jar files named
  xercesImpl.jar and xml-apis.  4) I am using Eclipse Ganymade Editor to
 develop this application.

 Thanks in advance for your co-operation .
 --- On Wed, 11/16/11, Ilya Kazakevich ilya.kazakev...@jetbrains.com
 wrote:

 From: Ilya Kazakevich ilya.kazakev...@jetbrains.com
 Subject: RE: provide Helloworld application in Struts2.0
 To: 'Struts Users Mailing List' user@struts.apache.org
 Date: Wednesday, November 16, 2011, 10:13 AM

  javax.xml.transform.TransformerFactoryConfigurationError: Provider
 org.apache.xalan.processor.TransformerFactoryImpl not found

 1) what is your java version?
 2) what is your tomcat version?
 3) struts version?
 4) do you have any jars inside endorsed folder of your tomcat? If so --
 what versions are they? (see META-INF/MANIFEST.MF)

 Ilya Kazakevich,
 Developer
 JetBrains Inc
 http://www.jetbrains.com http://www.jetbrains.com/
 Develop with pleasure!





Will xwork-core-2.2.3.1.jar works for commons-lang3-3.1.jar

2011-11-17 Thread Emi Lu

Hello,

I remembered that xwork2.2.3 does not support commons-lang3-3.0.1.jar,
so use commons-lang-2.6.jar.

Apache just published a new version lang jar. Does someone know
for this newer version, will xwork-core-2.2.3.1.jar + common_lang_3.1 
work together?


Thanks a lot!
Emi


On 11/15/2011 04:02 PM, Henri Yandell wrote:
  The Apache Commons team is pleased to announce the release of Commons
  Lang 3.1.
 
  A list of the 8 changes and 5 bug fixes in this release are found in
  the release notes:
 
https://commons.apache.org/lang/changes-report.html#a3.1
 
  For general information on Commons Lang please visit the Lang website:
 
http://commons.apache.org/lang/
 
  The latest version may be downloaded from the following page:
 
http://commons.apache.org/lang/download_lang.cgi
 
  For advice on upgrading from 2.x to 3.x, see the following page:
 
  http://commons.apache.org/lang/article3_0.html
 
  Thanks again to all involved in the release, both Commons users and
  Commons developers.
 
  Hen
  on behalf of the Apache Commons community
 

--
Emi Lu, ENCS, Concordia University, Montreal H3G 1M8
em...@encs.concordia.ca+1 514 848-2424 x5884

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Will xwork-core-2.2.3.1.jar works for commons-lang3-3.1.jar

2011-11-17 Thread Emi Lu

On 11/17/2011 03:04 PM, Emi Lu wrote:

Hello,

I remembered that xwork2.2.3 does not support commons-lang3-3.0.1.jar,
so use commons-lang-2.6.jar.


Just want to remind the reason:
depend on “org/apache/commons/lang/StringUtils”; while the new jar shows 
“org/apache/commons/lang3/StringUtils”




Apache just published a new version lang jar. Does someone know
for this newer version, will xwork-core-2.2.3.1.jar + common_lang_3.1
work together?


For new version, does struts team use the new lang jar?

Emi






On 11/15/2011 04:02 PM, Henri Yandell wrote:
   The Apache Commons team is pleased to announce the release of Commons
   Lang 3.1.
  
   A list of the 8 changes and 5 bug fixes in this release are found in
   the release notes:
  
   https://commons.apache.org/lang/changes-report.html#a3.1
  
   For general information on Commons Lang please visit the Lang website:
  
   http://commons.apache.org/lang/
  
   The latest version may be downloaded from the following page:
  
   http://commons.apache.org/lang/download_lang.cgi
  
   For advice on upgrading from 2.x to 3.x, see the following page:
  
   http://commons.apache.org/lang/article3_0.html
  
   Thanks again to all involved in the release, both Commons users and
   Commons developers.
  
   Hen
   on behalf of the Apache Commons community
  




--
Emi Lu, ENCS, Concordia University, Montreal H3G 1M8
em...@encs.concordia.ca+1 514 848-2424 x5884

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Will xwork-core-2.2.3.1.jar works for commons-lang3-3.1.jar

2011-11-17 Thread Maurizio Cucchiara
And right for that reason they can coexists,
so if you want use lang3, just add it to your classpath
Sent from my mobile device, so please excuse typos and brevity.

Maurizio Cucchiara

Il giorno 17/nov/2011 21.21, Emi Lu em...@encs.concordia.ca ha scritto:

On 11/17/2011 03:04 PM, Emi Lu wrote:

 Hello,

 I remembered that xwork2.2.3 does not support c...
Just want to remind the reason:
depend on “org/apache/commons/lang/**StringUtils”; while the new jar shows
“org/apache/commons/lang3/**StringUtils”




 Apache just published a new version lang jar. Does someone know
 for this newer version, will ...
For new version, does struts team use the new lang jar?



Emi





 On 11/15/2011 04:02 PM, Henri Yandell wrote:
The Apache Commons team is please...


Re: Message lookup (from key) in Test

2011-11-17 Thread Li Ying
Hi  Miguel:

How did you generate the error message?

(A)Did you add the message key to the action errors, like:
 this.addActionError(error.authorisation);
(B)or did you retrieve the message text by the key, then add the text
to the action errors, like:
 this.addActionError(this.getText(error.authorisation));

Method (B) is correct, (A) is not.




2011/11/16 Miguel Almeida mig...@almeida.at:
 Dear all,

 I am unit-testing an application under the skin using
 SpringStrutsTestCase as base (actually, things are a bit more
 complicated because I'm doing it from Cucumber, but that's another
 story).

 How do you get the value of your message from within the test? The
 assertion I'm trying is:

 assertEquals(expectedMessage,
 action.getActionErrors().iterator().next());

 But actionErrors() contains the key (error.authorisation) and not the
 value (you cannot do this). What's the cleanest way to retrieve the
 value from the test?


 Cheers,

 Miguel Almeida


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Right way for exception handling

2011-11-17 Thread Li Ying
Hi, Ilya:

 But struts-2 breaks this scheme.

 1) it does not pass exception to container so container can't log it.

I used struts2 for several years.
In our projects, struts-2 does not break this schema.

I have read the source of struts2. When an exception is thrown from
action execution, struts2 will catch it, and
(1)set 500 error to the response code
(2)put the exception instance into request attribute
[javax.servlet.error.exception] and [javax.servlet.jsp.jspException]

source code like this:

package org.apache.struts2.dispatcher;
class: Dispatcher

// WW-1977: Only put errors in the request when code
is a 500 error
if (code == HttpServletResponse.SC_INTERNAL_SERVER_ERROR) {
// send a http error response to use the servlet
defined error handler
// make the exception availible to the web.xml
defined error page
request.setAttribute(javax.servlet.error.exception, e);

// for compatibility
request.setAttribute(javax.servlet.jsp.jspException, e);
}

// send the error response
response.sendError(code, e.getMessage());


you can handle exception by:
(1)add this setting into web.xml:
error-page
exception-typejava.lang.Exception/exception-type
location/some_path/errorException.jsp/location
/error-page
(2)create a errorException.jsp






2011/11/12 Ilya Kazakevich ilya.kazakev...@jetbrains.com:
 Hello,

 In bare container (tomcat) everything is good: Servlet throws exception and
 container logs it and displays 500 error page with certain status.
 Each uncounght exception should lead to 500 error because uncought exception
 is _program_ error.

 But struts-2 breaks this scheme.

 1) it does not pass exception to container so container can't log it.
 2) even if I use exception interceptor (ExceptionMappingInterceptor)
 struts does not set 500 error code to my result. So I have to set it in my
 JSP (or servlet) manually.
 I can't use static 500 error page as I did in tomcat.

 So, my questions are:

 1) Why do not struts passes exception to container by default? Could I
 configure it to do so?
 2) If struts can't do it -- how can I make it to send 500 status for my
 exception? I do not want to configure my jsp
 3) Who really needs exeption handling in struts?  Somebody wants user to be
 redirected to different actions based on exception type? What for? Smells
 like exception-based business logic moved from java to struts.xml and does
 not look like good practice.

 I need to write a lot just to get back to default container behavior (500
 status and logging):

 1) Create _new_ stack to set logEnabled and logLevel
 2) Configure package to use it
 3) Add global error result
 4) Add global exception handling
 5) Create JSP with status 500 instead of my 500.html page

 Is not it too big for such simple task?



 Ilya Kazakevich,
 Developer
 JetBrains Inc
 http://www.jetbrains.com
 Develop with pleasure!


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] Displaying user entered values after failed type conversion while using getText()?

2011-11-17 Thread Li Ying
I have 2 suggestion:

(A)Declare the input data field in your action as a String, instead of
date or integer.
So, the String field can hold anything input from client side.
But this will be inconvenience to use, because you have to convert the
string value
to the date or integer value by yourself, before you can use it.

Another solution is:
(B)Declare 2 fields in your action.
One as date or integer, to hold the type converted valid value.
Another as String,  to hold the original input text.

On the input page side,  you also need 2 form elements.
One is input, which will send data to the [real value] field,
and another is hidden, which will send data to the [original input
text] field.

User can only see the input, and input data in it.
you can create some JS code, to copy the input content to the
hidden element, before the form be posted.

When the type conversion fails, and the input page displayed again,
the hidden element will contains the original input text,
and the input element will contains empty text.

You can create some JS code, to copy the hidden element content to
the input element, after the page loaded.
Or, you can simply set the value of the input element from the
[original input text] field of Action.


Hope this helps.



2011/11/17 Burton Rhodes burtonrho...@gmail.com:
 I am having an issue with displaying the original value entered on a
 form after failed type conversion.  This bug is caused by my use of
 getText() in the form value fields.  I'm curious how one solves this
 issue for making sure the field is formatted correctly upon display,
 but also making sure the users see the orignal malformed entry after
 failed type conversion.  I have a few examples below.  The last one
 displays works the way it should.  The top two only present an empty
 field upon failed type conversion.

 [code snippets]

 !-- convert to java.util.Date: Will NOT display the incorrectly
 entered date --
 s:textfield key=xaction.closedDate
 value=%{getText('format.dateShort',{xaction.closedDate != null ?
 xaction.closedDate :''})} /

 !-- convert to BigDecimal: Will NOT display the incorrectly entered
 number --
 s:textfield key=xaction.listPrice
 value=%{getText('format.money',{xaction.listPrice != null ?
 xaction.listPrice :''})}/

 !-- convert to Integer: Will display the incorrect value --
 s:textfield key=xaction.beds /

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org