Author Login
Post Reply
user Digest 1 Feb 2010 16:09:34 -0000 Issue 8998
Topics (messages 204905 through 204927):
Re: interceptor is not being called for all action
204905 by: Jake Vang
204910 by: Leah OConnor
204924 by: Jake Vang
Re: redirectAction not working
204906 by: Robby Atchison
204913 by: Pawe³ Wielgus
gwt and struts 2
204907 by: Michael Finney
Two error messages for validation on same attribute
204908 by: Mittal, Nitin (US - Mumbai)
204912 by: Mittal, Nitin (US - Mumbai)
struts 2 and servlets, how to exclude servlet url patterns from struts filter
204909 by: Jake Vang
204911 by: Greg Lindholm
204916 by: Jake Vang
Property Tag and Parameters
204914 by: RogerV
Transform values - Type conversion
204915 by: Diego Manilla Suárez
Re: internationalize displaytag into struts2
204917 by: Nicola Bortolotti
204918 by: Lukasz Lenart
204919 by: Nicola Bortolotti
204920 by: Lukasz Lenart
internationalize displaytag into struts2 [RESOLVED]
204921 by: Nicola Bortolotti
Iterator help needed
204922 by: RogerV
struts 2, writing a custom tag that is able to access objects in ActionContext using OGNL
204923 by: Jake Vang
204925 by: Jake Vang
204927 by: Bill Bohnenberger
How to handle input from iterated output
204926 by: Craig Ricciuto
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_204905.ezm (zipped)okay, to answer my own question, yes, if you configure everything correctly,
then you can get a customized stack to work for all Actions. the only thing
you really need to do is add this line to struts.xml
<constant name="struts.convention.default.parent.package" value="default"/>
with this defined, you can remove the @ParentPackage and @InterceptorRef
from the classes and methods.
wow, it was that easy.
On Sat, Jan 30, 2010 at 6:14 PM, Jake Vang <vangjake@(protected):
> okay, after fiddling around for 2 hours, with the weak documentation out
> there, i think i have it figured out. at least empirically, it works now.
> just in case there are other users out there who are running into this
> problem, let me explain what in the world i did. i know A LOT of other
> people have run into this problem on how to get interceptors to work with
> the convention plugin (googling). the shame is that although i saw a lot of
> "thanks, i got it working", no one ever bothered to show how they got it to
> work.
>
> at any rate, if you read the original post by me, you will see how my
> interceptor stack was defined in struts.xml. you will also see how i
> implemented a dummy interceptor. i had to do two things to get my
> interceptor working (called on my action).
> 1. add @ParentPackage("default") to my Action class
> 2. add @interceptorRefs={@(protected)
> (in my Action class).
>
> after i did this, my interceptor's intercept(ActionInvocation) method is
> called when my Action is called.
>
> here's how my dummy Action class looks like.
>
> @ParentPackage("default")
> public class DummyAction extends ActionSupport {
> @Action(value="/dummy",
> results={@(protected)")},
> interceptorRefs={@(protected)")}
> )
> public String execute() {
> return SUCCESS;
> }
> }
>
> alright, so, now i'd like to know how to get this interceptor stack
> (dummyStack) to work on all actions? in the link i posted, you can do so
> using one single line in struts.xml (i.e. <default-interceptor-ref
> name="dummyStack"/>). with the convention plugin + annotations, is such a
> simple approach possible? or do i have to continuously add @ParentPackage
> and @InterceptorRef annotations to the classes and methods i want to use the
> stack?
>
> i don't know why this is such a pain (but then again, i'm not a developer
> on the struts2 project, so there may be a lot of complexities to get this
> working elegantly that i'm unaware of).
>
> On Sat, Jan 30, 2010 at 4:10 PM, Jake Vang <vangjake@(protected):
>
>> i have written an interceptor implementation, however, it seems i cannot
>> get it to work. i have followed the instructions at
>> http://struts.apache.org/2.x/docs/interceptors.html. i have also followed
>> the instructions at
>> http://struts.apache.org/2.x/docs/how-do-we-configure-an-interceptor-to-be-used-with-every-action.htmlto use the interceptor with every action.
>>
>> however, when any of my actions run, i never see the pre and post
>> processing logging messages (logging messages inside the intercept method).
>> i do see the logging messages from the init and destroy methods. this is not
>> a problem with logging (as for sanity checking, i also use
>> System.out.println, and have Tomcat running in console mode). i also have
>> placed some break points in the intercept(ActionInvocation) method, but
>> these break points are never reached.
>>
>> this is my struts.xml.
>>
>> <struts>
>> <package name="default" extends="struts-default">
>> <interceptors>
>> <interceptor name="dummyInterceptor"
>> class="mypackage.DummyInterceptor"/>
>> <interceptor-stack name="dummyStack">
>> <interceptor-ref name="dummyInterceptor"/>
>> <interceptor-ref name="defaultStack"/>
>> </interceptor-stack>
>> </interceptors>
>> <default-interceptor-ref name="dummyStack"/>
>> </package>
>> </struts>
>>
>> this is my DummyInterceptor class.
>>
>> public class DummyInterceptor implements Interceptor {
>> private static final Log _log =
>> LogFactory.getLog(DummyInterceptor.class);
>> public void destroy() {
>> _log.debug("dummy interceptor destroyed called");
>> System.out.println("dummy interceptor destroyed
>> called".toUpperCase());
>> }
>> public void init() {
>> _log.debug("dummy interceptor init called");
>> System.out.println("dummy interceptor init called".toUpperCase());
>> }
>> public String intercept(ActionInvocation actionInvocation) throws
>> Exception {
>> _log.debug("dummy interceptor intercept pre processing");
>> System.out.println("dummy interceptor intercept pre
>> processing".toUpperCase());
>>
>> String result = actionInvocation.invoke();
>>
>> _log.debug("dummy interceptor intercept post processing");
>> System.out.println("dummy interceptor intercept post
>> processing".toUpperCase());
>> return result;
>> }
>> }
>>
>> i am using annotations for my Action classes, so i do not define any
>> <action> elements in struts.xml (using the Struts2 Convention jar).
>>
>> one very interesting thing i did was to get struts-default.xml out of the
>> struts2-core-2.1.8.1.jar. i then modified struts-default.xml by adding: 1) a
>> definition of my interceptor and 2) my interceptor onto the defaultStack.
>> when i did this, my interceptor does work as expected (i see logging output
>> from the intercept method, i can hit break points set inside this method)
>> for all my actions.
>>
>> i wonder if there is some gotcha that i am missing here. is there
>> something extra that i have to do when mixing annotations with interceptors?
>>
>> thanks.
>>
>
>

Attachment:
user_204910.ezm (zipped)Thank you for posting your solution. I aso read
> http://struts.apache.org/2.x/docs/convention-plugin.html#ConventionPlugin-XWorkpackages
>
several times and do not see the connection. I'm not sure I understand exactly what you
did solved the problem, but it is clerarer than the documention
--- On Sat, 1/30/10, Jake Vang <vangjake@(protected):
From: Jake Vang <vangjake@(protected)>
Subject: Re: interceptor is not being called for all action
To: user@(protected)
Date: Saturday, January 30, 2010, 5:38 PM
okay, to answer my own question, yes, if you configure everything correctly,
then you can get a customized stack to work for all Actions. the only thing
you really need to do is add this line to struts.xml
<constant name="struts.convention.default.parent.package" value="default"/>
with this defined, you can remove the @ParentPackage and @InterceptorRef
from the classes and methods.
wow, it was that easy.
On Sat, Jan 30, 2010 at 6:14 PM, Jake Vang <vangjake@(protected):
> okay, after fiddling around for 2 hours, with the weak documentation out
> there, i think i have it figured out. at least empirically, it works now.
> just in case there are other users out there who are running into this
> problem, let me explain what in the world i did. i know A LOT of other
> people have run into this problem on how to get interceptors to work with
> the convention plugin (googling). the shame is that although i saw a lot of
> "thanks, i got it working", no one ever bothered to show how they got it to
> work.
>
> at any rate, if you read the original post by me, you will see how my
> interceptor stack was defined in struts.xml. you will also see how i
> implemented a dummy interceptor. i had to do two things to get my
> interceptor working (called on my action).
> 1. add @ParentPackage("default") to my Action class
> 2. add @interceptorRefs={@(protected)
> (in my Action class).
>
> after i did this, my interceptor's intercept(ActionInvocation) method is
> called when my Action is called.
>
> here's how my dummy Action class looks like.
>
> @ParentPackage("default")
> public class DummyAction extends ActionSupport {
> @Action(value="/dummy",
> results={@(protected)")},
> interceptorRefs={@(protected)")}
> )
> public String execute() {
> return SUCCESS;
> }
> }
>
> alright, so, now i'd like to know how to get this interceptor stack
> (dummyStack) to work on all actions? in the link i posted, you can do so
> using one single line in struts.xml (i.e. <default-interceptor-ref
> name="dummyStack"/>). with the convention plugin + annotations, is such a
> simple approach possible? or do i have to continuously add @ParentPackage
> and @InterceptorRef annotations to the classes and methods i want to use the
> stack?
>
> i don't know why this is such a pain (but then again, i'm not a developer
> on the struts2 project, so there may be a lot of complexities to get this
> working elegantly that i'm unaware of).
>
> On Sat, Jan 30, 2010 at 4:10 PM, Jake Vang <vangjake@(protected):
>
>> i have written an interceptor implementation, however, it seems i cannot
>> get it to work. i have followed the instructions at
>> http://struts.apache.org/2.x/docs/interceptors.html. i have also followed
>> the instructions at
>> http://struts.apache.org/2.x/docs/how-do-we-configure-an-interceptor-to-be-used-with-every-action.htmlto use the interceptor with every action.
>>
>> however, when any of my actions run, i never see the pre and post
>> processing logging messages (logging messages inside the intercept method).
>> i do see the logging messages from the init and destroy methods. this is not
>> a problem with logging (as for sanity checking, i also use
>> System.out.println, and have Tomcat running in console mode). i also have
>> placed some break points in the intercept(ActionInvocation) method, but
>> these break points are never reached.
>>
>> this is my struts.xml.
>>
>> <struts>
>> <package name="default" extends="struts-default">
>> <interceptors>
>> <interceptor name="dummyInterceptor"
>> class="mypackage.DummyInterceptor"/>
>> <interceptor-stack name="dummyStack">
>> <interceptor-ref name="dummyInterceptor"/>
>> <interceptor-ref name="defaultStack"/>
>> </interceptor-stack>
>> </interceptors>
>> <default-interceptor-ref name="dummyStack"/>
>> </package>
>> </struts>
>>
>> this is my DummyInterceptor class.
>>
>> public class DummyInterceptor implements Interceptor {
>> private static final Log _log =
>> LogFactory.getLog(DummyInterceptor.class);
>> public void destroy() {
>> _log.debug("dummy interceptor destroyed called");
>> System.out.println("dummy interceptor destroyed
>> called".toUpperCase());
>> }
>> public void init() {
>> _log.debug("dummy interceptor init called");
>> System.out.println("dummy interceptor init called".toUpperCase());
>> }
>> public String intercept(ActionInvocation actionInvocation) throws
>> Exception {
>> _log.debug("dummy interceptor intercept pre processing");
>> System.out.println("dummy interceptor intercept pre
>> processing".toUpperCase());
>>
>> String result = actionInvocation.invoke();
>>
>> _log.debug("dummy interceptor intercept post processing");
>> System.out.println("dummy interceptor intercept post
>> processing".toUpperCase());
>> return result;
>> }
>> }
>>
>> i am using annotations for my Action classes, so i do not define any
>> <action> elements in struts.xml (using the Struts2 Convention jar).
>>
>> one very interesting thing i did was to get struts-default.xml out of the
>> struts2-core-2.1.8.1.jar. i then modified struts-default.xml by adding: 1) a
>> definition of my interceptor and 2) my interceptor onto the defaultStack.
>> when i did this, my interceptor does work as expected (i see logging output
>> from the intercept method, i can hit break points set inside this method)
>> for all my actions.
>>
>> i wonder if there is some gotcha that i am missing here. is there
>> something extra that i have to do when mixing annotations with interceptors?
>>
>> thanks.
>>
>
>

Attachment:
user_204924.ezm (zipped)there were 2 approaches to getting a custom stack to work (using the
convention plugin).
approach 1: use annotations. for example, use
@ParentPackage("default") for each Action class you want to use your
custom stack. also, use @InterceptorRef for each method that you want
to use your custom stack.
why do you have to use @ParentPackage("default")? here's a non-formal
answer. when you use the convention plugin, the namespace is not
"default" but "convention-default". i "infer" that defining a custom
stack is placed in the "default" namespace, but if you use the
convention plugin, your actions will be passed through the
"convention-default" namespace and associated stacks. since your stack
is in the "default" namespace, the stack won't ever get called (even
if you set it as the default!).
hopefully other struts 2 gurus can give us more formal/precise answers.
why do you have to use @InterceptorRef? tell tell struts which stack
to use for this action (within the namespace defined by
@ParentPackage).
approach 2: simply add 1 line to struts.xml. before the <package ...>
... </package> declarations, add <constant
name="struts.convention.default.parent.package" value="default"/>.
using this approach, you don't need to use annotations at all. also,
with this approach, it's a one-hitter-quitter, because you don't need
to do @ParentPackage and @InterceptorRef for every class/method. the
"default" namespace will be used, and the custom stack will be called
on every request (assuming you use <default-interceptor-ref/> to
select your custom stack as the default stack).
hope that helps.
On Sun, Jan 31, 2010 at 2:24 PM, Leah OConnor <leahoconnor@(protected):
> Thank you for posting your solution. I aso read
>> http://struts.apache.org/2.x/docs/convention-plugin.html#ConventionPlugin-XWorkpackages
>>
> several times and do not see the connection. I'm not sure I understand exactly what you
> did solved the problem, but it is clerarer than the documention
>
>
> --- On Sat, 1/30/10, Jake Vang <vangjake@(protected):
>
>
> From: Jake Vang <vangjake@(protected)>
> Subject: Re: interceptor is not being called for all action
> To: user@(protected)
> Date: Saturday, January 30, 2010, 5:38 PM
>
>
> okay, to answer my own question, yes, if you configure everything correctly,
> then you can get a customized stack to work for all Actions. the only thing
> you really need to do is add this line to struts.xml
>
> <constant name="struts.convention.default.parent.package" value="default"/>
>
> with this defined, you can remove the @ParentPackage and @InterceptorRef
> from the classes and methods.
>
> wow, it was that easy.
>
> On Sat, Jan 30, 2010 at 6:14 PM, Jake Vang <vangjake@(protected):
>
>> okay, after fiddling around for 2 hours, with the weak documentation out
>> there, i think i have it figured out. at least empirically, it works now.
>> just in case there are other users out there who are running into this
>> problem, let me explain what in the world i did. i know A LOT of other
>> people have run into this problem on how to get interceptors to work with
>> the convention plugin (googling). the shame is that although i saw a lot of
>> "thanks, i got it working", no one ever bothered to show how they got it to
>> work.
>>
>> at any rate, if you read the original post by me, you will see how my
>> interceptor stack was defined in struts.xml. you will also see how i
>> implemented a dummy interceptor. i had to do two things to get my
>> interceptor working (called on my action).
>> 1. add @ParentPackage("default") to my Action class
>> 2. add @interceptorRefs={@(protected)
>> (in my Action class).
>>
>> after i did this, my interceptor's intercept(ActionInvocation) method is
>> called when my Action is called.
>>
>> here's how my dummy Action class looks like.
>>
>> @ParentPackage("default")
>> public class DummyAction extends ActionSupport {
>> @Action(value="/dummy",
>> results={@(protected)")},
>> interceptorRefs={@(protected)")}
>> )
>> public String execute() {
>> return SUCCESS;
>> }
>> }
>>
>> alright, so, now i'd like to know how to get this interceptor stack
>> (dummyStack) to work on all actions? in the link i posted, you can do so
>> using one single line in struts.xml (i.e. <default-interceptor-ref
>> name="dummyStack"/>). with the convention plugin + annotations, is such a
>> simple approach possible? or do i have to continuously add @ParentPackage
>> and @InterceptorRef annotations to the classes and methods i want to use the
>> stack?
>>
>> i don't know why this is such a pain (but then again, i'm not a developer
>> on the struts2 project, so there may be a lot of complexities to get this
>> working elegantly that i'm unaware of).
>>
>> On Sat, Jan 30, 2010 at 4:10 PM, Jake Vang <vangjake@(protected):
>>
>>> i have written an interceptor implementation, however, it seems i cannot
>>> get it to work. i have followed the instructions at
>>> http://struts.apache.org/2.x/docs/interceptors.html. i have also followed
>>> the instructions at
>>> http://struts.apache.org/2.x/docs/how-do-we-configure-an-interceptor-to-be-used-with-every-action.htmlto use the interceptor with every action.
>>>
>>> however, when any of my actions run, i never see the pre and post
>>> processing logging messages (logging messages inside the intercept method).
>>> i do see the logging messages from the init and destroy methods. this is not
>>> a problem with logging (as for sanity checking, i also use
>>> System.out.println, and have Tomcat running in console mode). i also have
>>> placed some break points in the intercept(ActionInvocation) method, but
>>> these break points are never reached.
>>>
>>> this is my struts.xml.
>>>
>>> <struts>
>>> <package name="default" extends="struts-default">
>>> <interceptors>
>>> <interceptor name="dummyInterceptor"
>>> class="mypackage.DummyInterceptor"/>
>>> <interceptor-stack name="dummyStack">
>>> <interceptor-ref name="dummyInterceptor"/>
>>> <interceptor-ref name="defaultStack"/>
>>> </interceptor-stack>
>>> </interceptors>
>>> <default-interceptor-ref name="dummyStack"/>
>>> </package>
>>> </struts>
>>>
>>> this is my DummyInterceptor class.
>>>
>>> public class DummyInterceptor implements Interceptor {
>>> private static final Log _log =
>>> LogFactory.getLog(DummyInterceptor.class);
>>> public void destroy() {
>>> _log.debug("dummy interceptor destroyed called");
>>> System.out.println("dummy interceptor destroyed
>>> called".toUpperCase());
>>> }
>>> public void init() {
>>> _log.debug("dummy interceptor init called");
>>> System.out.println("dummy interceptor init called".toUpperCase());
>>> }
>>> public String intercept(ActionInvocation actionInvocation) throws
>>> Exception {
>>> _log.debug("dummy interceptor intercept pre processing");
>>> System.out.println("dummy interceptor intercept pre
>>> processing".toUpperCase());
>>>
>>> String result = actionInvocation.invoke();
>>>
>>> _log.debug("dummy interceptor intercept post processing");
>>> System.out.println("dummy interceptor intercept post
>>> processing".toUpperCase());
>>> return result;
>>> }
>>> }
>>>
>>> i am using annotations for my Action classes, so i do not define any
>>> <action> elements in struts.xml (using the Struts2 Convention jar).
>>>
>>> one very interesting thing i did was to get struts-default.xml out of the
>>> struts2-core-2.1.8.1.jar. i then modified struts-default.xml by adding: 1) a
>>> definition of my interceptor and 2) my interceptor onto the defaultStack.
>>> when i did this, my interceptor does work as expected (i see logging output
>>> from the intercept method, i can hit break points set inside this method)
>>> for all my actions.
>>>
>>> i wonder if there is some gotcha that i am missing here. is there
>>> something extra that i have to do when mixing annotations with interceptors?
>>>
>>> thanks.
>>>
>>
>>
>

Attachment:
user_204906.ezm (zipped)Thanks for the suggestion. The configbrowser plugin indicates there are no results for the action in question. The question is why.
Thanks,
Rob
-----Original Message-----
From: Paweł Wielgus [mailto:poulwiel@(protected)]
Sent: Saturday, January 30, 2010 6:03 AM
To: Struts Users Mailing List
Subject: Re: redirectAction not working
Hi Rob,
you might try ConfigBrowserPlugin,
see why here:
http://poulwiel.blogspot.com/2009/09/config-browser-plugin-in-struts2.html
Best greetings,
Paweł Wielgus.
2010/1/30 Robby Atchison <rob_26@(protected)>:
> Hello,
>
>
>
> I have the following configuration in a Struts.xml file. The
> paramsPrepareParamsStack is the default interceptor stack. AccountAction
> does not implement any interfaces. Both BankcardAction and ECheckAction
> implement Preparable and ModelDriven.
>
>
>
> <action name="account"
> class="com.epa.actions.AccountAction">
>
> <result name="bankcard_browse" type="redirectAction">
>
> <param name="action">bankcard_browse</param>
>
> </result>
>
> <result name="echeck_browse" type="redirectAction">
>
> <param name="action">echeck_browse</param>
>
> </result>
>
> </action>
>
>
>
> <action name="bankcard_*" method="{1}"
> class="com.epa.actions.BankcardAction" >
>
> <result name="success">bankcarddetail.tile</result>
>
> <result name="input">bankcarddetail.tile</result>
>
> </action>
>
>
>
> <action name="echeck_*" method="{1}"
> class="com.epa.actions.ECheckAction" >
>
> <result name="success">echeckdetail.tile</result>
>
> <result name="input">echeckdetail.tile</result>
>
> </action>
>
>
>
> Below is the execute method from AccountAction class..
>
>
>
> public String execute() {
>
> String actionName = "bankcard_browse";
>
> if (StringUtils.equalsIgnoreCase(recordType, "EC")) {
>
> actionName = "echeck_browse";
>
> }
>
> return actionName;
>
> }
>
>
>
> In my testing I get the error - No result defined for action
> com.epa.actions.AccountAction and result bankcard_browse. I can navigate
> straight to bankcard_browse (not going through AccountAction) without
> incident. If I try to go to AccountAction first and redirect to
> bankcard_browse or echeck_browse I get the error. What am I doing wrong?
> I'm using Struts 2 version 2.1.8.1., Tiles 2.0.6, OGNL 2.7.3. I hope I've
> included enough information. Any help will be greatly appreciated as I've
> been struggling with this problem for too long.
>
>
>
> Best regards,
>
> Rob
>
> Rob_26@(protected)
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_204913.ezm (zipped)Hi Robby,
some kind of a misspel or wrong case somewhere,
or a situation where You have VerySimpleAction.java and verySimple.jsp
which should be very-simple.jsp (in convention mode). Try to add new
action and a result for it, if it will work, then look for changes
between these two.
Best greetings,
Pawel Wielgus.
2010/1/31, Robby Atchison <rob_26@(protected)>:
> Thanks for the suggestion. The configbrowser plugin indicates there are no
> results for the action in question. The question is why.
>
> Thanks,
> Rob
>
> -----Original Message-----
> From: Paweł Wielgus [mailto:poulwiel@(protected)]
> Sent: Saturday, January 30, 2010 6:03 AM
> To: Struts Users Mailing List
> Subject: Re: redirectAction not working
>
> Hi Rob,
> you might try ConfigBrowserPlugin,
> see why here:
> http://poulwiel.blogspot.com/2009/09/config-browser-plugin-in-struts2.html
>
> Best greetings,
> Paweł Wielgus.
>
>
> 2010/1/30 Robby Atchison <rob_26@(protected)>:
>> Hello,
>>
>>
>>
>> I have the following configuration in a Struts.xml file. The
>> paramsPrepareParamsStack is the default interceptor stack. AccountAction
>> does not implement any interfaces. Both BankcardAction and ECheckAction
>> implement Preparable and ModelDriven.
>>
>>
>>
>> <action name="account"
>> class="com.epa.actions.AccountAction">
>>
>> <result name="bankcard_browse" type="redirectAction">
>>
>> <param name="action">bankcard_browse</param>
>>
>> </result>
>>
>> <result name="echeck_browse" type="redirectAction">
>>
>> <param name="action">echeck_browse</param>
>>
>> </result>
>>
>> </action>
>>
>>
>>
>> <action name="bankcard_*" method="{1}"
>> class="com.epa.actions.BankcardAction" >
>>
>> <result name="success">bankcarddetail.tile</result>
>>
>> <result name="input">bankcarddetail.tile</result>
>>
>> </action>
>>
>>
>>
>> <action name="echeck_*" method="{1}"
>> class="com.epa.actions.ECheckAction" >
>>
>> <result name="success">echeckdetail.tile</result>
>>
>> <result name="input">echeckdetail.tile</result>
>>
>> </action>
>>
>>
>>
>> Below is the execute method from AccountAction class..
>>
>>
>>
>> public String execute() {
>>
>> String actionName = "bankcard_browse";
>>
>> if (StringUtils.equalsIgnoreCase(recordType, "EC")) {
>>
>> actionName = "echeck_browse";
>>
>> }
>>
>> return actionName;
>>
>> }
>>
>>
>>
>> In my testing I get the error - No result defined for action
>> com.epa.actions.AccountAction and result bankcard_browse. I can navigate
>> straight to bankcard_browse (not going through AccountAction) without
>> incident. If I try to go to AccountAction first and redirect to
>> bankcard_browse or echeck_browse I get the error. What am I doing wrong?
>> I'm using Struts 2 version 2.1.8.1., Tiles 2.0.6, OGNL 2.7.3. I hope
>> I've
>> included enough information. Any help will be greatly appreciated as I've
>> been struggling with this problem for too long.
>>
>>
>>
>> Best regards,
>>
>> Rob
>>
>> Rob_26@(protected)
>>
>>
>
> ---------------------------------------------------------------------
> 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_204907.ezm (zipped)Hi,
I am curious if / how people are getting GWT and Struts2 to work
together in the GWT development environment.
If you did get it to work, did you just copy files from your existing
struts 2 outputs to the war file so GWT can see it? ( war file
mentioned at http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideDirectoriesPackageConventions
)
I use eclipse, the GWT eclipse plugin, and ant. I'm considering just
using an ant script to copy files to where GWT needs it.
Thanks for sharing your insights on how to have struts 2 and GWT work
well together.
--
Michael Finney - "Always Striving To Serve You Better Every Day"
http://www.SmilingSoftwareSolutions.com

Attachment:
user_204908.ezm (zipped)Hello,
Is there a way to disable conversion failure error messages in struts 2 ?
My Problem :-
If the data is entered in the wrong format for a numeric field, the user sees two error messages on the page. For example:-
'7032A' is entered for 'ZIP Code', following error messages will be seen :-
. Invalid field value for field "acquisition.acquisitionArrangementAddress.zipCd".
. Please enter zip code
I think the first one is because of conversion failure and second one is the mandatory validation because the value could not be set in action.
Is there a way to disable conversion failure error messages ?
Thanks,
Nitin Mittal
Deloitte Consulting India Private Limited
cell:+91 9819213942 | office:+91 22 66445762 | VOIP:+1 615-718-8170 | Fax:+91 22 66445999
nimittal@(protected)
P Please consider the environment before printing.
This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message.
Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1]

Attachment:
user_204912.ezm (zipped)Hello,
Is there a way to disable conversion failure error messages in struts 2 ?
My Problem :-
If the data is entered in the wrong format for a numeric field, the user sees two error messages on the page. For example:-
'7032A' is entered for 'ZIP Code', following error messages will be seen :-
. Invalid field value for field "acquisition.acquisitionArrangementAddress.zipCd".
. Please enter zip code
I think the first one is because of conversion failure and second one is the mandatory validation because the value could not be set in action.
Is there a way to disable conversion failure error messages ?
Thanks,
Nitin Mittal
Deloitte Consulting India Private Limited
cell:+91 9819213942 | office:+91 22 66445762 | VOIP:+1 615-718-8170 | Fax:+91 22 66445999
nimittal@(protected)
P Please consider the environment before printing.
This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message.
Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1]

Attachment:
user_204909.ezm (zipped)i am using servlets (HttpServlet) and struts 2. my mapping in web.xml
for the struts filter maps to the url pattern, /*. my servlet maps to
something like this, /test. however, when i try to access my servlet,
http://localhost:8080/myapp/test, i get the following message:
"There is no Action mapped for namespace / and action name test"
can i make exceptions for the servlet mapping so that the struts
filter won't try to map it?
here's a snippet from my web.xml.
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>testServlet</servlet-name>
<servlet-class>mypackage.web.servlets.TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testServlet</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>testServlet</servlet-name>
<url-pattern>/test/*</url-pattern>
</servlet-mapping>

Attachment:
user_204911.ezm (zipped)Check out the "Filter Mapping, default Action extensions, and
Servlets" section on this wiki page:
http://cwiki.apache.org/confluence/display/S2WIKI/Troubleshooting+guide+migrating+from+Struts+2.0.x+to+2.1.x#TroubleshootingguidemigratingfromStruts2.0.xto2.1.x-FilterMapping%2CdefaultActionextensions%2CandServlets
On Sun, Jan 31, 2010 at 9:12 AM, Jake Vang <vangjake@(protected):
> i am using servlets (HttpServlet) and struts 2. my mapping in web.xml
> for the struts filter maps to the url pattern, /*. my servlet maps to
> something like this, /test. however, when i try to access my servlet,
> http://localhost:8080/myapp/test, i get the following message:
>
> "There is no Action mapped for namespace / and action name test"
>
> can i make exceptions for the servlet mapping so that the struts
> filter won't try to map it?
>
> here's a snippet from my web.xml.
>
> <filter>
> <filter-name>struts2</filter-name>
> <filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
> </filter>
> <filter-mapping>
> <filter-name>struts2</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> <servlet>
> <servlet-name>testServlet</servlet-name>
> <servlet-class>mypackage.web.servlets.TestServlet</servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name>testServlet</servlet-name>
> <url-pattern>/test</url-pattern>
> </servlet-mapping>
> <servlet-mapping>
> <servlet-name>testServlet</servlet-name>
> <url-pattern>/test/*</url-pattern>
> </servlet-mapping>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_204916.ezm (zipped)thanks, that addressed my problem directly. although, i liked the no
action extension approach.
is there a feature request to pass in init-params to the struts filter
to exclude certain url patterns?
On Sun, Jan 31, 2010 at 6:56 PM, Greg Lindholm <greg.lindholm@(protected):
> Check out the "Filter Mapping, default Action extensions, and
> Servlets" section on this wiki page:
>
> http://cwiki.apache.org/confluence/display/S2WIKI/Troubleshooting+guide+migrating+from+Struts+2.0.x+to+2.1.x#TroubleshootingguidemigratingfromStruts2.0.xto2.1.x-FilterMapping%2CdefaultActionextensions%2CandServlets
>
>
> On Sun, Jan 31, 2010 at 9:12 AM, Jake Vang <vangjake@(protected):
>> i am using servlets (HttpServlet) and struts 2. my mapping in web.xml
>> for the struts filter maps to the url pattern, /*. my servlet maps to
>> something like this, /test. however, when i try to access my servlet,
>> http://localhost:8080/myapp/test, i get the following message:
>>
>> "There is no Action mapped for namespace / and action name test"
>>
>> can i make exceptions for the servlet mapping so that the struts
>> filter won't try to map it?
>>
>> here's a snippet from my web.xml.
>>
>> <filter>
>> <filter-name>struts2</filter-name>
>> <filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
>> </filter>
>> <filter-mapping>
>> <filter-name>struts2</filter-name>
>> <url-pattern>/*</url-pattern>
>> </filter-mapping>
>> <servlet>
>> <servlet-name>testServlet</servlet-name>
>> <servlet-class>mypackage.web.servlets.TestServlet</servlet-class>
>> </servlet>
>> <servlet-mapping>
>> <servlet-name>testServlet</servlet-name>
>> <url-pattern>/test</url-pattern>
>> </servlet-mapping>
>> <servlet-mapping>
>> <servlet-name>testServlet</servlet-name>
>> <url-pattern>/test/*</url-pattern>
>> </servlet-mapping>
>>
>> ---------------------------------------------------------------------
>> 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_204914.ezm (zipped)
In a jsp page, I can let the action decide the CSS class of any given element
by including class="<s:property value="class"/> which will return the value
of the getClass() method in my action.
I now want to do the same thing while iterating through a list using the
<s:iterator> tag. I need to pass the parameter of the iterator value so I
end up with a call to getClass(index). I know I can get the the value of the
iterator with iterator.status.count, but how do/can I pass this to the
property tag to generate a call to getClass() passing the parameter.
If <s:property> is not the way to do it, which tag should I be using?
Regards
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_204915.ezm (zipped)Hi. I have a simple problem: I need to divide by 100 user's input in
some fields when I'm going to store values in DB and perform the
opposite operation when loading the form again.
I thought Struts 2 type conversion was what I needed, so I created a
simple PercentageConverter, implementing convertFromString and
convertToString to divide by 100 and multiply by 100, respectively. The
first operation is performed fine, the problem is that convertToString
is never being called. I think it has to do with the fact that the
fields are strings themselves, so Struts thinks a conversion is not needed.
What can I do to solve this problem? I'm looking for the simplest
solution possible.
Thanks in advance.****
****

Attachment:
user_204917.ezm (zipped)Sorry for the later, THANK YOU Lukas!!
With your "I18nStruts2Adapter" code I can finally use titleKey to
internationalize column header, but new problem arise.
Reading display tag documentation
(http://displaytag.sourceforge.net/1.2/i18n.html) I see that to modify
some message, e.g. "paging.banner.one_item_found", I've to write imply
property in a file called "displaytag_LANGUAGE.properties".
I do that, I've also try put translated property in "package_it", but
messages doesn't change (I've put ".properties" file in the same
package as the action, where "package_it.properties" works...).
Any suggestion?
Cheers,
Nicola
>The simple solution is to checkout the
>
org.displaytag.localization.I18nWebworkAdapter and adjust it to Struts
>2 (as Struts 2 is formerly WebWork)
>Or evern better, use below code and put in displaytag.properties file
>line like this:
>locale.provider=org.demo.web.displaytag.I18nStruts2Adapter

Attachment:
user_204918.ezm (zipped)2010/2/1 Nicola Bortolotti <bortolotti.nicola@(protected)>:
> Reading display tag documentation
> (http://displaytag.sourceforge.net/1.2/i18n.html) I see that to modify
> some message, e.g. "paging.banner.one_item_found", I've to write imply
> property in a file called "displaytag_LANGUAGE.properties".
> I do that, I've also try put translated property in "package_it", but
> messages doesn't change (I've put ".properties" file in the same
> package as the action, where "package_it.properties" works...).
> Any suggestion?
Do you have displaytag.properties (no LANGUAGE)?
Regards
--
Lukasz
http://www.lenart.org.pl/
Kapituła Javarsovia 2010
http://javarsovia.pl

Attachment:
user_204919.ezm (zipped)No I haven't, but now I create it, the file contains follow row:
paging.banner.one_item_found=blablabla
(in really, I copy and put this property almost everywhere..)
but the message store in the file "displaytag.propertis" into library
"displaytag-1.2.jar" always appear..
Now my file is under the same package as the action, maybe I've to put
it in other place?
Any tips?
Thank you,
Nicola
>Do you have displaytag.properties (no LANGUAGE)?

Attachment:
user_204920.ezm (zipped)2010/2/1 Nicola Bortolotti <bortolotti.nicola@(protected)>:
> but the message store in the file "displaytag.propertis" into library
> "displaytag-1.2.jar" always appear..
> Now my file is under the same package as the action, maybe I've to put
> it in other place?
> Any tips?
WEB-INF/classes
Regards
--
Lukasz
http://www.lenart.org.pl/
Kapituła Javarsovia 2010
http://javarsovia.pl

Attachment:
user_204921.ezm (zipped)It works!!
Summarize, for dummy newbies as me,
- create "I18nStruts2Adapter.java" as posted by Lacasz;
- modify property "locale.provider=..I18nStruts2Adapter" in
org/diplaytag/properties/displaytag.properties;
- internationalize your columns header using titleKey and putting
descriptions in "package_LANGUAGE.properties" under same package as
action;
- internationalize general displaytag messages overriding interesting
properties under a file "displaytag_LANGUAGE.properties" and putting
this file under "WEB-INF/classes" (in my case, using eclipse, under
main src folder..)
Another time, Thanks to Lukasz!!
Hope this help someone,
-Nicola

Attachment:
user_204922.ezm (zipped)
I'm trying to do something similair to the example given in
http://struts.apache.org/2.x/docs/iterator.html where I'm trying to pass
each iterator value to an action. I'm using Struts 2.0.18 and the Convention
plugin.
I know that assigning value="value" is confusing, but this is from the
middle of page where I'm iterating over a set of MapEntry instances! value
is a list of BBParameter instances.
<s:iterator value="value" var="param" status="parameter">
<s:action name="display-template!getDisplayClass">
<s:param name="parameterForClass" value="[0]"/>
</s:action>
but I get an error no such method
DisplayTemplate.setParameterForClass([Ljava.lang.String;) when my method in
DisplayTemplate is expecting an instance of BBParameter
(setParamaterForClass(BBParameter parm).
I've reviewed the example above but I don't really understand it,
particularly the reference to <s:push value="..."> - what on earth is this
doing?
Could someone point me in the right direction so that I get an instance of
the BBParameter class passed into my action please
Regards
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_204923.ezm (zipped)i was wondering if it was possible to write a custom tag that is able
to access objects in the ActionContext using OGNL? i'm not sure if
this is a "correct" question.
my problem is that i have a form. the form is posted to an action. the
action has getters/setters for the form fields. i then forward to
form-success.jsp. on this page, i can use the struts taglibs to access
the information posted. for example, <s:property value="email"/>.
however, if i have a custom tag, how do i access "email" from the
ActionContext? for example, <customTabLib:showEmail value="email"/>,
doesn't work. the tag displays the value, "email". i also tried a
couple of things too that didn't work.
<customTagLib:showEmail value="#email"/>
<customTagLib:showEmail value="%{#email}"/>
is there a class/interface that i can extend/implement in struts 2
that would easily help me get the value of email from the
ActionContext in my custom tag?
thanks.

Attachment:
user_204925.ezm (zipped)i found something helpful here. it works.
http://struts.apache.org/2.1.8.1/docs/access-to-valuestack-from-jsps.html
On Mon, Feb 1, 2010 at 7:34 AM, Jake Vang <vangjake@(protected):
> i was wondering if it was possible to write a custom tag that is able
> to access objects in the ActionContext using OGNL? i'm not sure if
> this is a "correct" question.
>
> my problem is that i have a form. the form is posted to an action. the
> action has getters/setters for the form fields. i then forward to
> form-success.jsp. on this page, i can use the struts taglibs to access
> the information posted. for example, <s:property value="email"/>.
> however, if i have a custom tag, how do i access "email" from the
> ActionContext? for example, <customTabLib:showEmail value="email"/>,
> doesn't work. the tag displays the value, "email". i also tried a
> couple of things too that didn't work.
>
> <customTagLib:showEmail value="#email"/>
> <customTagLib:showEmail value="%{#email}"/>
>
> is there a class/interface that i can extend/implement in struts 2
> that would easily help me get the value of email from the
> ActionContext in my custom tag?
>
> thanks.
>

Attachment:
user_204927.ezm (zipped)Hi Jake,
I have a custom table tag that needs Value Stack access, too.
Here's how I do it:
package...
import
org.apache.struts2.views.jsp.TagUtils;
import
org.apache.struts2.util.MakeIterator;
public class TableTag extends SimpleTagSupport
{
private String list;
public void doTag() throws JspException
{
ValueStack stack = TagUtils.getStack((PageContext)getJspContext());
Iterator iterator = MakeIterator.convert(stack.findValue(list));
while (iterator.hasNext())
{
...
}
}
public void setList(String list)
{
this.list = list;
}
}
Of course "list" is one of my custom tag's attributes and appropriately
defined in my TLD.
Cheers,
Bill
On Mon, Feb 1, 2010 at 5:04 AM, Jake Vang <vangjake@(protected):
> i found something helpful here. it works.
>
> http://struts.apache.org/2.1.8.1/docs/access-to-valuestack-from-jsps.html
>
>
>
> On Mon, Feb 1, 2010 at 7:34 AM, Jake Vang <vangjake@(protected):
> > i was wondering if it was possible to write a custom tag that is able
> > to access objects in the ActionContext using OGNL? i'm not sure if
> > this is a "correct" question.
> >
> > my problem is that i have a form. the form is posted to an action. the
> > action has getters/setters for the form fields. i then forward to
> > form-success.jsp. on this page, i can use the struts taglibs to access
> > the information posted. for example, <s:property value="email"/>.
> > however, if i have a custom tag, how do i access "email" from the
> > ActionContext? for example, <customTabLib:showEmail value="email"/>,
> > doesn't work. the tag displays the value, "email". i also tried a
> > couple of things too that didn't work.
> >
> > <customTagLib:showEmail value="#email"/>
> > <customTagLib:showEmail value="%{#email}"/>
> >
> > is there a class/interface that i can extend/implement in struts 2
> > that would easily help me get the value of email from the
> > ActionContext in my custom tag?
> >
> > thanks.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_204926.ezm (zipped)Hi, just a quick question.
I have a class that has 4 fields. 2 Strings, 1 int, 1 boolean. I shall
refer to this class as MyClass
In my Action class I have a List (call it MyList) that is a list of MyClass.
It can be populated with as little as 1 item or as many as say 256 items
(could be more but I'll keep this limit for simplicity).
Iterating through MyList in a JSP with the struts tag
<s:iterator........</s:iterator> is easy enough. My question is this....
When I iterate through MyList in the JSP I'm setting form fields (of all 4
fields from MyClass). What would be the best way to get all that input back
when I submit the form?
Is there an example of this somewhere I haven't found or just a pretty
straightforward way of doing this I'm not thinking of?
Thanks,
Craig