Author Login
Post Reply
user Digest 11 Apr 2008 12:54:06 -0000 Issue 7974
Topics (messages 185273 through 185302):
Re: interesting proxy + action chain issue
185273 by: Guillaume Bilodeau
185277 by: Brad A Cupit
185281 by: Guillaume Bilodeau
185288 by: Ian Meikle
185290 by: Jeromy Evans
Re: How to show html generated files?
185274 by: Musachy Barroso
404 Not Found :Parsing error processing resource path /WEB-INF/cfg/struts-config.xml
185275 by: hardik pandya
185287 by: Antonio Petrelli
Re: How can I tell Struts 2 to throw/log exceptions for invalid OGNL Expressions
185276 by: mraible
Re: Does Struts 2 support clustering?
185278 by: mojoRising
185280 by: Randy Burgess
Re: S2 Textfield tag date formatting
185279 by: Guillaume Bilodeau
how do i make the tomcat server send a 403 Forbidden response in JSP and in Struts?
185282 by: ryan webb
tc5.x caching jsp
185283 by: Chris Pat
How do I make Tomcat send 403 Forbidden page to the client in jsp and in struts?
185284 by: ryan webb
Validation result URL contains failed parameters
185285 by: Guillaume Bilodeau
185293 by: Laurie Harper
Re: i18n Tags in FreeMarker Decorator for SiteMesh
185286 by: Jeromy Evans
FileUpload exception
185289 by: Pablo Vázquez Blázquez
problem to run struts application on tomcat5.0
185291 by: ashishSaxena
[OT] UML and Reverse Engineering
185292 by: Ashish Kulkarni
185295 by: Jeromy Evans
185296 by: Brad A Cupit
185297 by: Antonio Petrelli
Scheduled DB clean up service with Struts2
185294 by: Peter Theissen
185298 by: Frank Fischer
185299 by: Brad A Cupit
185300 by: Gabriel Belingueres
185301 by: Gabriel Belingueres
185302 by: Peter Theissen
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_185273.ezm (zipped)
Hi Brad,
Have you tried this:
http://www.vitarara.org/cms/struts_2_cookbook/post_and_redirect
I've used this for a while with good results, although recently I've
stumbled on WW-2170 ( https://issues.apache.org/struts/browse/WW-2170 ). It
seems to occur only when using annotations though.
Cheers,
GB
Brad A Cupit wrote:
>
> The only problem with the scope plugin is that it will use the session,
> which may break the whole notion of POST-redirect-GET: if the data in
> the session is removed or replaced by later requests, then pressing the
> back or refresh buttons on the initial page with errors will not yield
> the same response.
>
> I think it would be cool if the errors were url parameters as part of
> the redirect, but there's currently no easy way to do this. Could a
> custom interceptor realize that the result is a redirect and turn the
> validation errors into url parameters? Or would this need to be a custom
> result class (perhaps extending ServletRedirectResult or
> ServletActionRedirectResult)?
>
> Brad Cupit
> Louisiana State University - UIS
>
> -----Original Message-----
> From: Jeromy Evans [mailto:jeromy.evans@(protected)]
> Sent: Tuesday, April 08, 2008 6:24 PM
> To: Struts Users Mailing List
> Subject: Re: interesting proxy + action chain issue
>
> Ian Meikle wrote:
>> HI,
>>
>> I have been following this post with interest since I used the PRG
> pattern
>> in previous projects.
>> We are using struts 2 in are current project and I like the
> errorMessages
>> behaviour that is part of the Action.
>>
>> Is it possible to persist these over the PRG cycle ?
>> By default I assume they would be lost when we get to the GET stage
> since
>> they are request scope and the GET is a seperate request than the POST
>
>> that caused the error.
>>
>>
>
> Hi Ian,
> This is an issue that Struts2 needs to handle better. It can be done
> but its not as straight-forward as it could be.
>
> The scope interceptor [1] provides this feature. It allows you to
> specify which properties should be bound to session or application scope
>
> and injected into the action.
> The scoped modeldriven interceptor is for modeldriven actions [2]. Both
>
> are included in the default stack.
>
> The scope plugin allows annotations to specify which properties persist
> over a cycle. It's not bundled with struts but I have heard good
> comments about it [4].
>
> [1] http://cwiki.apache.org/WW/scope-interceptor.html
> [2] http://cwiki.apache.org/WW/scoped-model-driven-interceptor.html
> [3] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
> [4] http://article.gmane.org/gmane.comp.jakarta.struts.devel/65052
>
> ---------------------------------------------------------------------
> 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)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_185277.ezm (zipped)Hi Guillaume,
yep, I'm familiar with the ServletActionRedirectResult, and I'm
especially familiar with bug you mentioned (you and I both commented on
it, asking for a backport to 2.0.x...on that note, anyone with commit
access want to backport https://issues.apache.org/struts/browse/WW-2170
and release 2.0.12? The patch is there and ready to go) :-)
What I'm not sure how to do is to get the error messages into the
redirect url, and it seems like something you'd want often enough for it
to be built-in to ServletActionRedirectResult (or a class which extends
it).
Brad Cupit
Louisiana State University - UIS
-----Original Message-----
From: Guillaume Bilodeau [mailto:gbilodeau@(protected)]
Sent: Thursday, April 10, 2008 1:24 PM
To: user@(protected)
Subject: RE: interesting proxy + action chain issue
Hi Brad,
Have you tried this:
http://www.vitarara.org/cms/struts_2_cookbook/post_and_redirect
I've used this for a while with good results, although recently I've
stumbled on WW-2170 ( https://issues.apache.org/struts/browse/WW-2170 ).
It
seems to occur only when using annotations though.
Cheers,
GB
Brad A Cupit wrote:
>
> The only problem with the scope plugin is that it will use the
session,
> which may break the whole notion of POST-redirect-GET: if the data in
> the session is removed or replaced by later requests, then pressing
the
> back or refresh buttons on the initial page with errors will not yield
> the same response.
>
> I think it would be cool if the errors were url parameters as part of
> the redirect, but there's currently no easy way to do this. Could a
> custom interceptor realize that the result is a redirect and turn the
> validation errors into url parameters? Or would this need to be a
custom
> result class (perhaps extending ServletRedirectResult or
> ServletActionRedirectResult)?
>
> Brad Cupit
> Louisiana State University - UIS
>
> -----Original Message-----
> From: Jeromy Evans [mailto:jeromy.evans@(protected)]
> Sent: Tuesday, April 08, 2008 6:24 PM
> To: Struts Users Mailing List
> Subject: Re: interesting proxy + action chain issue
>
> Ian Meikle wrote:
>> HI,
>>
>> I have been following this post with interest since I used the PRG
> pattern
>> in previous projects.
>> We are using struts 2 in are current project and I like the
> errorMessages
>> behaviour that is part of the Action.
>>
>> Is it possible to persist these over the PRG cycle ?
>> By default I assume they would be lost when we get to the GET stage
> since
>> they are request scope and the GET is a seperate request than the
POST
>
>> that caused the error.
>>
>>
>
> Hi Ian,
> This is an issue that Struts2 needs to handle better. It can be done
> but its not as straight-forward as it could be.
>
> The scope interceptor [1] provides this feature. It allows you to
> specify which properties should be bound to session or application
scope
>
> and injected into the action.
> The scoped modeldriven interceptor is for modeldriven actions [2].
Both
>
> are included in the default stack.
>
> The scope plugin allows annotations to specify which properties
persist
> over a cycle. It's not bundled with struts but I have heard good
> comments about it [4].
>
> [1] http://cwiki.apache.org/WW/scope-interceptor.html
> [2] http://cwiki.apache.org/WW/scoped-model-driven-interceptor.html
> [3] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
> [4] http://article.gmane.org/gmane.comp.jakarta.struts.devel/65052
>
> ---------------------------------------------------------------------
> 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)
>
>
>
--
http://www.nabble.com/interesting-proxy-%2B-action-chain-issue-tp1654447
2p16612701.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_185281.ezm (zipped)
I'm not sure if I'm missing something here, but using the
ServletActionRedirectResult with parse=true and extra parameters does
include these parameters in the redirect URL.
The problem is that this mechanism is limited to string-based (or
string-parseable) parameters, so you're ruling out objects like an ArrayList
that would contain error messages. That's where something like flash scope
would be useful and is unfortunately lacking in 2.0.
Cheers,
GB
Brad A Cupit wrote:
>
> Hi Guillaume,
> yep, I'm familiar with the ServletActionRedirectResult, and I'm
> especially familiar with bug you mentioned (you and I both commented on
> it, asking for a backport to 2.0.x...on that note, anyone with commit
> access want to backport https://issues.apache.org/struts/browse/WW-2170
> and release 2.0.12? The patch is there and ready to go) :-)
>
> What I'm not sure how to do is to get the error messages into the
> redirect url, and it seems like something you'd want often enough for it
> to be built-in to ServletActionRedirectResult (or a class which extends
> it).
>
> Brad Cupit
> Louisiana State University - UIS
>
>
> -----Original Message-----
> From: Guillaume Bilodeau [mailto:gbilodeau@(protected)]
> Sent: Thursday, April 10, 2008 1:24 PM
> To: user@(protected)
> Subject: RE: interesting proxy + action chain issue
>
>
> Hi Brad,
>
> Have you tried this:
> http://www.vitarara.org/cms/struts_2_cookbook/post_and_redirect
>
> I've used this for a while with good results, although recently I've
> stumbled on WW-2170 ( https://issues.apache.org/struts/browse/WW-2170 ).
> It
> seems to occur only when using annotations though.
>
> Cheers,
> GB
>
>
> Brad A Cupit wrote:
>>
>> The only problem with the scope plugin is that it will use the
> session,
>> which may break the whole notion of POST-redirect-GET: if the data in
>> the session is removed or replaced by later requests, then pressing
> the
>> back or refresh buttons on the initial page with errors will not yield
>> the same response.
>>
>> I think it would be cool if the errors were url parameters as part of
>> the redirect, but there's currently no easy way to do this. Could a
>> custom interceptor realize that the result is a redirect and turn the
>> validation errors into url parameters? Or would this need to be a
> custom
>> result class (perhaps extending ServletRedirectResult or
>> ServletActionRedirectResult)?
>>
>> Brad Cupit
>> Louisiana State University - UIS
>>
>> -----Original Message-----
>> From: Jeromy Evans [mailto:jeromy.evans@(protected)]
>> Sent: Tuesday, April 08, 2008 6:24 PM
>> To: Struts Users Mailing List
>> Subject: Re: interesting proxy + action chain issue
>>
>> Ian Meikle wrote:
>>> HI,
>>>
>>> I have been following this post with interest since I used the PRG
>> pattern
>>> in previous projects.
>>> We are using struts 2 in are current project and I like the
>> errorMessages
>>> behaviour that is part of the Action.
>>>
>>> Is it possible to persist these over the PRG cycle ?
>>> By default I assume they would be lost when we get to the GET stage
>> since
>>> they are request scope and the GET is a seperate request than the
> POST
>>
>>> that caused the error.
>>>
>>>
>>
>> Hi Ian,
>> This is an issue that Struts2 needs to handle better. It can be done
>> but its not as straight-forward as it could be.
>>
>> The scope interceptor [1] provides this feature. It allows you to
>> specify which properties should be bound to session or application
> scope
>>
>> and injected into the action.
>> The scoped modeldriven interceptor is for modeldriven actions [2].
> Both
>>
>> are included in the default stack.
>>
>> The scope plugin allows annotations to specify which properties
> persist
>> over a cycle. It's not bundled with struts but I have heard good
>> comments about it [4].
>>
>> [1] http://cwiki.apache.org/WW/scope-interceptor.html
>> [2] http://cwiki.apache.org/WW/scoped-model-driven-interceptor.html
>> [3] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
>> [4] http://article.gmane.org/gmane.comp.jakarta.struts.devel/65052
>>
>> ---------------------------------------------------------------------
>> 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)
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/interesting-proxy-%2B-action-chain-issue-tp1654447
> 2p16612701.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_185288.ezm (zipped)Hi Jeromy,
Thanks for the info.
Several of the interceptors require configuring, for example the Scope
interceptor.
The example provides some examples of this. However it seems that the only
way to configure a interceptor is to redefine an interceptor stack.
Is this correct ?
Can I not just use the default stack, and configure the specific
interceptor for a specific actions use ?
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.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Jeromy Evans <jeromy.evans@(protected)>
09.04.2008 01:23
Please respond to
"Struts Users Mailing List" <user@(protected)>
To
Struts Users Mailing List <user@(protected)>
cc
Subject
Re: interesting proxy + action chain issue
Ian Meikle wrote:
> HI,
>
> I have been following this post with interest since I used the PRG
pattern
> in previous projects.
> We are using struts 2 in are current project and I like the
errorMessages
> behaviour that is part of the Action.
>
> Is it possible to persist these over the PRG cycle ?
> By default I assume they would be lost when we get to the GET stage
since
> they are request scope and the GET is a seperate request than the POST
> that caused the error.
>
>
Hi Ian,
This is an issue that Struts2 needs to handle better. It can be done
but its not as straight-forward as it could be.
The scope interceptor [1] provides this feature. It allows you to
specify which properties should be bound to session or application scope
and injected into the action.
The scoped modeldriven interceptor is for modeldriven actions [2]. Both
are included in the default stack.
The scope plugin allows annotations to specify which properties persist
over a cycle. It's not bundled with struts but I have heard good
comments about it [4].
[1] http://cwiki.apache.org/WW/scope-interceptor.html
[2] http://cwiki.apache.org/WW/scoped-model-driven-interceptor.html
[3] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
[4] http://article.gmane.org/gmane.comp.jakarta.struts.devel/65052
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_185290.ezm (zipped)Ian Meikle wrote:
> Hi Jeromy,
>
> Thanks for the info.
> Several of the interceptors require configuring, for example the Scope
> interceptor.
> The example provides some examples of this. However it seems that the only
> way to configure a interceptor is to redefine an interceptor stack.
> Is this correct ?
> Can I not just use the default stack, and configure the specific
> interceptor for a specific actions use ?
>
> Regards
> Ian
>
>
Hi Ian,
If you define your actions in Struts.xml you can include an
<interceptor-ref> tag that references an interceptor to use and/or
interceptor stack to use.
Order is important; you can insert an interceptor before or after the
stack. You can only insert interceptors into a stack by splitting the
stack definition.
Here's an example I frequently use to get achieve params-prepare-params
pattern. Params:
<action name="myAction" class="myClass">
<interceptor-ref name="params"/> <!-- allow prepare to
load info-->
<interceptor-ref name="user"/>
<result...>
If you're using annotations, as far as I know you need to setup a
package with an appropriate stack and reference the package.
The scope plugin allows you to use annotations to configure the scope
rather than the xml/package.
Does that help?
regards,
Jeromy Evans

Attachment:
user_185274.ezm (zipped)You can read those files and write them to the outputstream.
musachy
On Thu, Apr 10, 2008 at 6:11 PM, Jerome <jerome@(protected):
> Hi all
> i'm using Struts to make a web interface for a bioinformatic application
> developed here. With Struts i can check out the validity of the input data,
> control the job running on our cluster, and get back the result.
>
> Here is my problem: the result are made of various html files. How can i
> show all this file using my web application? My first idea was to extract
> all this files on an apache server and redirect with a struts action to
> point on this page. But i would like to put all this files on a temporal
> directory on my web applcation. This is possible with Struts?
>
> Hope that's someone can give me some idea..
>
> Thank's all for this very good stuff.
>
> Best regards.
>
> --
> -- Jérôme
> Qui s'est brûlé la langue n'oublie plus de souffler sur sa soupe.
> (Proverbe allemand)
>
> ---------------------------------------------------------------------
> 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_185275.ezm (zipped)>
> Hello All,
>
> I get this error, when I click on submit button
>
> *404 Not Found :
> Servlet error:* Parsing error processing resource path
> /WEB-INF/cfg/struts-config.xml
>
> I am using <set-property> tags inside action-mapping to access Application
> Module from Bc4jContext in struts action class. When I comment those tags,
> it does not give that eror
>
> These two errors are consistent and I do not know, whats the problem,
>
> Everything is included in classpath, but still TLD *warnings* (not a
> registered namespace) on all jsp pages comes up.
>
> This is my : struts-config.xml DTD
>
> <?xml version = '1.0' encoding = 'windows-1252'?>
> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
> Configuration 1.1//EN" "
> http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
>
> can somebody please point me whats wrong here ??
>
> Thank you all in advance,
>
>

Attachment:
user_185287.ezm (zipped)2008/4/10, hardik pandya <hardik.hardikpandya2000@(protected)>:
>
> Hello All,
>
> I get this error, when I click on submit button to Action Class
>
> *404 Not Found :
> Servlet error:* Parsing error processing resource path
> /WEB-INF/cfg/struts-config.xml
Did you validate your struts-config.xml against the DTD?
If yes, can we see it?
Antonio

Attachment:
user_185276.ezm (zipped)
Following up months later as this has come up again now that 2.1 is close to
release. The current version does log messages for invalid properties, but
it doesn't blow up for invalid properties which is more of what I'm looking
for.
When I blogged about this[1], one of the responses was the following:
> When you are using freemarker as your result technology in struts2 you get
> great feedback on problems like this. This is not indicative of the whole
> framework -- just the result-type that you are using (probably jsp?)
>
I tried FreeMarker this morning and discovered that the problem exists there
too. Grrr. I've experienced Struts 2 being eliminated as a web framework
candidate on a couple projects because of this. Kindof annoying.
Matt
[1] http://raibledesigns.com/rd/entry/does_struts_2_suck
Ted Husted wrote:
>
> Good point. Feel free to open a S2 JIRA ticket that cross-references
> XW-557 (since I'm not sure if its something we could do here or not)
> -- and feel even more free to submit a patch!
>
> As usual, we are short of active volunteers, and we can always use a
> hand with the code!
>
> -Ted.
>
> On 9/6/07, mraible <matt@(protected):
>>
>> struts.devMode=true will catch setting invalid properties, but not
>> reading
>> from them. I want to be warned when a property/method doesn't exist. Or
>> in
>> the instance of calling stating methods with FQCN, I want to be made
>> aware
>> when I fat finger the package name. If I could use JSP's import and then
>> read from the package, that'd be even nicer. It's somewhat verbose to
>> call
>> FQ static methods. I suppose I could move the methods into my action, so
>> it's not too bad.
>>
>> Matt
>
> ---------------------------------------------------------------------
> 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_185278.ezm (zipped)
Thanks. That is what I suspect also but I am trying to weed out other
possibilities... can I then take your response to mean : "Yes, Struts 2 DOES
support clustering"?
newton.dave wrote:
>
>
> This is almost certainly a server configuration issue; in general nothing
> on
> the framework / application side should have anything to do with session
> management or even be aware of it.
>
> Dave
>
> ---------------------------------------------------------------------
> 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_185280.ezm (zipped)You can configure sticky sessions, which means that requests that go to one
server in your cluster will always go to that server. To me this defeats the
purpose of the cluster because if that machine goes down the user will be
sent to another server, but their session will be gone with the down server.
However this is the best performing configuration. Another option is shared
sessions and this is covered in the WebLogic documentation at
http://edocs.bea.com. How or if the session is shared in a cluster has
nothing to do with Struts or any web application really.
Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications
> From: mojoRising <jpiser@(protected)>
> Reply-To: Struts Users Mailing List <user@(protected)>
> Date: Thu, 10 Apr 2008 13:45:11 -0700 (PDT)
> To: <user@(protected)>
> Subject: Re: Does Struts 2 support clustering?
>
>
> Thanks. That is what I suspect also but I am trying to weed out other
> possibilities... can I then take your response to mean : "Yes, Struts 2 DOES
> support clustering"?
>
>
>
> newton.dave wrote:
>>
>>
>> This is almost certainly a server configuration issue; in general nothing
>> on
>> the framework / application side should have anything to do with session
>> management or even be aware of it.
>>
>> Dave
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Does-Struts-2-support-clustering--tp16609897p16617641.ht
> ml
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
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_185279.ezm (zipped)
That note about not using type conversion for dates probably has to do with
the fact that dates can be formatted and so parsed using different patterns
depending on different locales. If your code uses a fixed pattern such as
yours, I suppose you can ignore this.
So based on that, you can simply use a Date property in your action or a
nested model object and annotate it with a @TypeConversion with a custom
type converter.
Cheers,
GB
akinss wrote:
>
> I'm trying to use a textfield tag for date input. I need to format this
> in
> the form dd/MM/yyyy HH:mm:ss
>
> The teaxtfield tag formats the date to a Locale based format
> DateFormat.SHORT via XWorkBasicConverter. For my locale this turns out
> to
> be dd/MM/yy. This is not the format I want.
>
> <s:textfield cssClass="field" key="filter.dateTimeStart"
> name="filter.dateTimeStart"/>
>
> DateTimePicker wont allow you to apply a style class to the input field so
> it wont format. Bug has been reported in Struts JIRA (WW-1778) and a fix
> made. Need to wait for Struts 2.1 before this will work so I can't use
> this.
>
> Using the value parameter and a date tag won't work because this
> overwrites
> the value entered. If the user enters a value that can't be converted to
> a
> date it isn't re-displayed, the field is displayed empty.
>
> <s:textfield cssClass="field" key="filter.dateTimeStart"
> name="filter.dateTimeStart">
> <s:param name="value">
> <s:date name="filter.dateTimeStart" format="dd/MM/yyyy HH:mm:ss" />
> </s:param>
> </s:textfield>
>
> In the S2 guide for Type Conversion (
> http://struts.apache.org/2.x/docs/type-conversion.html) it has a note
> saying
> not to use Type Conversion for dates.
>
> Does anyone know of a way to do this?
>
>
> Thanks in advance.
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_185282.ezm (zipped)I am having difficulty with authentication of user levels.
I have to kinds of users "user" and "administrators".
What we did in mySQL db is make a user table and in it, a "level" column is
placed containing whether a user is "administrator" or not.
there's no problem with this actually (I just wrote the situation and
setup).
*Now, I want the server to send a 403 response to non-administrative
personnel accessing some secured places in our site.*
How can I do this?(Or is this possible? I have no idea actually..)
I have a userBean.java that contains all user informations from database.
I made this in my execute method in Action class. (Something Like this)
execute(response, request, form....){
UserActionForm uaf = (UserActionForm) form;
UserBean userbean = new UserBean();
* if (userbean.getlevel().equals("user")){
response.sendError(SC_FORBIDDEN);
}
* return mapping.findForward....("Sucess");
}
this code does not compile..sendError() expects int value. I tried
sendError(403) but doesn't work.
Any Help is Gladly Appreciated! =)
God Bless!
Ryan Webb from Philippines

Attachment:
user_185283.ezm (zipped)Hello
I have a reset() that generates a random number. However after the first page view the same number persists. How do I stop this caching by the server? tia.

Attachment:
user_185284.ezm (zipped)I am having difficulty with authentication of user levels.
I have to kinds of users "user" and "administrators".
What we did in mySQL db is make a user table and in it, a "level" column is
placed containing whether a user is "administrator" or not.
there's no problem with this actually (I just wrote the situation and
setup).
*Now, I want the server to send a 403 response to non-administrative
personnel accessing some secured places in our site.*
How can I do this?(Or is this possible? I have no idea actually..)
I have a userBean.java that contains all user informations from database.
I made this in my execute method in Action class. (Something Like this)
execute(response, request, form....){
UserActionForm uaf = (UserActionForm) form;
UserBean userbean = new UserBean();
* if (userbean.getlevel().equals("user")){
response.sendError(SC_FORBIDDEN);
}
* return mapping.findForward....("Sucess");
}
this code does not compile..sendError() expects int value. I tried
sendError(403) but doesn't work.
Any Help is Gladly Appreciated! =)
God Bless!

Attachment:
user_185285.ezm (zipped)
Hi guys,
I'm using Struts 2.0.11 for a standard web application and using annotations
all the way. I have the following action, with some fields and getters /
setters omitted for brevity:
@ParentPackage("default")
@Results( {
@Result(name = "input", type = ServletDispatcherResult.class, value =
"/views/users/changePassword.jsp"),
@Result(type = ServletActionRedirectResult.class, value = "workbench",
params = {
"namespace", "/workbench", "parse", "true", "actionMessageKey",
"${actionMessageKey}" }) })
@Validation
public class ChangePasswordAction extends ActionSupport {
@Override
@Validations(requiredStrings = {
@RequiredStringValidator(fieldName = "currentPassword", message = "", key
= "users.changePassword.currentPassword.invalid"),
@RequiredStringValidator(fieldName = "newPassword1", message = "", key =
"users.changePassword.newPassword.invalid"),
@RequiredStringValidator(fieldName = "newPassword2", message = "", key =
"users.changePassword.newPassword.invalid") }, expressions = {
@ExpressionValidator(expression = "newPassword1.equals(newPassword2)",
message = "", key = "users.changePassword.mismatch") })
public String execute() {
String result = Action.INPUT;
try {
userService.changeUserPassword(getUser().getId(), currentPassword,
newPassword1);
result = Action.SUCCESS;
}
catch (InvalidPasswordException e) {
addActionError(getText("users.changePassword.currentPassword.invalid"));
}
return result;
}
}
The accompanying JSP, changePassword.jsp, contains a simple form with 3
fields (current, new, confirm new password) and a submit button.
When leaving all form fields and submitting the form, the validation
interceptor correctly executes, correctly identifies all validation errors
and correctly executes the input result. The rendered page correctly shows
the correct form with all expected error messages next to the corresponding
fields. Basically, the whole request handling works as expected. However,
the browser's address bar now shows the following:
http://localhost:8080/healthcheck/users/changePassword.go?currentPassword=&newPassword1=&newPassword2=&general.submit=Submit
The URL contains all failed parameters with their values in clear text,
which is something I don't want. The behavior is the same when using an
empty result type for the input result.
1. Is there a way not to see these parameters in the final URL?
2. I don't see why these parameters need to be added to the URL when they
are clearly accessible to the JSP using the value stack. Surely there must
be a good reason to this?
Thanks all,
GB
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_185293.ezm (zipped)Guillaume Bilodeau wrote:
> Hi guys,
>
> I'm using Struts 2.0.11 for a standard web application and using annotations
> all the way. I have the following action, with some fields and getters /
> setters omitted for brevity:
>
> @ParentPackage("default")
> @Results( {
> @Result(name = "input", type = ServletDispatcherResult.class, value =
> "/views/users/changePassword.jsp"),
> @Result(type = ServletActionRedirectResult.class, value = "workbench",
> params = {
> "namespace", "/workbench", "parse", "true", "actionMessageKey",
> "${actionMessageKey}" }) })
> @Validation
> public class ChangePasswordAction extends ActionSupport {
> @Override
> @Validations(requiredStrings = {
> @RequiredStringValidator(fieldName = "currentPassword", message = "", key
> = "users.changePassword.currentPassword.invalid"),
> @RequiredStringValidator(fieldName = "newPassword1", message = "", key =
> "users.changePassword.newPassword.invalid"),
> @RequiredStringValidator(fieldName = "newPassword2", message = "", key =
> "users.changePassword.newPassword.invalid") }, expressions = {
> @ExpressionValidator(expression = "newPassword1.equals(newPassword2)",
> message = "", key = "users.changePassword.mismatch") })
> public String execute() {
> String result = Action.INPUT;
>
> try {
> userService.changeUserPassword(getUser().getId(), currentPassword,
> newPassword1);
> result = Action.SUCCESS;
> }
> catch (InvalidPasswordException e) {
> addActionError(getText("users.changePassword.currentPassword.invalid"));
> }
>
> return result;
> }
> }
>
> The accompanying JSP, changePassword.jsp, contains a simple form with 3
> fields (current, new, confirm new password) and a submit button.
>
> When leaving all form fields and submitting the form, the validation
> interceptor correctly executes, correctly identifies all validation errors
> and correctly executes the input result. The rendered page correctly shows
> the correct form with all expected error messages next to the corresponding
> fields. Basically, the whole request handling works as expected. However,
> the browser's address bar now shows the following:
>
> http://localhost:8080/healthcheck/users/changePassword.go?currentPassword=&newPassword1=&newPassword2=&general.submit=Submit
>
> The URL contains all failed parameters with their values in clear text,
> which is something I don't want. The behavior is the same when using an
> empty result type for the input result.
>
> 1. Is there a way not to see these parameters in the final URL?
> 2. I don't see why these parameters need to be added to the URL when they
> are clearly accessible to the JSP using the value stack. Surely there must
> be a good reason to this?
That's basic HTML/HTTP. You need to change your form to submit using the
POST method instead of GET. See the 'method' attribute of s:form.
L.

Attachment:
user_185286.ezm (zipped)mraible wrote:
> I tried [@(protected)
> either. I don't have a struts.xml or struts.properties in my project. I
> tried putting the i18n bundle in all packages using it at the Action level
> (ActionName.properties), but that didn't work either. Creating a
> src/main/resources/struts.properties with the following in it is the only
> thing that seems to work.
>
> struts.custom.i18n.resources=messages
>
> And then putting my keys in src/main/resources/messages.properties.
>
> AFAICT, i18n bundles at the action/package level seems to be completely
> broken in 2.1.1.
>
> Matt
>
>
Sorry Matt, I can't replicate this issue.
I created a freemarker decorator that uses @s.text and it was able to find:
- resources in the global resource bundle (specified via
struts.custom.i18n.resources)
- resources in the named resource bundle when contained within an
@s.i18n tag
- resources in the actionName.properties resource bundle
- resources in the package.properties resource bundle
I used each technique one at at a time, inside and outside a decorator
and in both FTL and JSP. My test action extended ActionSupport for the
TextProvider.
However, I'm am still convinced there's a problem. A possible scenario:
- getText matches the first TextProvider found in the value stack.
Not the first TextProvider providing the requested key.
- some operations can push another TextProvider onto the stack (in
front of the action). The i18n tag does this.
- there are cases where the alternate TextProvider is not popped off
the stack (see https://issues.apache.org/struts/browse/WW-2539)
I've started cleaning up the implementation to isolate it. See my post
in struts-dev.
regards,
Jeromy Evans

Attachment:
user_185289.ezm (zipped)
Attachment:
user_185291.ezm (zipped)
I have my struts application devleoped in websphere stdio where it run
properly
but when i run it on tomcat5.0 i show problem "CAN'T FIND MESSAGE RESOURCE
KEY UNDER MESSAGE RESOURCE"
BUT when i run it on tomcat4.0 it run properly but that time shows database
error class not found
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_185292.ezm (zipped)Hi
Is there any decent Open Source tool out there which can be used to do
reverse engineering of Java code,
If not open source then some thing which really works,
Any input would be really appreciated
Ashish

Attachment:
user_185295.ezm (zipped)Ashish Kulkarni wrote:
> Hi
> Is there any decent Open Source tool out there which can be used to do
> reverse engineering of Java code,
> If not open source then some thing which really works,
> Any input would be really appreciated
>
> Ashish
>
>
I'm not sure whether you want bytecode to java or java to uml?
My favourite commercial tool for Java->UML is Enterprise Architect. Code
engineering is included in the Professional Edition or higher.
http://www.sparxsystems.com/
A good opensource option is Poseidon for UML
(http://www.gentleware.com/). The community edition is free but that
edition doesn't include Java->UML.
Other vendors provide plugins for at least Eclipse and IntelliJ IDEA.
Check your IDE's plugin library to see what's available.

Attachment:
user_185296.ezm (zipped)it won't go from bytecode to UML but I've used JAD (and JadClipse) to go
from bytecode to Java:
http://www.kpdus.com/jad.html
http://jadclipse.sourceforge.net/
As far as UML is concerned, I saw this non-free tool yesterday, which
looked pretty interesting (especially the roundtrip feature):
http://www.gentleware.com/apollo.html
I'm not familiar with any of the open source UML tools.
Brad Cupit
Louisiana State University - UIS
-----Original Message-----
From: Ashish Kulkarni [mailto:ashish.kulkarni13@(protected)]
Sent: Friday, April 11, 2008 7:01 AM
To: Struts Users Mailing List
Subject: [OT] UML and Reverse Engineering
Hi
Is there any decent Open Source tool out there which can be used to do
reverse engineering of Java code,
If not open source then some thing which really works,
Any input would be really appreciated
Ashish

Attachment:
user_185297.ezm (zipped)2008/4/11, Jeromy Evans <jeromy.evans@(protected)>:
> A good opensource option is Poseidon for UML (http://www.gentleware.com/).
> The community edition is free but that edition doesn't include Java->UML.
Err... Poseidon is not open source.
Anyway, I think that NetBeans is pretty nice:
http://www.netbeans.org/kb/60/uml/re.html
Antonio
P.S.: A previous e-mail, in which I tried to say that Poseidon is not
open source, was marked as spam....
Antonio

Attachment:
user_185294.ezm (zipped)Hello,
I now searched a while to get an idea how to implement
a DB clean up service with Struts2. The best link I found
was the following one:
following
http://www.javabeat.net/javabeat/ejb3/articles/timer_services_api_in_ejb_3_0_2.php
What I dont understand is how to get the session context.
As described in the link Im using dependency injection:
>>>
@Resource
Private SessionContext s;
<<<
but unfortunately that doesnt work. Eclipse says that it
doesnt know the @Resource annotation.
However, the ejb3-persistence.jar is integrated in the
libs. Therefore, the annotation should be well known
to Eclipse?
What I also dont understand that - even when I got that
stuff with that timer working - "who" starts the bean the
first time? Do I have to reconfigure something?
What happens if I restart the server?
Another more general question is:
is that the most suitable way to implement the
DB clean up service, assuing that further services
wont be added in the future (otherwise: scheduler as
far from what I've read)?
Thanks and best regards
Peter

Attachment:
user_185298.ezm (zipped)
I would have thought of implementing the clean up service as servlet filter
outside struts. Or doing the same within an interceptor.
Are there any dependencies that would need the clean up service to be bound
to a session context?
- Frank
> -----Original Message-----
> From: peter.theissen@(protected)]
> Sent: Friday, April 11, 2008 2:25 PM
> To: Struts Users Mailing List
> Subject: Scheduled DB clean up service with Struts2
>
> Hello,
>
> I now searched a while to get an idea how to implement
> a DB clean up service with Struts2. The best link I found
> was the following one:
> following
> http://www.javabeat.net/javabeat/ejb3/articles/timer_services_
> api_in_ejb_3_0_2.php
>
> What I dont understand is how to get the session context.
> As described in the link Im using dependency injection:
> >>>
> @Resource
> Private SessionContext s;
> <<<
> but unfortunately that doesnt work. Eclipse says that it
> doesnt know the @Resource annotation.
> However, the ejb3-persistence.jar is integrated in the
> libs. Therefore, the annotation should be well known
> to Eclipse?
>
> What I also dont understand that - even when I got that
> stuff with that timer working - "who" starts the bean the
> first time? Do I have to reconfigure something?
> What happens if I restart the server?
>
> Another more general question is:
> is that the most suitable way to implement the
> DB clean up service, assuing that further services
> wont be added in the future (otherwise: scheduler as
> far from what I've read)?
>
> Thanks and best regards
> Peter
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185299.ezm (zipped)the @Resource annotation is included in Java SE 6. If you can't move to
Java 6 and have to use Java 5, the annotation can be found in
common-annotations.jar
(note that a Java EE 5 app can still run in the Java SE 6 JRE)
as per the DB clean up service, if you're using Spring for DI you could
probably set up a quartz timer that Spring would manage for you. If
you're not using Spring you could probably implement a
ServletContextListener (configured in web.xml) to startup on application
startup and then use some type of timer in that class. None of it would
be specific to struts 2.
Brad Cupit
Louisiana State University - UIS
-----Original Message-----
From: peter.theissen@(protected)]
Sent: Friday, April 11, 2008 7:25 AM
To: Struts Users Mailing List
Subject: Scheduled DB clean up service with Struts2
Hello,
I now searched a while to get an idea how to implement
a DB clean up service with Struts2. The best link I found
was the following one:
following
http://www.javabeat.net/javabeat/ejb3/articles/timer_services_api_in_ejb
_3_0_2.php
What I dont understand is how to get the session context.
As described in the link Im using dependency injection:
>>>
@Resource
Private SessionContext s;
<<<
but unfortunately that doesnt work. Eclipse says that it
doesnt know the @Resource annotation.
However, the ejb3-persistence.jar is integrated in the
libs. Therefore, the annotation should be well known
to Eclipse?
What I also dont understand that - even when I got that
stuff with that timer working - "who" starts the bean the
first time? Do I have to reconfigure something?
What happens if I restart the server?
Another more general question is:
is that the most suitable way to implement the
DB clean up service, assuing that further services
wont be added in the future (otherwise: scheduler as
far from what I've read)?
Thanks and best regards
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_185300.ezm (zipped)I've been doing periodic tasks in my web app: I'm using Spring and
setting a periodic task to execute is kind of straightforward, but has
nothing to do with Struts 2.
2008/4/11, Peter Theissen <peter.theissen@(protected)>:
> Hello,
>
> I now searched a while to get an idea how to implement
> a DB clean up service with Struts2. The best link I found
> was the following one:
> following
> http://www.javabeat.net/javabeat/ejb3/articles/timer_services_api_in_ejb_3_0_2.php
>
> What I dont understand is how to get the session context.
> As described in the link Im using dependency injection:
> >>>
> @Resource
> Private SessionContext s;
> <<<
> but unfortunately that doesnt work. Eclipse says that it
> doesnt know the @Resource annotation.
> However, the ejb3-persistence.jar is integrated in the
> libs. Therefore, the annotation should be well known
> to Eclipse?
>
> What I also dont understand that - even when I got that
> stuff with that timer working - "who" starts the bean the
> first time? Do I have to reconfigure something?
> What happens if I restart the server?
>
> Another more general question is:
> is that the most suitable way to implement the
> DB clean up service, assuing that further services
> wont be added in the future (otherwise: scheduler as
> far from what I've read)?
>
> Thanks and best regards
> Peter
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185301.ezm (zipped)I doubt that this filter/interceptor approach to executing a task
periodically would be a good idea:
What if it is take too long? What happens to the current user request?
What if it just time out?
Typical periodic clean up tasks are better performed when nobody is
using the system (or at least when the quantity of concurrent users in
the system be at the absolute minimum), but since this is executed
when somebody makes a request to the web app, there is no warranty
that this task be executed at all.
2008/4/11, Frank Fischer <frank.fischer@(protected)>:
>
> I would have thought of implementing the clean up service as servlet filter
> outside struts. Or doing the same within an interceptor.
>
> Are there any dependencies that would need the clean up service to be bound
> to a session context?
>
> - Frank
>
>
> > -----Original Message-----
> > From: peter.theissen@(protected)]
> > Sent: Friday, April 11, 2008 2:25 PM
> > To: Struts Users Mailing List
> > Subject: Scheduled DB clean up service with Struts2
> >
> > Hello,
> >
> > I now searched a while to get an idea how to implement
> > a DB clean up service with Struts2. The best link I found
> > was the following one:
> > following
> > http://www.javabeat.net/javabeat/ejb3/articles/timer_services_
> > api_in_ejb_3_0_2.php
> >
> > What I dont understand is how to get the session context.
> > As described in the link Im using dependency injection:
> > >>>
> > @Resource
> > Private SessionContext s;
> > <<<
> > but unfortunately that doesnt work. Eclipse says that it
> > doesnt know the @Resource annotation.
> > However, the ejb3-persistence.jar is integrated in the
> > libs. Therefore, the annotation should be well known
> > to Eclipse?
> >
> > What I also dont understand that - even when I got that
> > stuff with that timer working - "who" starts the bean the
> > first time? Do I have to reconfigure something?
> > What happens if I restart the server?
> >
> > Another more general question is:
> > is that the most suitable way to implement the
> > DB clean up service, assuing that further services
> > wont be added in the future (otherwise: scheduler as
> > far from what I've read)?
> >
> > Thanks and best regards
> > Peter
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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_185302.ezm (zipped)No, no dependencies at all. It should just do
the cleanup every day.
However, I would like to use my certain action
methods, since they already contain all the
funtionalities for DB acces.
Thanks
Peter
> I would have thought of implementing the clean up service as servlet filter
> outside struts. Or doing the same within an interceptor.
>
> Are there any dependencies that would need the clean up service to be bound
> to a session context?
>
> - Frank
>
>
>
>> -----Original Message-----
>> From: peter.theissen@(protected)]
>> Sent: Friday, April 11, 2008 2:25 PM
>> To: Struts Users Mailing List
>> Subject: Scheduled DB clean up service with Struts2
>>
>> Hello,
>>
>> I now searched a while to get an idea how to implement
>> a DB clean up service with Struts2. The best link I found
>> was the following one:
>> following
>> http://www.javabeat.net/javabeat/ejb3/articles/timer_services_
>> api_in_ejb_3_0_2.php
>>
>> What I dont understand is how to get the session context.
>> As described in the link Im using dependency injection:
>> >>>
>> @Resource
>> Private SessionContext s;
>> <<<
>> but unfortunately that doesnt work. Eclipse says that it
>> doesnt know the @Resource annotation.
>> However, the ejb3-persistence.jar is integrated in the
>> libs. Therefore, the annotation should be well known
>> to Eclipse?
>>
>> What I also dont understand that - even when I got that
>> stuff with that timer working - "who" starts the bean the
>> first time? Do I have to reconfigure something?
>> What happens if I restart the server?
>>
>> Another more general question is:
>> is that the most suitable way to implement the
>> DB clean up service, assuing that further services
>> wont be added in the future (otherwise: scheduler as
>> far from what I've read)?
>>
>> Thanks and best regards
>> Peter
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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)
>
>
>