Author Login
Post Reply
user Digest 9 Apr 2008 22:21:43 -0000 Issue 7971
Topics (messages 185197 through 185219):
Re: date conversion
185197 by: Brad A Cupit
185198 by: Alberto A. Flores
185199 by: Brad A Cupit
185208 by: Adam Hardy
185209 by: Alberto A. Flores
struts.xml
185200 by: Ian Meikle
185201 by: Randy Burgess
185202 by: Ian Meikle
185203 by: Lukasz Lenart
185204 by: Ian Meikle
185206 by: Martin Gainty
Re: problem in file upload
185205 by: Rajeev Sharma
185207 by: Martin Gainty
Need help getting started with remote tabs
185210 by: Jiang, Jane (NIH/NCI) [C]
185214 by: Musachy Barroso
Re: How to put validation.xml and Action.java in separate folders
185211 by: goelshek
185218 by: Laurie Harper
185219 by: goelshek
Local Host Error
185212 by: Hartford Cory-C23423
185213 by: Martin Gainty
Re: [S2] checkboxes in each row of table - set values in action
185215 by: Laurie Harper
Re: Commons Validator Issue with Collections
185216 by: Laurie Harper
Re: Preparable Question
185217 by: Laurie Harper
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_185197.ezm (zipped)the static SimpleDateFormat (assuming this code is in an S2 Action that
is instantiated per request) is not thread safe.
http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#sy
nchronization
Brad Cupit
Louisiana State University - UIS
-----Original Message-----
From: Zoran Avtarovski [mailto:zoran@(protected)]
Sent: Tuesday, April 08, 2008 7:30 PM
To: Struts Users Mailing List
Subject: Re: date conversion
We had the same issue and went with writing a new converter (shown
below).
And then created a xwork-conversion.properties file pointing to it.
Z.
private final static SimpleDateFormat DATE_FORMAT = new
SimpleDateFormat("dd/MM/yyyy"); @Override public Object
convertFromString(Map context, String[] values, Class toType) throws
TypeConversionException { try { return
DATE_FORMAT.parse( values[0]); } catch (ParseException e) {
e.printStackTrace(); throw new
TypeConversionException("xwork.default.invalid.fieldvalue");
}
return null; } @Override public String convertToString(Map
context, Object object) { Calendar cal = Calendar.getInstance();
cal.setTime((Date) object); try { return
DATE_FORMAT.format(object); } catch (Exception e) {
throw new TypeConversionException("xwork.default.invalid.fieldvalue");
} }
>
> Can you patch a whole class?
>
> What would be useful is parameterizable type converters, to specify
the date
> format in this case. (they're not parameterizable, are they?)
>
> Dave Newton on 08/04/08 22:13, wrote:
>> > --- Adam Hardy <ahardy.struts@(protected):
>>> >> One area where S1 actually had the upper hand :(
>> >
>> > Submit a patch :)
>> >
>> > Dave
>> >
>>> >> Dave Newton on 08/04/08 18:36, wrote:
>>>> >>> The built-in type converter uses "uses the SHORT format for the
Locale
>>>> >>> associated with the current request" according to the type
conversion
>>> >> docs,
>>>> >>> so yes, you'll need to do your own if you're using a different
input
>>> >> format.
>>>> >>> Looking through the XWork conversion code it's hard for me to
tell what
>>> >> it's
>>>> >>> *actually* doing, though :/
>>>> >>>
>>>> >>> Dave
>>>> >>>
>>>> >>> --- Brad A Cupit <brad@(protected):
>>>> >>>
>>>>> >>>> JSTL has the <fmt:formatDate> tag. If you want to do it in
Java,
>>>>> rather
>>>>> >>>> than your JSP, you can use SimpleDateFormat.
>>>>> >>>>
>>>>> >>>> Be aware that SimpleDataFormat is not thread safe, so don't
assign it
to
>>> >> a
>>>>> >>>> static field or use it in a singleton. If you use it as an
instance
>>> >> field
>>>>> >>>> on an Action you'll be safe, since Actions are created per
request.
>>>>> >>>>
>>>>> >>>> If you want a thread safe version of SimpleDateFormat,
Jakarta
>>>>> Commons
>>> >> lang
>>>>> >>>> has FastDateFormat: http://commons.apache.org/lang/
>>>>> >>>>
>>>>> >>>> Brad Cupit
>>>>> >>>> Louisiana State University - UIS
>>>>> >>>> e-mail: brad@(protected)
>>>>> >>>> office: 225.578.4774
>>>>> >>>>
>>>>> >>>>
>>>>> >>>> -----Original Message-----
>>>>> >>>> From: Adam Hardy [mailto:ahardy.struts@(protected)]
>>>>> >>>> Sent: Tuesday, April 08, 2008 12:11 PM
>>>>> >>>> To: Struts Users Mailing List
>>>>> >>>> Subject: date conversion
>>>>> >>>>
>>>>> >>>> Hi
>>>>> >>>>
>>>>> >>>> quick question, I can't find any specific mention of what I
want so I
>>>>> >>>> assume I
>>>>> >>>> have to code my own Converter.
>>>>> >>>>
>>>>> >>>> I need a date in the ISO format YYYY-MM-DD
>>>>> >>>>
>>>>> >>>> There is no converter that I can configure in the struts
package, is
>>> >> there?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

Attachment:
user_185198.ezm (zipped)Consider placing the SimpleDateFormat as a local variable (within the
method) to avoid non-thread safe operations (guaranteed by the jvm spec).
Brad A Cupit wrote:
> the static SimpleDateFormat (assuming this code is in an S2 Action that
> is instantiated per request) is not thread safe.
>
> http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#sy
> nchronization
>
> Brad Cupit
> Louisiana State University - UIS
>
> -----Original Message-----
> From: Zoran Avtarovski [mailto:zoran@(protected)]
> Sent: Tuesday, April 08, 2008 7:30 PM
> To: Struts Users Mailing List
> Subject: Re: date conversion
>
> We had the same issue and went with writing a new converter (shown
> below).
> And then created a xwork-conversion.properties file pointing to it.
>
> Z.
>
> private final static SimpleDateFormat DATE_FORMAT = new
> SimpleDateFormat("dd/MM/yyyy"); @Override public Object
> convertFromString(Map context, String[] values, Class toType) throws
> TypeConversionException { try { return
> DATE_FORMAT.parse( values[0]); } catch (ParseException e) {
> e.printStackTrace(); throw new
> TypeConversionException("xwork.default.invalid.fieldvalue");
> }
> return null; } @Override public String convertToString(Map
> context, Object object) { Calendar cal = Calendar.getInstance();
> cal.setTime((Date) object); try { return
> DATE_FORMAT.format(object); } catch (Exception e) {
> throw new TypeConversionException("xwork.default.invalid.fieldvalue");
> } }
>
>
>> Can you patch a whole class?
>>
>> What would be useful is parameterizable type converters, to specify
> the date
>> format in this case. (they're not parameterizable, are they?)
>>
>> Dave Newton on 08/04/08 22:13, wrote:
>>>> --- Adam Hardy <ahardy.struts@(protected):
>>>>>> One area where S1 actually had the upper hand :(
>>>> Submit a patch :)
>>>>
>>>> Dave
>>>>
>>>>>> Dave Newton on 08/04/08 18:36, wrote:
>>>>>>>> The built-in type converter uses "uses the SHORT format for the
> Locale
>>>>>>>> associated with the current request" according to the type
> conversion
>>>>>> docs,
>>>>>>>> so yes, you'll need to do your own if you're using a different
> input
>>>>>> format.
>>>>>>>> Looking through the XWork conversion code it's hard for me to
> tell what
>>>>>> it's
>>>>>>>> *actually* doing, though :/
>>>>>>>>
>>>>>>>> Dave
>>>>>>>>
>>>>>>>> --- Brad A Cupit <brad@(protected):
>>>>>>>>
>>>>>>>>>> JSTL has the <fmt:formatDate> tag. If you want to do it in
> Java,
>>>>>> rather
>>>>>>>>>> than your JSP, you can use SimpleDateFormat.
>>>>>>>>>>
>>>>>>>>>> Be aware that SimpleDataFormat is not thread safe, so don't
> assign it
> to
>>>>>> a
>>>>>>>>>> static field or use it in a singleton. If you use it as an
> instance
>>>>>> field
>>>>>>>>>> on an Action you'll be safe, since Actions are created per
> request.
>>>>>>>>>> If you want a thread safe version of SimpleDateFormat,
> Jakarta
>>>>>> Commons
>>>>>> lang
>>>>>>>>>> has FastDateFormat: http://commons.apache.org/lang/
>>>>>>>>>>
>>>>>>>>>> Brad Cupit
>>>>>>>>>> Louisiana State University - UIS
>>>>>>>>>> e-mail: brad@(protected)
>>>>>>>>>> office: 225.578.4774
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> -----Original Message-----
>>>>>>>>>> From: Adam Hardy [mailto:ahardy.struts@(protected)]
>>>>>>>>>> Sent: Tuesday, April 08, 2008 12:11 PM
>>>>>>>>>> To: Struts Users Mailing List
>>>>>>>>>> Subject: date conversion
>>>>>>>>>>
>>>>>>>>>> Hi
>>>>>>>>>>
>>>>>>>>>> quick question, I can't find any specific mention of what I
> want so I
>>>>>>>>>> assume I
>>>>>>>>>> have to code my own Converter.
>>>>>>>>>>
>>>>>>>>>> I need a date in the ISO format YYYY-MM-DD
>>>>>>>>>>
>>>>>>>>>> There is no converter that I can configure in the struts
> package, is
>>>>>> there?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Alberto A. Flores
http://www.linkedin.com/in/aflores

Attachment:
user_185199.ezm (zipped)>> Consider placing the SimpleDateFormat as a local variable
exactly right
or, consider using a ThreadLocal
or, consider using commons-lang's FastDateFormat
http://commons.apache.org/lang/api-release/org/apache/commons/lang/time/
FastDateFormat.html
Brad Cupit
Louisiana State University - UIS
e-mail: brad@(protected)
office: 225.578.4774
-----Original Message-----
From: Alberto A. Flores [mailto:aaflores@(protected)]
Sent: Wednesday, April 09, 2008 7:48 AM
To: Struts Users Mailing List
Subject: Re: date conversion
Consider placing the SimpleDateFormat as a local variable (within the
method) to avoid non-thread safe operations (guaranteed by the jvm
spec).
Brad A Cupit wrote:
> the static SimpleDateFormat (assuming this code is in an S2 Action
that
> is instantiated per request) is not thread safe.
>
>
http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#sy
> nchronization
>
> Brad Cupit
> Louisiana State University - UIS
>
> -----Original Message-----
> From: Zoran Avtarovski [mailto:zoran@(protected)]
> Sent: Tuesday, April 08, 2008 7:30 PM
> To: Struts Users Mailing List
> Subject: Re: date conversion
>
> We had the same issue and went with writing a new converter (shown
> below).
> And then created a xwork-conversion.properties file pointing to it.
>
> Z.
>
> private final static SimpleDateFormat DATE_FORMAT = new
> SimpleDateFormat("dd/MM/yyyy"); @Override public Object
> convertFromString(Map context, String[] values, Class toType) throws
> TypeConversionException { try { return
> DATE_FORMAT.parse( values[0]); } catch (ParseException e) {
> e.printStackTrace(); throw new
> TypeConversionException("xwork.default.invalid.fieldvalue");
> }
> return null; } @Override public String convertToString(Map
> context, Object object) { Calendar cal =
Calendar.getInstance();
> cal.setTime((Date) object); try { return
> DATE_FORMAT.format(object); } catch (Exception e) {
> throw new TypeConversionException("xwork.default.invalid.fieldvalue");
> } }
>
>
>> Can you patch a whole class?
>>
>> What would be useful is parameterizable type converters, to specify
> the date
>> format in this case. (they're not parameterizable, are they?)
>>
>> Dave Newton on 08/04/08 22:13, wrote:
>>>> --- Adam Hardy <ahardy.struts@(protected):
>>>>>> One area where S1 actually had the upper hand :(
>>>> Submit a patch :)
>>>>
>>>> Dave
>>>>
>>>>>> Dave Newton on 08/04/08 18:36, wrote:
>>>>>>>> The built-in type converter uses "uses the SHORT format for the
> Locale
>>>>>>>> associated with the current request" according to the type
> conversion
>>>>>> docs,
>>>>>>>> so yes, you'll need to do your own if you're using a different
> input
>>>>>> format.
>>>>>>>> Looking through the XWork conversion code it's hard for me to
> tell what
>>>>>> it's
>>>>>>>> *actually* doing, though :/
>>>>>>>>
>>>>>>>> Dave
>>>>>>>>
>>>>>>>> --- Brad A Cupit <brad@(protected):
>>>>>>>>
>>>>>>>>>> JSTL has the <fmt:formatDate> tag. If you want to do it in
> Java,
>>>>>> rather
>>>>>>>>>> than your JSP, you can use SimpleDateFormat.
>>>>>>>>>>
>>>>>>>>>> Be aware that SimpleDataFormat is not thread safe, so don't
> assign it
> to
>>>>>> a
>>>>>>>>>> static field or use it in a singleton. If you use it as an
> instance
>>>>>> field
>>>>>>>>>> on an Action you'll be safe, since Actions are created per
> request.
>>>>>>>>>> If you want a thread safe version of SimpleDateFormat,
> Jakarta
>>>>>> Commons
>>>>>> lang
>>>>>>>>>> has FastDateFormat: http://commons.apache.org/lang/
>>>>>>>>>>
>>>>>>>>>> Brad Cupit
>>>>>>>>>> Louisiana State University - UIS
>>>>>>>>>> e-mail: brad@(protected)
>>>>>>>>>> office: 225.578.4774
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> -----Original Message-----
>>>>>>>>>> From: Adam Hardy [mailto:ahardy.struts@(protected)]
>>>>>>>>>> Sent: Tuesday, April 08, 2008 12:11 PM
>>>>>>>>>> To: Struts Users Mailing List
>>>>>>>>>> Subject: date conversion
>>>>>>>>>>
>>>>>>>>>> Hi
>>>>>>>>>>
>>>>>>>>>> quick question, I can't find any specific mention of what I
> want so I
>>>>>>>>>> assume I
>>>>>>>>>> have to code my own Converter.
>>>>>>>>>>
>>>>>>>>>> I need a date in the ISO format YYYY-MM-DD
>>>>>>>>>>
>>>>>>>>>> There is no converter that I can configure in the struts
> package, is
>>>>>> there?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Alberto A. Flores
http://www.linkedin.com/in/aflores

Attachment:
user_185208.ezm (zipped)Actually I use it in a static method on a utility class, and call
SimpleDateFormat inside a synchronized block.
Brad A Cupit on 09/04/08 13:51, wrote:
>>> Consider placing the SimpleDateFormat as a local variable
> exactly right
>
> or, consider using a ThreadLocal
> or, consider using commons-lang's FastDateFormat
>
> http://commons.apache.org/lang/api-release/org/apache/commons/lang/time/
> FastDateFormat.html
>
> Brad Cupit
> Louisiana State University - UIS
> e-mail: brad@(protected)
> office: 225.578.4774
>
>
> -----Original Message-----
> From: Alberto A. Flores [mailto:aaflores@(protected)]
> Sent: Wednesday, April 09, 2008 7:48 AM
> To: Struts Users Mailing List
> Subject: Re: date conversion
>
> Consider placing the SimpleDateFormat as a local variable (within the
> method) to avoid non-thread safe operations (guaranteed by the jvm
> spec).
>
>
> Brad A Cupit wrote:
>> the static SimpleDateFormat (assuming this code is in an S2 Action
> that
>> is instantiated per request) is not thread safe.
>>
>>
> http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#sy
>> nchronization
>>
>> Brad Cupit
>> Louisiana State University - UIS
>>
>> -----Original Message-----
>> From: Zoran Avtarovski [mailto:zoran@(protected)]
>> Sent: Tuesday, April 08, 2008 7:30 PM
>> To: Struts Users Mailing List
>> Subject: Re: date conversion
>>
>> We had the same issue and went with writing a new converter (shown
>> below).
>> And then created a xwork-conversion.properties file pointing to it.
>>
>> Z.
>>
>> private final static SimpleDateFormat DATE_FORMAT = new
>> SimpleDateFormat("dd/MM/yyyy"); @Override public Object
>> convertFromString(Map context, String[] values, Class toType) throws
>> TypeConversionException { try { return
>> DATE_FORMAT.parse( values[0]); } catch (ParseException e) {
>> e.printStackTrace(); throw new
>> TypeConversionException("xwork.default.invalid.fieldvalue");
>> }
>> return null; } @Override public String convertToString(Map
>> context, Object object) { Calendar cal =
> Calendar.getInstance();
>> cal.setTime((Date) object); try { return
>> DATE_FORMAT.format(object); } catch (Exception e) {
>> throw new TypeConversionException("xwork.default.invalid.fieldvalue");
>> } }
>>
>>
>>> Can you patch a whole class?
>>>
>>> What would be useful is parameterizable type converters, to specify
>> the date
>>> format in this case. (they're not parameterizable, are they?)
>>>
>>> Dave Newton on 08/04/08 22:13, wrote:
>>>>> --- Adam Hardy <ahardy.struts@(protected):
>>>>>>> One area where S1 actually had the upper hand :(
>>>>> Submit a patch :)
>>>>>
>>>>> Dave
>>>>>
>>>>>>> Dave Newton on 08/04/08 18:36, wrote:
>>>>>>>>> The built-in type converter uses "uses the SHORT format for the
>> Locale
>>>>>>>>> associated with the current request" according to the type
>> conversion
>>>>>>> docs,
>>>>>>>>> so yes, you'll need to do your own if you're using a different
>> input
>>>>>>> format.
>>>>>>>>> Looking through the XWork conversion code it's hard for me to
>> tell what
>>>>>>> it's
>>>>>>>>> *actually* doing, though :/
>>>>>>>>>
>>>>>>>>> Dave
>>>>>>>>>
>>>>>>>>> --- Brad A Cupit <brad@(protected):
>>>>>>>>>
>>>>>>>>>>> JSTL has the <fmt:formatDate> tag. If you want to do it in
>> Java,
>>>>>>> rather
>>>>>>>>>>> than your JSP, you can use SimpleDateFormat.
>>>>>>>>>>>
>>>>>>>>>>> Be aware that SimpleDataFormat is not thread safe, so don't
>> assign it
>> to
>>>>>>> a
>>>>>>>>>>> static field or use it in a singleton. If you use it as an
>> instance
>>>>>>> field
>>>>>>>>>>> on an Action you'll be safe, since Actions are created per
>> request.
>>>>>>>>>>> If you want a thread safe version of SimpleDateFormat,
>> Jakarta
>>>>>>> Commons
>>>>>>> lang
>>>>>>>>>>> has FastDateFormat: http://commons.apache.org/lang/
>>>>>>>>>>>
>>>>>>>>>>> Brad Cupit
>>>>>>>>>>> Louisiana State University - UIS
>>>>>>>>>>> e-mail: brad@(protected)
>>>>>>>>>>> office: 225.578.4774
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> -----Original Message-----
>>>>>>>>>>> From: Adam Hardy [mailto:ahardy.struts@(protected)]
>>>>>>>>>>> Sent: Tuesday, April 08, 2008 12:11 PM
>>>>>>>>>>> To: Struts Users Mailing List
>>>>>>>>>>> Subject: date conversion
>>>>>>>>>>>
>>>>>>>>>>> Hi
>>>>>>>>>>>
>>>>>>>>>>> quick question, I can't find any specific mention of what I
>> want so I
>>>>>>>>>>> assume I
>>>>>>>>>>> have to code my own Converter.
>>>>>>>>>>>
>>>>>>>>>>> I need a date in the ISO format YYYY-MM-DD
>>>>>>>>>>>
>>>>>>>>>>> There is no converter that I can configure in the struts
>> package, is
>>>>>>> there?

Attachment:
user_185209.ezm (zipped)the synchronized is not needed
Adam Hardy wrote:
> Actually I use it in a static method on a utility class, and call
> SimpleDateFormat inside a synchronized block.
>
> Brad A Cupit on 09/04/08 13:51, wrote:
>>>> Consider placing the SimpleDateFormat as a local variable
>> exactly right
>>
>> or, consider using a ThreadLocal
>> or, consider using commons-lang's FastDateFormat
>>
>> http://commons.apache.org/lang/api-release/org/apache/commons/lang/time/
>> FastDateFormat.html
>>
>> Brad Cupit
>> Louisiana State University - UIS
>> e-mail: brad@(protected)
>> office: 225.578.4774
>>
>>
>> -----Original Message-----
>> From: Alberto A. Flores [mailto:aaflores@(protected),
>> April 09, 2008 7:48 AM
>> To: Struts Users Mailing List
>> Subject: Re: date conversion
>>
>> Consider placing the SimpleDateFormat as a local variable (within the
>> method) to avoid non-thread safe operations (guaranteed by the jvm
>> spec).
>>
>>
>> Brad A Cupit wrote:
>>> the static SimpleDateFormat (assuming this code is in an S2 Action
>> that
>>> is instantiated per request) is not thread safe.
>>>
>>>
>> http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#sy
>>> nchronization
>>>
>>> Brad Cupit
>>> Louisiana State University - UIS
>>>
>>> -----Original Message-----
>>> From: Zoran Avtarovski [mailto:zoran@(protected):
>>> Tuesday, April 08, 2008 7:30 PM
>>> To: Struts Users Mailing List
>>> Subject: Re: date conversion
>>>
>>> We had the same issue and went with writing a new converter (shown
>>> below).
>>> And then created a xwork-conversion.properties file pointing to it.
>>>
>>> Z.
>>>
>>> private final static SimpleDateFormat DATE_FORMAT = new
>>> SimpleDateFormat("dd/MM/yyyy"); @Override public Object
>>> convertFromString(Map context, String[] values, Class toType) throws
>>> TypeConversionException { try { return
>>> DATE_FORMAT.parse( values[0]); } catch (ParseException e) {
>>> e.printStackTrace(); throw new
>>> TypeConversionException("xwork.default.invalid.fieldvalue");
>>> }
>>> return null; } @Override public String convertToString(Map
>>> context, Object object) { Calendar cal =
>> Calendar.getInstance();
>>> cal.setTime((Date) object); try { return
>>> DATE_FORMAT.format(object); } catch (Exception e) {
>>> throw new TypeConversionException("xwork.default.invalid.fieldvalue");
>>> } }
>>>
>>>> Can you patch a whole class?
>>>>
>>>> What would be useful is parameterizable type converters, to specify
>>> the date
>>>> format in this case. (they're not parameterizable, are they?)
>>>>
>>>> Dave Newton on 08/04/08 22:13, wrote:
>>>>>> --- Adam Hardy <ahardy.struts@(protected):
>>>>>>>> One area where S1 actually had the upper hand :(
>>>>>> Submit a patch :)
>>>>>>
>>>>>> Dave
>>>>>>
>>>>>>>> Dave Newton on 08/04/08 18:36, wrote:
>>>>>>>>>> The built-in type converter uses "uses the SHORT format for the
>>> Locale
>>>>>>>>>> associated with the current request" according to the type
>>> conversion
>>>>>>>> docs,
>>>>>>>>>> so yes, you'll need to do your own if you're using a different
>>> input
>>>>>>>> format.
>>>>>>>>>> Looking through the XWork conversion code it's hard for me to
>>> tell what
>>>>>>>> it's
>>>>>>>>>> *actually* doing, though :/
>>>>>>>>>>
>>>>>>>>>> Dave
>>>>>>>>>>
>>>>>>>>>> --- Brad A Cupit <brad@(protected):
>>>>>>>>>>
>>>>>>>>>>>> JSTL has the <fmt:formatDate> tag. If you want to do it in
>>> Java,
>>>>>>>> rather
>>>>>>>>>>>> than your JSP, you can use SimpleDateFormat.
>>>>>>>>>>>>
>>>>>>>>>>>> Be aware that SimpleDataFormat is not thread safe, so don't
>>> assign it
>>> to
>>>>>>>> a
>>>>>>>>>>>> static field or use it in a singleton. If you use it as an
>>> instance
>>>>>>>> field
>>>>>>>>>>>> on an Action you'll be safe, since Actions are created per
>>> request.
>>>>>>>>>>>> If you want a thread safe version of SimpleDateFormat,
>>> Jakarta
>>>>>>>> Commons
>>>>>>>> lang
>>>>>>>>>>>> has FastDateFormat: http://commons.apache.org/lang/
>>>>>>>>>>>>
>>>>>>>>>>>> Brad Cupit
>>>>>>>>>>>> Louisiana State University - UIS
>>>>>>>>>>>> e-mail: brad@(protected)
>>>>>>>>>>>> office: 225.578.4774
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> -----Original Message-----
>>>>>>>>>>>> From: Adam Hardy [mailto:ahardy.struts@(protected)]
>>>>>>>>>>>> Sent: Tuesday, April 08, 2008 12:11 PM
>>>>>>>>>>>> To: Struts Users Mailing List
>>>>>>>>>>>> Subject: date conversion
>>>>>>>>>>>>
>>>>>>>>>>>> Hi
>>>>>>>>>>>>
>>>>>>>>>>>> quick question, I can't find any specific mention of what I
>>> want so I
>>>>>>>>>>>> assume I
>>>>>>>>>>>> have to code my own Converter.
>>>>>>>>>>>>
>>>>>>>>>>>> I need a date in the ISO format YYYY-MM-DD
>>>>>>>>>>>>
>>>>>>>>>>>> There is no converter that I can configure in the struts
>>> package, is
>>>>>>>> there?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Alberto A. Flores
http://www.linkedin.com/in/aflores

Attachment:
user_185200.ezm (zipped)Hi,
Can anyone point me to where the seperate sections of the struts.xml file
is described ?
I am specifically looking at what the valid values in the <result
type="???"/> element are ?
Many thanks
Ian
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
any order or other contract unless pursuant to explicit written agreement
or government initiative expressly permitting the use of e-mail for such
purpose.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Attachment:
user_185201.ezm (zipped)All this is linked right from the Core Developers Guide at
http://struts.apache.org/2.x/docs/guides.html. Click the result types link
and there you go.
Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications
> From: Ian Meikle <imeikle@(protected)>
> Reply-To: Struts Users Mailing List <user@(protected)>
> Date: Wed, 9 Apr 2008 16:33:40 +0200
> To: Struts Users Mailing List <user@(protected)>
> Subject: struts.xml
>
> Hi,
>
> Can anyone point me to where the seperate sections of the struts.xml file
> is described ?
>
> I am specifically looking at what the valid values in the <result
> type="???"/> element are ?
>
> Many thanks
>
> Ian
>
> ------------------------------------------------------------------------------
> ------------------------------------------------------------------------------
> -------------
> This is a PRIVATE message. If you are not the intended recipient, please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery.
> NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
> any order or other contract unless pursuant to explicit written agreement
> or government initiative expressly permitting the use of e-mail for such
> purpose.
> ------------------------------------------------------------------------------
> ------------------------------------------------------------------------------
> -------------
This email and any attachments ("Message") may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

Attachment:
user_185202.ezm (zipped)Well this give me some info, but for example
it does not explain what all the valid values of the "type" attribute are
and what each value means.
Is this documented anywhere ?
Regards
Ian
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
any order or other contract unless pursuant to explicit written agreement
or government initiative expressly permitting the use of e-mail for such
purpose.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Randy Burgess <RBurgess@(protected)>
09.04.2008 16:37
Please respond to
"Struts Users Mailing List" <user@(protected)>
To
Struts Users Mailing List <user@(protected)>
cc
Subject
Re: struts.xml
All this is linked right from the Core Developers Guide at
http://struts.apache.org/2.x/docs/guides.html. Click the result types link
and there you go.
Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications
> From: Ian Meikle <imeikle@(protected)>
> Reply-To: Struts Users Mailing List <user@(protected)>
> Date: Wed, 9 Apr 2008 16:33:40 +0200
> To: Struts Users Mailing List <user@(protected)>
> Subject: struts.xml
>
> Hi,
>
> Can anyone point me to where the seperate sections of the struts.xml
file
> is described ?
>
> I am specifically looking at what the valid values in the <result
> type="???"/> element are ?
>
> Many thanks
>
> Ian
>
>
------------------------------------------------------------------------------
>
------------------------------------------------------------------------------
> -------------
> This is a PRIVATE message. If you are not the intended recipient, please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery.
> NOTE: Regardless of content, this e-mail shall not operate to bind CSC
to
> any order or other contract unless pursuant to explicit written
agreement
> or government initiative expressly permitting the use of e-mail for such
> purpose.
>
------------------------------------------------------------------------------
>
------------------------------------------------------------------------------
> -------------
This email and any attachments ("Message") may contain legally privileged
and/or confidential information. If you are not the addressee, or if this
Message has been addressed to you in error, you are not authorized to
read, copy, or distribute it, and we ask that you please delete it
(including all copies) and notify the sender by return email. Delivery of
this Message to any person other than the intended recipient(s) shall not
be deemed a waiver of confidentiality and/or a privilege.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_185203.ezm (zipped)> Well this give me some info, but for example
> it does not explain what all the valid values of the "type" attribute are
> and what each value means.
>
> Is this documented anywhere ?
Look into the struts2-core.jar and find struts-default.xml, that will
give more information, then you can look here:
http://struts.apache.org/2.x/docs/result-types.html
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart

Attachment:
user_185204.ezm (zipped)Hi Lukasz,
Thanks very much for that. This has given me the info I needed.
Regards
Ian
CSC Solutions Norge AS
Registered Office: SandsliƄsen 57, 5254 Sandsli, Norway
Registered in Norway No: 958 958 455
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
any order or other contract unless pursuant to explicit written agreement
or government initiative expressly permitting the use of e-mail for such
purpose.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
"Lukasz Lenart" <lukasz.lenart@(protected)>
09.04.2008 17:15
Please respond to
"Struts Users Mailing List" <user@(protected)>
To
"Struts Users Mailing List" <user@(protected)>
cc
Subject
Re: struts.xml
> Well this give me some info, but for example
> it does not explain what all the valid values of the "type" attribute
are
> and what each value means.
>
> Is this documented anywhere ?
Look into the struts2-core.jar and find struts-default.xml, that will
give more information, then you can look here:
http://struts.apache.org/2.x/docs/result-types.html
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_185206.ezm (zipped)ResultTypes are illustrated here
http://struts.apache.org/2.x/docs/result-types.html
Is there anything specific you were looking for?
Tak/
Martin-
----- Original Message -----
From: "Ian Meikle" <imeikle@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Wednesday, April 09, 2008 1:40 PM
Subject: Re: struts.xml
Hi Lukasz,
Thanks very much for that. This has given me the info I needed.
Regards
Ian
CSC Solutions Norge AS
Registered Office: SandsliƄsen 57, 5254 Sandsli, Norway
Registered in Norway No: 958 958 455
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-----------------
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
any order or other contract unless pursuant to explicit written agreement
or government initiative expressly permitting the use of e-mail for such
purpose.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-----------------
"Lukasz Lenart" <lukasz.lenart@(protected)>
09.04.2008 17:15
Please respond to
"Struts Users Mailing List" <user@(protected)>
To
"Struts Users Mailing List" <user@(protected)>
cc
Subject
Re: struts.xml
> Well this give me some info, but for example
> it does not explain what all the valid values of the "type" attribute
are
> and what each value means.
>
> Is this documented anywhere ?
Look into the struts2-core.jar and find struts-default.xml, that will
give more information, then you can look here:
http://struts.apache.org/2.x/docs/result-types.html
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_185205.ezm (zipped)Hi Jeromy,
Thanks for the help. I tried to do the same thing with an xml file.
Instead of using failed.jsp, I returned an xml file failed.xml with some
hard coded error message and error code.
What if the file upload interceptor returned "input" for some other
reason? I would be returning the error code and message which says the
file is too large. How would I create the error message and code
dynamically depending on the actual error?
Rajeev
On Wed, 2008-04-09 at 22:22 +1000, Jeromy Evans wrote:
> Rajeev Sharma wrote:
> >
> > When I try to upload a file which is bigger then the max allowed size,
> > the file upload interceptor returns "input" and the control does not
> > come to the execute method of my action class. In this case I can
> > redirect the result to some JSP, to some other action etc, but how do I
> > return a xml response with the error description and some error code.
> >
> >
> Hi Rajeev,
>
> It sounds like you just want an action to return an XML result (for an
> "input" result).
> A very simple way to do that is return a JSP with contentType="text/xml".
>
> in struts.xml:
> <result name="input">failed.jsp</result>
> in the failed.jsp:
>
> <%@(protected)" %>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <message>Too big!</message>
>
>
> You can use properties in your XML as you would with a JSP result.
>
> There's also an XSLT result type available or you could use a Bean->XML
> serializer like XStream.
>
> Hope that helps,
> Jeromy Evans
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)

Attachment:
user_185207.ezm (zipped)If you dont mind using freemarker you can always use
exception-interceptor.html
http://struts.apache.org/2.x/docs/exception-interceptor.html
M--
----- Original Message -----
From: "Rajeev Sharma" <rajeev.sharma@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Wednesday, April 09, 2008 1:59 PM
Subject: Re: problem in file upload
> Hi Jeromy,
>
> Thanks for the help. I tried to do the same thing with an xml file.
> Instead of using failed.jsp, I returned an xml file failed.xml with some
> hard coded error message and error code.
>
> What if the file upload interceptor returned "input" for some other
> reason? I would be returning the error code and message which says the
> file is too large. How would I create the error message and code
> dynamically depending on the actual error?
>
> Rajeev
>
> On Wed, 2008-04-09 at 22:22 +1000, Jeromy Evans wrote:
> > Rajeev Sharma wrote:
> > >
> > > When I try to upload a file which is bigger then the max allowed size,
> > > the file upload interceptor returns "input" and the control does not
> > > come to the execute method of my action class. In this case I can
> > > redirect the result to some JSP, to some other action etc, but how do
I
> > > return a xml response with the error description and some error code.
> > >
> > >
> > Hi Rajeev,
> >
> > It sounds like you just want an action to return an XML result (for an
> > "input" result).
> > A very simple way to do that is return a JSP with
contentType="text/xml".
> >
> > in struts.xml:
> > <result name="input">failed.jsp</result>
> > in the failed.jsp:
> >
> > <%@(protected)" %>
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <message>Too big!</message>
> >
> >
> > You can use properties in your XML as you would with a JSP result.
> >
> > There's also an XSLT result type available or you could use a Bean->XML
> > serializer like XStream.
> >
> > Hope that helps,
> > Jeromy Evans
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185210.ezm (zipped)Is there a complete working example for the tabbedPanel tag? I found
this example in the tag reference document. How do I set up the result
for AjaxTest.action? I loaded the dynamic contents in that action and
directed it to the jsp that displays that content. The action was
invoked, but the tab shows up empty. I tried to include the jsp inside
the s:div tag and still nothing.
<s:tabbedpanel id="test" beforeSelectTabNotifyTopics="/beforeSelect">
<s:div id="three" label="remote" theme="ajax" href="/AjaxTest.action"
>
One Tab
</s:div>
<s:div id="three" label="remote" theme="ajax" href="/AjaxTest.action"
>
Another tab
</s:div>
</s:tabbedpanel>
Thanks a lot for your help,
Jane

Attachment:
user_185214.ezm (zipped)There are examples in the showcase application.
musachy
On Wed, Apr 9, 2008 at 8:55 PM, Jiang, Jane (NIH/NCI) [C]
<jiangja@(protected):
> Is there a complete working example for the tabbedPanel tag? I found
> this example in the tag reference document. How do I set up the result
> for AjaxTest.action? I loaded the dynamic contents in that action and
> directed it to the jsp that displays that content. The action was
> invoked, but the tab shows up empty. I tried to include the jsp inside
> the s:div tag and still nothing.
>
> <s:tabbedpanel id="test" beforeSelectTabNotifyTopics="/beforeSelect">
> <s:div id="three" label="remote" theme="ajax" href="/AjaxTest.action"
> >
> One Tab
> </s:div>
> <s:div id="three" label="remote" theme="ajax" href="/AjaxTest.action"
> >
> Another tab
> </s:div>
> </s:tabbedpanel>
>
> Thanks a lot for your help,
>
> Jane
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_185211.ezm (zipped)
For Struts 2:
Does anyone know if it is possible to put the validation.xml for an Action
in a folder other than where the action resides? If I have a 100 java
classes in my action package, I would like their *-validation.xmls to be in
a separate folder such that all .java's are together and all .xml's are
together. I couldn't find any configuration in struts2 to achieve this.
Any help is appreciated.
Thanks.
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_185218.ezm (zipped)goelshek wrote:
> For Struts 2:
>
> Does anyone know if it is possible to put the validation.xml for an Action
> in a folder other than where the action resides? If I have a 100 java
> classes in my action package, I would like their *-validation.xmls to be in
> a separate folder such that all .java's are together and all .xml's are
> together. I couldn't find any configuration in struts2 to achieve this.
You can put the .xml files in a separate folder from the .java files,
sure, as long as your build process copies them to the right place on
the classpath. I don't think there's a way to have them in a different
folder than the .class files though. Sounds like you'd be better off
breaking out your actions into sub-packages anyway.
L.

Attachment:
user_185219.ezm (zipped)
"as your build process copies them to the right place on the classpath. I
don't think there's a way to have them in a different folder than the .class
files though"
I don't really have a formal build process for now. So what's in my
/WEB-INF/src folder is going to be in my /WEB-INF/classes folder with the
.class files instead of the .java files. So yes, I do want to be able to
have .xml and .class files (not just .java files) in separate folders; my
bad on that one, I should have been more explicit.
"Sounds like you'd be better off breaking out your actions into sub-packages
anyway."
I agree. 100 was an exaggerated number, just to make a point of what I am
looking for.
Laurie Harper wrote:
>
> goelshek wrote:
>> For Struts 2:
>>
>> Does anyone know if it is possible to put the validation.xml for an
>> Action
>> in a folder other than where the action resides? If I have a 100 java
>> classes in my action package, I would like their *-validation.xmls to be
>> in
>> a separate folder such that all .java's are together and all .xml's are
>> together. I couldn't find any configuration in struts2 to achieve this.
>
> You can put the .xml files in a separate folder from the .java files,
> sure, as long as your build process copies them to the right place on
> the classpath. I don't think there's a way to have them in a different
> folder than the .class files though. Sounds like you'd be better off
> breaking out your actions into sub-packages anyway.
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_185212.ezm (zipped)Hello. To preface I am very new to using Apache. I am attempting to
experiment locally, however I cannot connect to local host nor the
127.0.0.1 directly. I am looking to try and get the "IT works!" Apache
screen to display, but to no avail thus far. I have verified that my
host config file in windows\system32\drivers\hosts shows the correct ip.
I am using Window 2000 and do have Norton antivirus; however, no client
firewall.
Thanks for the help

Attachment:
user_185213.ezm (zipped)I hope you have long legs because you're trying to climb 2 very steep
mountains simultaneously
1st) subscribe to tomcat-users list..the folks that answer your question
eat/live and breathe TC 24/7
http://tomcat.apache.org/lists.html#tomcat-users
then of course you'll want to look at getting your TC <Version> up and
running and fully operational
http://tomcat.apache.org/
A rather nice explanation located here
http://www.coreservlets.com/Apache-Tomcat-Tutorial/
2)
getting Struts Webapp up and running
If this is the first time for both you have a rather steep climb ahead
http://exadel.com/tutorial/struts/5.2/guess/strutsintro.html
All kinds of wonderful doc/tutorials and distros available from the official
Struts site located at
http://struts.apache.org/2.x/
suggestions gentlemen?
M-
----- Original Message -----
From: "Hartford Cory-C23423" <Cory.M.Hartford@(protected)>
To: <user@(protected)>
Sent: Wednesday, April 09, 2008 5:14 PM
Subject: Local Host Error
Hello. To preface I am very new to using Apache. I am attempting to
experiment locally, however I cannot connect to local host nor the
127.0.0.1 directly. I am looking to try and get the "IT works!" Apache
screen to display, but to no avail thus far. I have verified that my
host config file in windows\system32\drivers\hosts shows the correct ip.
I am using Window 2000 and do have Norton antivirus; however, no client
firewall.
Thanks for the help

Attachment:
user_185215.ezm (zipped)lbastil wrote:
> Thank you for the help.
> But I could not get it to work.
>
> Here is a code sample from the Action Class:
>
> ....
> private Set<TraegerPermission> traegerPermissions;
> ....
>
> The class TraegerPermissions itself have another collection:
> ....
> private Collection<EinrichtungPermission> einrichtungen;
> ....
And both TraegerPermission and EinrichtungPermission define the
appropriate getter and setter methods for the id, number, name and
writepermission properties?
> In jsp I have successful read access:
> ....
> <s:iterator value="traegerPermissions" id="item">
> [...]
> <s:checkbox ... name="writepermission" ... value="%{writePermission}"/>
> [...]
> <s:iterator value="%{einrichtungen}">
> [...]
> <s:checkbox ... name="writePermission" ... value="%{writePermission}"/>
In neither case are you binding the checkbox input fields to the
underlying model. You need to change the 'name' attributes to fully
dereference the model property so Struts knows where to store the
submitted values. Something like this (untested):
<s:iterator value="traegerPermissions" index="i1">
<s:checkbox name="traegerPermissions[i1.index]" .../>
<s:iterator value="einrichtungen" index="i2">
<s:checkbox
name="traegerPermissions[i1.index].einrichtungen[i2.index]" .../>
Take a look at the various example applications, as the above may not be
exactly right (that's just off the top of my head).
L.
> what shall I save in order to can write back changes in the Checkboxes
> to the model by struts2 out of box approach?
>
> I tries several settings without success ...
>
> thank you,
> Basti
>
>
>
> Laurie Harper wrote:
>> Provided the checkbox is properly bound to the collection entry, yes.
>> You need to specify the name of the s:checkbox (or any other input type)
>> as userCollection[index].userProperty where 'userCollection' is the name
>> of the Collection property on your action, index comes from the iterator
>> and userProperty is the property to bind to.
>>
>> L.
>>
>> lbastil wrote:
>>> Thank you for reply!
>>>
>>> I just wonder:
>>>
>>> I understand it would work out of box for 1 User-Object, if I bound
>>> checkbox
>>> to permission property of this user.
>>> But I wonder it should work out of box if I use (as I described)
>>> Collection
>>> of Users in Action
>>> and on jsp side iterator tag, and checkbox tag within iterator is bound
>>> to
>>> permission properties of users in the iterated Collection.
>>>
>>> This does not matter, it should work the same as for single user object?
>>>
>>>
>>> Thank you,
>>> Basti
>>>
>>>
>>> Laurie Harper wrote:
>>>> lbastil wrote:
>>>>> Hello,
>>>>>
>>>>> I have the following problem:
>>>>>
>>>>> in action i have a collection of class User
>>>>> each class User have different attributes, one is: boolean permission
>>>>>
>>>>> in JSP I use struts 2 iterator tag to iterate the User Objects.
>>>>> For each User entry I create one row in table.
>>>>> for displaying/changing the boolean permission value I use S2 checkbox
>>>>> tag
>>>>>
>>>>> so far it works fine and show all data in collection of Users correct.
>>>>>
>>>>> But how can I set changed checkbox values (the permission attribute)
>>>>> back
>>>>> to
>>>>> action?
>>>> If your checkbox is bound the the permission property of the user,
>>>> submitting the form should update the property. If that's not happening,
>>>> you need to give more details: what your JSP code looks like, and the
>>>> relevant bits of your action and User code, at least.
>>>>
>>>> L.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>> For additional commands, e-mail: user-help@(protected)
>>>>
>>>>
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>

Attachment:
user_185216.ezm (zipped)Neither Commons Validator nor Struts knows how to process XML requests
like that out of the box. Assuming Struts 1, the answer is that you will
have to write your own logic to populate the form bean from the XML
request, after which validation can be performed the same as you would
with a regular request.
L.
Ghaznavi, Syed wrote:
> It's a question regarding commons validator api, wherein i am trying to
> validate an input request form (xml-request) which contains a collection
> of
> items...like
>
> <OrdersInputRequest>
> <Order>
> <OrderId>222</OderId>
> <OrderDate>04/04/2004</OrderDate>
> </Order>
> <Order>
> <OrderId>223</OderId>
> <OrderDate>04/04/2004</OrderDate>
> </Order>
> </OrderInputRequest>
>
> What would be the valid format for the commons-validator form to
> validate
> this input request? Since there can be any number of Orders
> (
java.util.ArrayList) in the request and all the items have the same
> validation.
> I looked at the examples on the project but couldn't find any
> solution...
>
> * <formset>
> <form name="OrdersRequestValidationForm">
> <field property="OrderId" type="Integer" depends="required">
> </field>
> <field property="OrderDate" type="String" depends="required">
> </field>
> </form>
> </formset> *
>
> Any assistance on this is appreciated..
>
> Thanks!
>
> --Syed Ghaznavi

Attachment:
user_185217.ezm (zipped)manishbel wrote:
> Hello,
>
> I am trying to use the Preparable but having some problems while the page is
> being rendered. I will try my best to explain the problem, please ask if you
> need more information as i might not be able to accurately explain the
> problem as i am pretty new to struts2.
>
> Scenario:
> User should be able to create the EmailDistributionList and create email
> Addresses under it.
>
> My first attempt is to be able to create the Group Itself . So i introduced
> an action which implements Preparable interface.
>
> The Action provides
> 1.) List of currently avaialable groups- displayed as dropdown on the
> screen.
> 2.) has a group id based on which it tries to decide whether to load data
> from the databse or not. e.g. if the user
> lands for the first time on the page there would be no id in the rquest
> hence the id would not have any data in
> it. it is similar to the CRUD example on struts website.
>
> Creation and saving of the group went ok, the problem occured when i load
> the data from the databse and try to display it on the screen.
>
> i have defined just one action in struts.xml to accomplish this. when the
> user arrives for the first time through the menu item which is of course a
> get request , the user is provided with list of available groups and a blank
> description field (since it does not have any id in the request).
>
> When the user changes selection in the drop down i do a post to the same
> action which binds the id to group id field in the action. It works ok as
> far as it has the id in the request and loads the data from the databse and
> stuff. but as soon as it reaches the screen and when it tries to extract
> data out of the domain it wipes out the fields from the group domain, e.g.
> If the Group had id name and description, and i try to display the
> description on the page like <s:textarea name="group.description"/> the page
> shows nothing in it even though the id was passed to the action and logger
> statements show that the group has the description on the server side.
>
> I used <s:debug/> tag to see more information but even in that information
> it shows that the description is blank. I am trying to solve this problem
> for a long time but have been unsuccessful in resolving it, your help would
> be greatly appreciated.
Firstly, this doesn't appear to have anything to do with the Preparale
interface, it would seem to be a problem with data rendering (since you
say the group is retrieved correctly).
Start with the basics:
- Does you action have a getGroup() getter defined?
- Does it correctly return the group loaded from the database?
- Does the group returned by getGroup() actually contain data?
I'd suggest adding some logging in your getGroup() method to confirm
that it's really returning the data you think it should be. If that
checks out, there's likely a problem in your JSP somewhere.
L.