Multi pages - Wizard with Struts 2 ?
Hi, I have a small workflow where the user needs to register. In the 1st screen the user chooses a login and a password. In the 2nd screen the user enters his first name, last name, age, etc In the 3rd and final screen the user enters her/his address. The submit final in the 3rd screen should be final : the data will be inserted into the database. What are the different ways to implement it with Struts 2 ? I read about the SCOPE interceptor, and also about a Spring Web Flow plugin for Struts 2. Also another scope plugin for Struts 2 etc ... I did not find detailed examples of the Spring Web Flow plugin, I am afraid that I will spend too much time with it. Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts 2.1.6 - custom interceptor
Dear All, i have programmed a simple (custom) interceptor. placed logic in post action invocation. public String doIntercept(ActionInvocation invocation) throws Exception { Object action = invocation.getAction(); String ret = invocation.invoke(); if (action instanceof MyAware) { ((MyAware) action).callme(); } return ret; } in Action's callme() method, I am setting action's var (this var has getter and setter). In my velocity vm file, I am accessing this action's var. $myvar By default, the action's property would be placed in valuestack and, could be accessed from velocity page. Hmmm, this is not showing up in the velocity page. If, this is in pre action invocation, $myvar 's value gets displayed . Only, when this goes into post action invocation, it is not showing up... Any clues? Regards, Prasad
Re: Struts 2.1.6 - custom interceptor
2009/2/9 Prasad Mangina pra...@constructiondeal.com: Dear All, i have programmed a simple (custom) interceptor. placed logic in post action invocation. public String doIntercept(ActionInvocation invocation) throws Exception { Object action = invocation.getAction(); String ret = invocation.invoke(); if (action instanceof MyAware) { ((MyAware) action).callme(); } return ret; } in Action's callme() method, I am setting action's var (this var has getter and setter). In my velocity vm file, I am accessing this action's var. $myvar By default, the action's property would be placed in valuestack and, could be accessed from velocity page. Hmmm, this is not showing up in the velocity page. If, this is in pre action invocation, $myvar 's value gets displayed . Only, when this goes into post action invocation, it is not showing up... Any clues? After you call invoke(), result (jsp, vm, etc) was already generated, that because your call to callme() is not working Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Proper PRG with PortletResult + Exception Mapping Results
Hi, prg does work fine using the normal workflow. I want to use this pattern with my exception mappings too and defined: exception-mapping result=error exception=java.lang.Exception/exception- mapping result name=error type=redirect param name=portletModeview/param param name=actionNameerror/param /result But all i get is a NPE in PortletResult line 120 because no location is set. Using a location instead of an error action it does work using the RenderDirect Stuff. How to use my own error handling action? Or is this not possible with portlets or possible at all? thx Torsten PS: Using 2.0.11.x Struts. -- Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge. Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. -- Linus Torvalds smime.p7s Description: S/MIME cryptographic signature
Re: Proper PRG with PortletResult + Exception Mapping Results
Am Montag, 9. Februar 2009 14:05:41 schrieb Torsten Krah: result name=error type=redirect Hm this should read redirectAction. And nvm, it works using redirectAction - argl, typo ... -- Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge. Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. -- Linus Torvalds smime.p7s Description: S/MIME cryptographic signature
Re: How to determine the Type of a Bean Property from String based OGNL Expression
Am Freitag, 16. Januar 2009 18:13:49 schrieb dusty: If you have the action can you use Reflection to step through the properties and find the types that way? I am using now BeanIntrospection + Parsing the failed Expression. How can i get there without parsing the String and tokenizing the ognl expression? Any other ideas? Reflection would be nice but than i have to parse the ognl expression anyways, correct? BeanIntrospection should do the same here. -- Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge. Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. -- Linus Torvalds smime.p7s Description: S/MIME cryptographic signature
Struts 2 file upload
Hi I'm using Strurs 2.1.2 and the s:file name=upload label=File / tag in the jsp page. My problem is that while the fileUpload appears to work most of the time I do get java.io.FileNotFoundException: on the .tmp file that Struts uses as part of the process (prob 1 in 10 times). Once this happens of course the whole process breaks down. I boiled the whole process down to a simple test action and tested it repeatedly and also checked if anyone else had this issue. It appears that this issue was fixed as of 2.0.9 release but I am still seeing it. I'm using commons-fileupload-1.2.1 and commons-io.1.3.2 Any ideas before I abandon struts 2 fileupload? Thanks -- View this message in context: http://www.nabble.com/Struts-2-file-upload-tp21915019p21915019.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
howto implement a @before annotation ?
Hi all, here's a scenario:I have some methods that before executed, they should run an interceptor --to verify if the user is authorized to do something. I read that struts2 has a @before @after interceptors that could help here. here's my though @before public String activateProcess() { //do something here } so in this case, since the method has a @before - it will execute the @before's interceptor first and only then the method activateProcess (assuming all is well with the interceptor) how can I implement the @before??? Thanks for any pointers. -- View this message in context: http://www.nabble.com/howto-implement-a-%40before-annotation---tp21915451p21915451.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: howto implement a @before annotation ?
On Monday 09 February 2009 16:43:09 xianwinwin wrote: Hi all, here's a scenario:I have some methods that before executed, they should run an interceptor --to verify if the user is authorized to do something. Write your own interceptor and check for your annotation. Something like this should work (I am using a custom annotation named @Secured): public String intercept(ActionInvocation actionInvocation) throws Exception { Object action = actionInvocation.getAction(); // get the action on which the interceptor is fired Class[] ca = {}; Method m = action.getClass().getMethod(actionInvocation.getProxy().getMethod(), ca); // get executed method Class c = action.getClass(); boolean classAnnotation = c.isAnnotationPresent(Secured.class); boolean methodAnnotation = m.isAnnotationPresent(Secured.class); // check if either method or class is annotated with @Secured if (classAnnotation || methodAnnotation) { ... ... Have fun :-) Piero - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts2 + tiles + i18n, getText issue
Hi, Just discovered this also happens with s:textfield key=surname label=%{getText('surname')}/s:textfield I don't know how to get around that as I can't put s:text in its place. Am I just doing something wrong? If so what should I be doing? Any help would be great Thanks Dave -Original Message- From: David Kerwick [mailto:david.kerw...@hse.ie] Sent: 06 February 2009 14:57 To: user@struts.apache.org Subject: Struts2 + tiles + i18n, getText issue Hi, I've come across a problem I can't figure out it seems similar to http://www.mail-archive.com/user@struts.apache.org/msg76063.html These two statements give different results when the language is changed s:property value=%{getText('test')}/ s:text name=test/ With s:text giving the correct language text but getText always gives the default language text. The tiles definition I have is definition name=test.basic template=/WEB-INF/tiles/testTemplate.jsp put-attribute name=body value=/test.jsp/ put-attribute name=navbar value=/WEB-INF/pages/navBar.jsp/ /definition They both work correctly if there's only one tile i.e. definition name=test.basic template=/WEB-INF/tiles/testTemplate.jsp put-attribute name=body value=/test.jsp/ /definition So it seems to be something to do with having multiple tiles but since s:text works the i18n interceptor must be working. Anyone any idea why getText is ignoring the language? I came across this when using tabbedPanel and adding i18n to the tab titles. I'm using Struts struts-2.0.14 and the tiles bundle that comes with it I change language using the code from HelloWorld.action h3Languages/h3 ul li s:url id=url action=test s:param name=request_localeen/s:param /s:url s:a href=%{url}English/s:a /li li s:url id=url action=test s:param name=request_localega/s:param /s:url s:a href=%{url}Irish/s:a /li /ul Thanks Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
ParametersInterceptor - isAccepted / acceptedParamNames won't work with a comma seperated list of param names
I wonder if someone faced this behavior before, wheter this is known or wanted. XWork ParametersInterceptor Code: protected boolean isAccepted(String paramName) { if (!this.acceptedParams.isEmpty()) { for (Pattern pattern : acceptedParams) { Matcher matcher = pattern.matcher(paramName); if (!matcher.matches()) { return false; } } } return acceptedPattern.matcher(paramName).matches(); } Taking a param list like id, anotherid which are both accepted and configured in my interceptor stack. But using the Code above, none of them will ever be accepted, because the pattern list is traversed and matched against the actual parameter. first run: id matches id - OK second run: anotherid does not match id - FALSE Although the Pattern list does contain a pattern which may result in a true match, false will be returned if there are more than 2 patterns in the list (order doesnt matter). My parameter is not set. Is this indented behavior? Or something wrong here? thx Torsten PS: Using struts 2.0.11.x, XWork 2.0.5 -- Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge. Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. -- Linus Torvalds smime.p7s Description: S/MIME cryptographic signature
actionError id parameter
I see that there is an id parameter for the actionError tag. The name suggest that it should add an id attribute to the ul tag that the result generates, but this is not the case. Is there a way to add an id attribute to the HTML element the actionError tag generates? Thank you very much. -- View this message in context: http://www.nabble.com/actionError-id-parameter-tp21916434p21916434.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: howto implement a @before annotation ?
YES! thank you so much this really helps! Piero Sartini-3 wrote: On Monday 09 February 2009 16:43:09 xianwinwin wrote: Hi all, here's a scenario:I have some methods that before executed, they should run an interceptor --to verify if the user is authorized to do something. Write your own interceptor and check for your annotation. Something like this should work (I am using a custom annotation named @Secured): public String intercept(ActionInvocation actionInvocation) throws Exception { Object action = actionInvocation.getAction(); // get the action on which the interceptor is fired Class[] ca = {}; Method m = action.getClass().getMethod(actionInvocation.getProxy().getMethod(), ca); // get executed method Class c = action.getClass(); boolean classAnnotation = c.isAnnotationPresent(Secured.class); boolean methodAnnotation = m.isAnnotationPresent(Secured.class); // check if either method or class is annotated with @Secured if (classAnnotation || methodAnnotation) { ... ... Have fun :-) Piero - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/howto-implement-a-%40before-annotation---tp21915451p21916477.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: ParametersInterceptor - isAccepted / acceptedParamNames won't work with a comma seperated list of param names
Yes, that was broken and was fixed in 2.1 to: protected boolean isAccepted(String paramName) { if (!this.acceptParams.isEmpty()) { for (Pattern pattern : acceptParams) { Matcher matcher = pattern.matcher(paramName); if (matcher.matches()) { return true; } } } return acceptedPattern.matcher(paramName).matches(); } as a workaround, you can use a regex that matches all the values: (id|anotherid) musachy On Mon, Feb 9, 2009 at 11:04 AM, Torsten Krah tk...@fachschaft.imn.htwk-leipzig.de wrote: I wonder if someone faced this behavior before, wheter this is known or wanted. XWork ParametersInterceptor Code: protected boolean isAccepted(String paramName) { if (!this.acceptedParams.isEmpty()) { for (Pattern pattern : acceptedParams) { Matcher matcher = pattern.matcher(paramName); if (!matcher.matches()) { return false; } } } return acceptedPattern.matcher(paramName).matches(); } Taking a param list like id, anotherid which are both accepted and configured in my interceptor stack. But using the Code above, none of them will ever be accepted, because the pattern list is traversed and matched against the actual parameter. first run: id matches id - OK second run: anotherid does not match id - FALSE Although the Pattern list does contain a pattern which may result in a true match, false will be returned if there are more than 2 patterns in the list (order doesnt matter). My parameter is not set. Is this indented behavior? Or something wrong here? thx Torsten PS: Using struts 2.0.11.x, XWork 2.0.5 -- Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge. Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. -- Linus Torvalds -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: trouble deploying struts2 app to tomcat 1.5.0.05 *FIXED*
Ok, I have no clue why this matters...but I changed my context setup everything deployed just fine. OLD ONE: Context path=/pwww docBase=/foo/pwww/pwww.war debug=10 swallowOutput=true reloadable=true crossContext=false privileged=true NEW ONE: Context path=/pwww reloadable=true docBase=/foo/pwww/pwww.war workDir=/foo/pwww/work Not sure if it was the one's I took out, or the new 'workDir' attribute that I added that fixed it...but it does deploy now! --Dan -Original Message- From: Dave Newton [mailto:newton.d...@yahoo.com] Sent: Saturday, February 07, 2009 6:44 PM To: Struts Users Mailing List Subject: Re: trouble deploying struts2 app to tomcat 1.5.0.05 I'd try to run it with a more recent HP-UX JVM and I'd look for known issues with the HP-UX JVM. Dave Wick, Dan wrote: Ok, to make the problem more simplified...I took the struts2-blank-2.0.12.war application deployed it to my local tomcat. That works. Took the same war deployed it to my server environment tomcat - FAILS. Note that I have commented out every other application running there, so it's a 1 to 1 comparison between local server. Difference between server local is: Local Tomcat: 5.5.17 Local JVM: 1.5.0_13 --- Server Tomcat: 5.5.20 Server JVM: 1.5.0.05-_17_oct_2006_02_15 Does anyone know the differences between these versions well? What could be the culprit!?! Stack for struts-blank on the server is: Feb 6, 2009 1:15:49 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts2 java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher at org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source) at org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Unknown Source) at org.apache.catalina.core.ApplicationFilterConfig.init(Unknow n Source) at org.apache.catalina.core.StandardContext.filterStart(Unknown Source) at org.apache.catalina.core.StandardContext.start(Unknown Source) at org.apache.catalina.core.ContainerBase.start(Unknown Source) at org.apache.catalina.core.StandardHost.start(Unknown Source) at org.apache.catalina.core.ContainerBase.start(Unknown Source) at org.apache.catalina.core.StandardEngine.start(Unknown Source) at org.apache.catalina.core.StandardService.start(Unknown Source) at org.apache.catalina.core.StandardServer.start(Unknown Source) at org.apache.catalina.startup.Catalina.start(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j av a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess or Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Unknown Source) at org.apache.catalina.startup.Bootstrap.main(Unknown Source) Feb 6, 2009 1:15:49 PM org.apache.catalina.core.StandardContext start SEVERE: Error filterStart Feb 6, 2009 1:15:49 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/blank] startup failed due to previous errors Feb 6, 2009 1:15:50 PM org.apache.catalina.core.ApplicationCont Looks very familiar...in fact exactly the same stack I get with my app. Any suggestions on where to go from here! --Dan - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: trouble deploying struts2 app to tomcat 1.5.0.05 *FIXED*
The exorcism suggestion wasn't that far fetched after all :) musachy On Mon, Feb 9, 2009 at 11:45 AM, Wick, Dan dan.w...@donaldson.com wrote: Ok, I have no clue why this matters...but I changed my context setup everything deployed just fine. OLD ONE: Context path=/pwww docBase=/foo/pwww/pwww.war debug=10 swallowOutput=true reloadable=true crossContext=false privileged=true NEW ONE: Context path=/pwww reloadable=true docBase=/foo/pwww/pwww.war workDir=/foo/pwww/work Not sure if it was the one's I took out, or the new 'workDir' attribute that I added that fixed it...but it does deploy now! --Dan -Original Message- From: Dave Newton [mailto:newton.d...@yahoo.com] Sent: Saturday, February 07, 2009 6:44 PM To: Struts Users Mailing List Subject: Re: trouble deploying struts2 app to tomcat 1.5.0.05 I'd try to run it with a more recent HP-UX JVM and I'd look for known issues with the HP-UX JVM. Dave Wick, Dan wrote: Ok, to make the problem more simplified...I took the struts2-blank-2.0.12.war application deployed it to my local tomcat. That works. Took the same war deployed it to my server environment tomcat - FAILS. Note that I have commented out every other application running there, so it's a 1 to 1 comparison between local server. Difference between server local is: Local Tomcat: 5.5.17 Local JVM: 1.5.0_13 --- Server Tomcat: 5.5.20 Server JVM: 1.5.0.05-_17_oct_2006_02_15 Does anyone know the differences between these versions well? What could be the culprit!?! Stack for struts-blank on the server is: Feb 6, 2009 1:15:49 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts2 java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher at org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source) at org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Unknown Source) at org.apache.catalina.core.ApplicationFilterConfig.init(Unknow n Source) at org.apache.catalina.core.StandardContext.filterStart(Unknown Source) at org.apache.catalina.core.StandardContext.start(Unknown Source) at org.apache.catalina.core.ContainerBase.start(Unknown Source) at org.apache.catalina.core.StandardHost.start(Unknown Source) at org.apache.catalina.core.ContainerBase.start(Unknown Source) at org.apache.catalina.core.StandardEngine.start(Unknown Source) at org.apache.catalina.core.StandardService.start(Unknown Source) at org.apache.catalina.core.StandardServer.start(Unknown Source) at org.apache.catalina.startup.Catalina.start(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j av a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess or Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Unknown Source) at org.apache.catalina.startup.Bootstrap.main(Unknown Source) Feb 6, 2009 1:15:49 PM org.apache.catalina.core.StandardContext start SEVERE: Error filterStart Feb 6, 2009 1:15:49 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/blank] startup failed due to previous errors Feb 6, 2009 1:15:50 PM org.apache.catalina.core.ApplicationCont Looks very familiar...in fact exactly the same stack I get with my app. Any suggestions on where to go from here! --Dan - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Multi pages - Wizard with Struts 2 ?
I've used the scope interceptor and works great, you may create an action for each screen or a method for each screen and use a redirect or an action chain to change between screens (after validation). Si quieres ser más positivo, pierde un electrón Miguel Ruiz Velasco S. On Mon, Feb 9, 2009 at 03:19, Fernandes Celinio SGCF celinio.fernan...@socgen.com wrote: Hi, I have a small workflow where the user needs to register. In the 1st screen the user chooses a login and a password. In the 2nd screen the user enters his first name, last name, age, etc In the 3rd and final screen the user enters her/his address. The submit final in the 3rd screen should be final : the data will be inserted into the database. What are the different ways to implement it with Struts 2 ? I read about the SCOPE interceptor, and also about a Spring Web Flow plugin for Struts 2. Also another scope plugin for Struts 2 etc ... I did not find detailed examples of the Spring Web Flow plugin, I am afraid that I will spend too much time with it. Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts 2 Portlet Validation Problems
Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal 2.7.1 and Struts 2.1.6. It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags: s:actionerror / s:fielderror / We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set. For example this is the view, which is the input of the edit action: action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action This is the edit action: action name=ItemEdit class=com.msp.portlets. ItemAction method=itemEdit interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param param name=itemId${itemId}/param /result result type=redirectAction name=input param name=actionName ItemView /param /result /action Does anyone know what the problem could be? Thanks in advance.
action alias / redirect
Greetings to all, in my struts2 actions file i have the following entry for an action : action name=SelectStepA class=action.SelectStepA ... (interceptors, results) ... /action i would like to have another action with shortname ie ssa that will redirect to the above action (sending all the url parameters) What is the best way to do this ? Thank you very much Best Regards, Leon - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2 Portlet Validation Problems
Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal 2.7.1 and Struts 2.1.6. It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags: s:actionerror / s:fielderror / We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set. For example this is the view, which is the input of the edit action: action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action This is the edit action: action name=ItemEdit class=com.msp.portlets. ItemAction method=itemEdit interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param param name=itemId${itemId}/param /result result type=redirectAction name=input param name=actionName ItemView /param /result /action Does anyone know what the problem could be? Thanks in advance. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
SV: action alias / redirect
Hello Leonidas, Common practice for doing this would be as follows: package name=yourPackageName namespace=/ extends=struts-default action name=ssa class=your.namespace.ssaAction result type=redirectAction param name=actionNameSelectStepA/param !-- Provided if action to redirect to is in another namespace. -- param name=namespaceyourRedirectActionsNamespace/param !-- Property found on the value stack. Can also be hard coded. -- param name=param1${propertyName}/param param name=param2${propertyName}/param /result /action action name=SelectStepA class=your.namespace.SelectStepA ... /action /package Hope that answers your question. Kind regards Christer! -Opprinnelig melding- Fra: Leonidas Papadakis [mailto:l...@bluecore.gr] Sendt: 9. februar 2009 18:39 Til: Struts Users Mailing List Emne: action alias / redirect Greetings to all, in my struts2 actions file i have the following entry for an action : action name=SelectStepA class=action.SelectStepA ... (interceptors, results) ... /action i would like to have another action with shortname ie ssa that will redirect to the above action (sending all the url parameters) What is the best way to do this ? Thank you very much Best Regards, Leon - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts 2 Portlet Validation Problems
Nils-H, Thanks for the reply. I've looked at them - none of them actually use the annotations as such. It's definitely not working with or without MessageStoreInterceptor when you utilise a redirect - it's absolutely fine if you simply replace the redirect with a simple JSP result. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 17:57 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal 2.7.1 and Struts 2.1.6. It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags: s:actionerror / s:fielderror / We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set. For example this is the view, which is the input of the edit action: action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action This is the edit action: action name=ItemEdit class=com.msp.portlets. ItemAction method=itemEdit interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param param name=itemId${itemId}/param /result result type=redirectAction name=input param name=actionName ItemView /param /result /action Does anyone know what the problem could be? Thanks in advance. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Scanned by MailDefender - managed email security from intY - www.maildefender.net - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2 Portlet Validation Problems
Yeah, you're right... It's not using annotations. Have you tried with xml validation? It's not a solution, but at least it will narrow down the problem. Nils-H On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Nils-H, Thanks for the reply. I've looked at them - none of them actually use the annotations as such. It's definitely not working with or without MessageStoreInterceptor when you utilise a redirect - it's absolutely fine if you simply replace the redirect with a simple JSP result. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 17:57 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal 2.7.1 and Struts 2.1.6. It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags: s:actionerror / s:fielderror / We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set. For example this is the view, which is the input of the edit action: action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action This is the edit action: action name=ItemEdit class=com.msp.portlets. ItemAction method=itemEdit interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param param name=itemId${itemId}/param /result result type=redirectAction name=input param name=actionName ItemView /param /result /action Does anyone know what the problem could be? Thanks in advance. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Scanned by MailDefender - managed email security from intY - www.maildefender.net - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: SV: action alias / redirect
That's perfect. Thank you very much Christer, much obliged. Regards, Leonidas Christer Gjerstad wrote: Hello Leonidas, Common practice for doing this would be as follows: package name=yourPackageName namespace=/ extends=struts-default action name=ssa class=your.namespace.ssaAction result type=redirectAction param name=actionNameSelectStepA/param !-- Provided if action to redirect to is in another namespace. -- param name=namespaceyourRedirectActionsNamespace/param !-- Property found on the value stack. Can also be hard coded. -- param name=param1${propertyName}/param param name=param2${propertyName}/param /result /action action name=SelectStepA class=your.namespace.SelectStepA ... /action /package Hope that answers your question. Kind regards Christer! -Opprinnelig melding- Fra: Leonidas Papadakis [mailto:l...@bluecore.gr] Sendt: 9. februar 2009 18:39 Til: Struts Users Mailing List Emne: action alias / redirect Greetings to all, in my struts2 actions file i have the following entry for an action : action name=SelectStepA class=action.SelectStepA ... (interceptors, results) ... /action i would like to have another action with shortname ie ssa that will redirect to the above action (sending all the url parameters) What is the best way to do this ? Thank you very much Best Regards, Leon - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts 2 Portlet Validation Problems
Rechecking and it seems none of them use a redirect as the input either, which is the main test case I'm after really. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 18:07 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Yeah, you're right... It's not using annotations. Have you tried with xml validation? It's not a solution, but at least it will narrow down the problem. Nils-H On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Nils-H, Thanks for the reply. I've looked at them - none of them actually use the annotations as such. It's definitely not working with or without MessageStoreInterceptor when you utilise a redirect - it's absolutely fine if you simply replace the redirect with a simple JSP result. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 17:57 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal 2.7.1 and Struts 2.1.6. It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags: s:actionerror / s:fielderror / We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set. For example this is the view, which is the input of the edit action: action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action This is the edit action: action name=ItemEdit class=com.msp.portlets. ItemAction method=itemEdit interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param param name=itemId${itemId}/param /result result type=redirectAction name=input param name=actionName ItemView /param /result /action Does anyone know what the problem could be? Thanks in advance. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Scanned by MailDefender - managed email security from intY - www.maildefender.net - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Scanned by MailDefender - managed email security from intY - www.maildefender.net - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2.1.6 - custom interceptor
Take a look at PreResultListener http://struts.apache.org/2.x/docs/preresultlistener.html Lukasz Lenart wrote: 2009/2/9 Prasad Mangina pra...@constructiondeal.com: Dear All, i have programmed a simple (custom) interceptor. placed logic in post action invocation. public String doIntercept(ActionInvocation invocation) throws Exception { Object action = invocation.getAction(); String ret = invocation.invoke(); if (action instanceof MyAware) { ((MyAware) action).callme(); } return ret; } in Action's callme() method, I am setting action's var (this var has getter and setter). In my velocity vm file, I am accessing this action's var. $myvar By default, the action's property would be placed in valuestack and, could be accessed from velocity page. Hmmm, this is not showing up in the velocity page. If, this is in pre action invocation, $myvar 's value gets displayed . Only, when this goes into post action invocation, it is not showing up... Any clues? After you call invoke(), result (jsp, vm, etc) was already generated, that because your call to callme() is not working Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/Struts-2.1.6---custom-interceptor-tp21910825p21918703.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Datetimepicker and struts 2.1.6
It could be related to this: http://jira.opensymphony.com/browse/XW-670 is the client on a different locale than the server? musachy On Mon, Feb 9, 2009 at 1:09 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hi, I migrated from struts 2.0.11 to 2.1.6 and the datetimepicker does not work anymore. I specifically set the display format to MM/dd/. Visually it displays correctly; however, when the page is submitted, the data I go back is in this format: -MM-ddT00:00:00-80:00. This tag worked on 2.0.11 without any custom conversion. I don't know why it does not work on 2.1.6. Can you help? Thanks. UI: From the log: input parameter 3 value set to 2009-01-02T00:00:00-08:00 input parameter 4 value set to 2009-01-30T00:00:00-08:00 A snip of my jsp code: %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/struts-tags prefix=s % %@ taglib prefix=sx uri=/struts-dojo-tags % html head sx:head/ /head body ….. sx:datetimepicker key=label.contract.approvaldate name=contract.approvalDate displayFormat=MM/dd// /body /html Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Datetimepicker and struts 2.1.6
No, it's the same locale. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:25 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 It could be related to this: http://jira.opensymphony.com/browse/XW-670 is the client on a different locale than the server? musachy On Mon, Feb 9, 2009 at 1:09 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hi, I migrated from struts 2.0.11 to 2.1.6 and the datetimepicker does not work anymore. I specifically set the display format to MM/dd/. Visually it displays correctly; however, when the page is submitted, the data I go back is in this format: -MM-ddT00:00:00-80:00. This tag worked on 2.0.11 without any custom conversion. I don't know why it does not work on 2.1.6. Can you help? Thanks. UI: From the log: input parameter 3 value set to 2009-01-02T00:00:00-08:00 input parameter 4 value set to 2009-01-30T00:00:00-08:00 A snip of my jsp code: %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/struts-tags prefix=s % %@ taglib prefix=sx uri=/struts-dojo-tags % html head sx:head/ /head body . sx:datetimepicker key=label.contract.approvaldate name=contract.approvalDate displayFormat=MM/dd// /body /html Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Datetimepicker and struts 2.1.6
xwork understands the 2009-01-30T00:00:00-08:00 format, what error are you getting? musachy On Mon, Feb 9, 2009 at 1:35 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: No, it's the same locale. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:25 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 It could be related to this: http://jira.opensymphony.com/browse/XW-670 is the client on a different locale than the server? musachy On Mon, Feb 9, 2009 at 1:09 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hi, I migrated from struts 2.0.11 to 2.1.6 and the datetimepicker does not work anymore. I specifically set the display format to MM/dd/. Visually it displays correctly; however, when the page is submitted, the data I go back is in this format: -MM-ddT00:00:00-80:00. This tag worked on 2.0.11 without any custom conversion. I don't know why it does not work on 2.1.6. Can you help? Thanks. UI: From the log: input parameter 3 value set to 2009-01-02T00:00:00-08:00 input parameter 4 value set to 2009-01-30T00:00:00-08:00 A snip of my jsp code: %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/struts-tags prefix=s % %@ taglib prefix=sx uri=/struts-dojo-tags % html head sx:head/ /head body . sx:datetimepicker key=label.contract.approvaldate name=contract.approvalDate displayFormat=MM/dd// /body /html Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts 2 Portlet Validation Problems
I can confirm that using validation xml instead of annotations does exactly the same thing. i.e. a forward to a JSP will display the messages, a redirectAction type result will 'lose' the messages during the dispatch. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 18:07 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Yeah, you're right... It's not using annotations. Have you tried with xml validation? It's not a solution, but at least it will narrow down the problem. Nils-H On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Nils-H, Thanks for the reply. I've looked at them - none of them actually use the annotations as such. It's definitely not working with or without MessageStoreInterceptor when you utilise a redirect - it's absolutely fine if you simply replace the redirect with a simple JSP result. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 17:57 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal 2.7.1 and Struts 2.1.6. It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags: s:actionerror / s:fielderror / We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set. For example this is the view, which is the input of the edit action: action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action This is the edit action: action name=ItemEdit class=com.msp.portlets. ItemAction method=itemEdit interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param param name=itemId${itemId}/param /result result type=redirectAction name=input param name=actionName ItemView /param /result /action Does anyone know what the problem could be? Thanks in advance. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Scanned by MailDefender - managed email security from intY - www.maildefender.net - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Scanned by MailDefender - managed email security from intY - www.maildefender.net - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Datetimepicker and struts 2.1.6
It did not throw exception or anything like that. I specifically set the display format to MM/dd/. Visually it displays correctly on UI as 01/02/2009 The problem is: When the form is submitted, I got data back as 2009-01-02T00:00:00-08:00 instead of 01/02/2009. -Hien -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:44 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 xwork understands the 2009-01-30T00:00:00-08:00 format, what error are you getting? musachy On Mon, Feb 9, 2009 at 1:35 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: No, it's the same locale. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:25 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 It could be related to this: http://jira.opensymphony.com/browse/XW-670 is the client on a different locale than the server? musachy On Mon, Feb 9, 2009 at 1:09 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hi, I migrated from struts 2.0.11 to 2.1.6 and the datetimepicker does not work anymore. I specifically set the display format to MM/dd/. Visually it displays correctly; however, when the page is submitted, the data I go back is in this format: -MM-ddT00:00:00-80:00. This tag worked on 2.0.11 without any custom conversion. I don't know why it does not work on 2.1.6. Can you help? Thanks. UI: From the log: input parameter 3 value set to 2009-01-02T00:00:00-08:00 input parameter 4 value set to 2009-01-30T00:00:00-08:00 A snip of my jsp code: %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/struts-tags prefix=s % %@ taglib prefix=sx uri=/struts-dojo-tags % html head sx:head/ /head body . sx:datetimepicker key=label.contract.approvaldate name=contract.approvalDate displayFormat=MM/dd// /body /html Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then
Re: Datetimepicker and struts 2.1.6
ok, I see what you mean now. This is the way that it was supposed to work since the beginning, so the date is always submitted in a standard format, disregarding the display format, or the locales of the client and server. If you field is of type Date, xwork will know how to parse the value. musachy On Mon, Feb 9, 2009 at 1:58 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: It did not throw exception or anything like that. I specifically set the display format to MM/dd/. Visually it displays correctly on UI as 01/02/2009 The problem is: When the form is submitted, I got data back as 2009-01-02T00:00:00-08:00 instead of 01/02/2009. -Hien -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:44 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 xwork understands the 2009-01-30T00:00:00-08:00 format, what error are you getting? musachy On Mon, Feb 9, 2009 at 1:35 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: No, it's the same locale. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:25 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 It could be related to this: http://jira.opensymphony.com/browse/XW-670 is the client on a different locale than the server? musachy On Mon, Feb 9, 2009 at 1:09 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hi, I migrated from struts 2.0.11 to 2.1.6 and the datetimepicker does not work anymore. I specifically set the display format to MM/dd/. Visually it displays correctly; however, when the page is submitted, the data I go back is in this format: -MM-ddT00:00:00-80:00. This tag worked on 2.0.11 without any custom conversion. I don't know why it does not work on 2.1.6. Can you help? Thanks. UI: From the log: input parameter 3 value set to 2009-01-02T00:00:00-08:00 input parameter 4 value set to 2009-01-30T00:00:00-08:00 A snip of my jsp code: %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/struts-tags prefix=s % %@ taglib prefix=sx uri=/struts-dojo-tags % html head sx:head/ /head body . sx:datetimepicker key=label.contract.approvaldate name=contract.approvalDate displayFormat=MM/dd// /body /html Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as
Re: Struts 2 Portlet Validation Problems
Messages will be lost if a redirectAction is used, unless the MessageStoreInterceptor is used, or is that different in portlets Nils? musachy On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen dean.pul...@msp-uk.com wrote: I can confirm that using validation xml instead of annotations does exactly the same thing. i.e. a forward to a JSP will display the messages, a redirectAction type result will 'lose' the messages during the dispatch. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 18:07 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Yeah, you're right... It's not using annotations. Have you tried with xml validation? It's not a solution, but at least it will narrow down the problem. Nils-H On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Nils-H, Thanks for the reply. I've looked at them - none of them actually use the annotations as such. It's definitely not working with or without MessageStoreInterceptor when you utilise a redirect - it's absolutely fine if you simply replace the redirect with a simple JSP result. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 17:57 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal 2.7.1 and Struts 2.1.6. It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags: s:actionerror / s:fielderror / We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set. For example this is the view, which is the input of the edit action: action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action This is the edit action: action name=ItemEdit class=com.msp.portlets. ItemAction method=itemEdit interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param param name=itemId${itemId}/param /result result type=redirectAction name=input param name=actionName ItemView /param /result /action Does anyone know what the problem could be? Thanks in advance. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Scanned by MailDefender - managed email security from intY - www.maildefender.net - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Scanned by MailDefender - managed email security from intY - www.maildefender.net - To unsubscribe, e-mail:
How to generate a URL with s:url encoded in UTF-8
Hi there, I am trying to generate a URL with s:url and s:param so that parameters are encoded in URL. Special characters are not processed ok. (The struts action works fine as I have posted that same URL data with a form encoded in UTF-8 and they are decoded fine in my java code) I've tried doing s:params:property ... escape=true/s:param but no luck. Chars are escaped but not encoded UTF-8. Any ideas if this is possible? Thanks, Ignacio -- View this message in context: http://www.nabble.com/How-to-generate-a-URL-with-s%3Aurl-encoded-in-UTF-8-tp21919013p21919013.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Datetimepicker and struts 2.1.6
Hmmm... It used to work in Struts 2.0.11. After I migrated the code to use Struts 2.1.6, it does not work anymore. I'm thinking of overriding the struts 2.1.6 core jar with the datetimepicker classes, css, template, etc. from 2.0.11 (the working version). What do you think? -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 11:07 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 ok, I see what you mean now. This is the way that it was supposed to work since the beginning, so the date is always submitted in a standard format, disregarding the display format, or the locales of the client and server. If you field is of type Date, xwork will know how to parse the value. musachy On Mon, Feb 9, 2009 at 1:58 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: It did not throw exception or anything like that. I specifically set the display format to MM/dd/. Visually it displays correctly on UI as 01/02/2009 The problem is: When the form is submitted, I got data back as 2009-01-02T00:00:00-08:00 instead of 01/02/2009. -Hien -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:44 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 xwork understands the 2009-01-30T00:00:00-08:00 format, what error are you getting? musachy On Mon, Feb 9, 2009 at 1:35 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: No, it's the same locale. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:25 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 It could be related to this: http://jira.opensymphony.com/browse/XW-670 is the client on a different locale than the server? musachy On Mon, Feb 9, 2009 at 1:09 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hi, I migrated from struts 2.0.11 to 2.1.6 and the datetimepicker does not work anymore. I specifically set the display format to MM/dd/. Visually it displays correctly; however, when the page is submitted, the data I go back is in this format: -MM-ddT00:00:00-80:00. This tag worked on 2.0.11 without any custom conversion. I don't know why it does not work on 2.1.6. Can you help? Thanks. UI: From the log: input parameter 3 value set to 2009-01-02T00:00:00-08:00 input parameter 4 value set to 2009-01-30T00:00:00-08:00 A snip of my jsp code: %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/struts-tags prefix=s % %@ taglib prefix=sx uri=/struts-dojo-tags % html head sx:head/ /head body . sx:datetimepicker key=label.contract.approvaldate name=contract.approvalDate displayFormat=MM/dd// /body /html Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd
Re: Datetimepicker and struts 2.1.6
it does not work anymore. means that the date field is not set? musachy On Mon, Feb 9, 2009 at 2:21 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hmmm... It used to work in Struts 2.0.11. After I migrated the code to use Struts 2.1.6, it does not work anymore. I'm thinking of overriding the struts 2.1.6 core jar with the datetimepicker classes, css, template, etc. from 2.0.11 (the working version). What do you think? -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 11:07 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 ok, I see what you mean now. This is the way that it was supposed to work since the beginning, so the date is always submitted in a standard format, disregarding the display format, or the locales of the client and server. If you field is of type Date, xwork will know how to parse the value. musachy On Mon, Feb 9, 2009 at 1:58 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: It did not throw exception or anything like that. I specifically set the display format to MM/dd/. Visually it displays correctly on UI as 01/02/2009 The problem is: When the form is submitted, I got data back as 2009-01-02T00:00:00-08:00 instead of 01/02/2009. -Hien -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:44 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 xwork understands the 2009-01-30T00:00:00-08:00 format, what error are you getting? musachy On Mon, Feb 9, 2009 at 1:35 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: No, it's the same locale. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:25 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 It could be related to this: http://jira.opensymphony.com/browse/XW-670 is the client on a different locale than the server? musachy On Mon, Feb 9, 2009 at 1:09 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hi, I migrated from struts 2.0.11 to 2.1.6 and the datetimepicker does not work anymore. I specifically set the display format to MM/dd/. Visually it displays correctly; however, when the page is submitted, the data I go back is in this format: -MM-ddT00:00:00-80:00. This tag worked on 2.0.11 without any custom conversion. I don't know why it does not work on 2.1.6. Can you help? Thanks. UI: From the log: input parameter 3 value set to 2009-01-02T00:00:00-08:00 input parameter 4 value set to 2009-01-30T00:00:00-08:00 A snip of my jsp code: %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/struts-tags prefix=s % %@ taglib prefix=sx uri=/struts-dojo-tags % html head sx:head/ /head body . sx:datetimepicker key=label.contract.approvaldate name=contract.approvalDate displayFormat=MM/dd// /body /html Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. - To unsubscribe, e-mail:
RE: Struts 2 Portlet Validation Problems
I've tried, and reverted back for now, to using the MessageStoreInterceptor with no success, the messages are still lost. We've successfully used the MessageStoreInterceptor on non-portlet applications. Annoyingly, anything you input on the form is also lost, which will cause much chagrin for end-users. E.g. action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action action name=ItemEdit class=com.msp.portlets.ItemAction method=editItem interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param /result result type=redirectAction name=input param name=actionNameItemView/param /result /action Dean. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: 09 February 2009 19:19 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Messages will be lost if a redirectAction is used, unless the MessageStoreInterceptor is used, or is that different in portlets Nils? musachy On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen dean.pul...@msp-uk.com wrote: I can confirm that using validation xml instead of annotations does exactly the same thing. i.e. a forward to a JSP will display the messages, a redirectAction type result will 'lose' the messages during the dispatch. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 18:07 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Yeah, you're right... It's not using annotations. Have you tried with xml validation? It's not a solution, but at least it will narrow down the problem. Nils-H On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Nils-H, Thanks for the reply. I've looked at them - none of them actually use the annotations as such. It's definitely not working with or without MessageStoreInterceptor when you utilise a redirect - it's absolutely fine if you simply replace the redirect with a simple JSP result. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 17:57 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal 2.7.1 and Struts 2.1.6. It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags: s:actionerror / s:fielderror / We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set. For example this is the view, which is the input of the edit action: action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action This is the edit action: action name=ItemEdit class=com.msp.portlets. ItemAction method=itemEdit interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref
Problem with JSON Result and Form Submit
Hello everyone, Anyone know how to pass post message information from an action containing a form to an action returning JSON result via an JSP page with a DOJO script calling the JSON result action? Please see example below. I am loosing the post message on the way. One solution could be to get the post message parameters from the value stack and then pass them into the DOJO script, but this sounds like a non-Struts way to me. In the book Practical Apache Struts2 Web 2.0 projects written by Ian Roughley (Great book by the way!), chapter 10, there is an example without passing information into the action. I have based my solution on this example but cannot get it to work properly. package name=products namespace=/products extends=struts-default !-- ProductSearch Action -- action name=productSearch class=com.demand.product.ProductSearch result/jsp/product/productSearch.jsp/result /action !-- ProductSearchResult Action -- action name=productSearchResult class=com.demand.product.BaseProductAction result name=input/jsp/product/productSearch.jsp/result result/jsp/product/productSearchJsonResult.jsp/result /action /package package name=jsonProducts namespace=/json/products extends=json-default default-interceptor-ref name=json/ action name=productsJsonResult class=com.demand.product.ProductSearchResults result type=json param name=rootproducts/param /result /action /package Cheers! - Christer Gjerstad
Re: How to generate a URL with s:url encoded in UTF-8
Ignacio de Córdoba wrote: Hi there, I am trying to generate a URL with s:url and s:param so that parameters are encoded in URL. Special characters are not processed ok. (The struts action works fine as I have posted that same URL data with a form encoded in UTF-8 and they are decoded fine in my java code) I've tried doing s:params:property ... escape=true/s:param but no luck. Chars are escaped but not encoded UTF-8. Any ideas if this is possible? Appservers usually need some config to process UTF-8 URLs (you need that when using GET, e.g. links), see for example http://confluence.atlassian.com/display/DOC/Application+Server+URL+encoding Cheers, Manos - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Datetimepicker and struts 2.1.6
does not work anymore = on submit, the date field got set to 2009-01-02T00:00:00-08:00 instead of 01/02/2009. I would like the date field to be set to 01/02/2009 [which was what the date field got set when using 2.0.11.] -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 11:24 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 it does not work anymore. means that the date field is not set? musachy On Mon, Feb 9, 2009 at 2:21 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hmmm... It used to work in Struts 2.0.11. After I migrated the code to use Struts 2.1.6, it does not work anymore. I'm thinking of overriding the struts 2.1.6 core jar with the datetimepicker classes, css, template, etc. from 2.0.11 (the working version). What do you think? -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 11:07 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 ok, I see what you mean now. This is the way that it was supposed to work since the beginning, so the date is always submitted in a standard format, disregarding the display format, or the locales of the client and server. If you field is of type Date, xwork will know how to parse the value. musachy On Mon, Feb 9, 2009 at 1:58 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: It did not throw exception or anything like that. I specifically set the display format to MM/dd/. Visually it displays correctly on UI as 01/02/2009 The problem is: When the form is submitted, I got data back as 2009-01-02T00:00:00-08:00 instead of 01/02/2009. -Hien -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:44 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 xwork understands the 2009-01-30T00:00:00-08:00 format, what error are you getting? musachy On Mon, Feb 9, 2009 at 1:35 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: No, it's the same locale. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:25 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 It could be related to this: http://jira.opensymphony.com/browse/XW-670 is the client on a different locale than the server? musachy On Mon, Feb 9, 2009 at 1:09 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hi, I migrated from struts 2.0.11 to 2.1.6 and the datetimepicker does not work anymore. I specifically set the display format to MM/dd/. Visually it displays correctly; however, when the page is submitted, the data I go back is in this format: -MM-ddT00:00:00-80:00. This tag worked on 2.0.11 without any custom conversion. I don't know why it does not work on 2.1.6. Can you help? Thanks. UI: From the log: input parameter 3 value set to 2009-01-02T00:00:00-08:00 input parameter 4 value set to 2009-01-30T00:00:00-08:00 A snip of my jsp code: %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/struts-tags prefix=s % %@ taglib prefix=sx uri=/struts-dojo-tags % html head sx:head/ /head body . sx:datetimepicker key=label.contract.approvaldate name=contract.approvalDate displayFormat=MM/dd// /body /html Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be
Re: Datetimepicker and struts 2.1.6
I assume that's is because the date field is of type String then. musachy On Mon, Feb 9, 2009 at 2:32 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: does not work anymore = on submit, the date field got set to 2009-01-02T00:00:00-08:00 instead of 01/02/2009. I would like the date field to be set to 01/02/2009 [which was what the date field got set when using 2.0.11.] -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 11:24 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 it does not work anymore. means that the date field is not set? musachy On Mon, Feb 9, 2009 at 2:21 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hmmm... It used to work in Struts 2.0.11. After I migrated the code to use Struts 2.1.6, it does not work anymore. I'm thinking of overriding the struts 2.1.6 core jar with the datetimepicker classes, css, template, etc. from 2.0.11 (the working version). What do you think? -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 11:07 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 ok, I see what you mean now. This is the way that it was supposed to work since the beginning, so the date is always submitted in a standard format, disregarding the display format, or the locales of the client and server. If you field is of type Date, xwork will know how to parse the value. musachy On Mon, Feb 9, 2009 at 1:58 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: It did not throw exception or anything like that. I specifically set the display format to MM/dd/. Visually it displays correctly on UI as 01/02/2009 The problem is: When the form is submitted, I got data back as 2009-01-02T00:00:00-08:00 instead of 01/02/2009. -Hien -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:44 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 xwork understands the 2009-01-30T00:00:00-08:00 format, what error are you getting? musachy On Mon, Feb 9, 2009 at 1:35 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: No, it's the same locale. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:25 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 It could be related to this: http://jira.opensymphony.com/browse/XW-670 is the client on a different locale than the server? musachy On Mon, Feb 9, 2009 at 1:09 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hi, I migrated from struts 2.0.11 to 2.1.6 and the datetimepicker does not work anymore. I specifically set the display format to MM/dd/. Visually it displays correctly; however, when the page is submitted, the data I go back is in this format: -MM-ddT00:00:00-80:00. This tag worked on 2.0.11 without any custom conversion. I don't know why it does not work on 2.1.6. Can you help? Thanks. UI: From the log: input parameter 3 value set to 2009-01-02T00:00:00-08:00 input parameter 4 value set to 2009-01-30T00:00:00-08:00 A snip of my jsp code: %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/struts-tags prefix=s % %@ taglib prefix=sx uri=/struts-dojo-tags % html head sx:head/ /head body . sx:datetimepicker key=label.contract.approvaldate name=contract.approvalDate displayFormat=MM/dd// /body /html Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck
RE: Datetimepicker and struts 2.1.6
Yes. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 11:36 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 I assume that's is because the date field is of type String then. musachy On Mon, Feb 9, 2009 at 2:32 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: does not work anymore = on submit, the date field got set to 2009-01-02T00:00:00-08:00 instead of 01/02/2009. I would like the date field to be set to 01/02/2009 [which was what the date field got set when using 2.0.11.] -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 11:24 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 it does not work anymore. means that the date field is not set? musachy On Mon, Feb 9, 2009 at 2:21 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hmmm... It used to work in Struts 2.0.11. After I migrated the code to use Struts 2.1.6, it does not work anymore. I'm thinking of overriding the struts 2.1.6 core jar with the datetimepicker classes, css, template, etc. from 2.0.11 (the working version). What do you think? -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 11:07 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 ok, I see what you mean now. This is the way that it was supposed to work since the beginning, so the date is always submitted in a standard format, disregarding the display format, or the locales of the client and server. If you field is of type Date, xwork will know how to parse the value. musachy On Mon, Feb 9, 2009 at 1:58 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: It did not throw exception or anything like that. I specifically set the display format to MM/dd/. Visually it displays correctly on UI as 01/02/2009 The problem is: When the form is submitted, I got data back as 2009-01-02T00:00:00-08:00 instead of 01/02/2009. -Hien -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:44 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 xwork understands the 2009-01-30T00:00:00-08:00 format, what error are you getting? musachy On Mon, Feb 9, 2009 at 1:35 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: No, it's the same locale. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:25 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 It could be related to this: http://jira.opensymphony.com/browse/XW-670 is the client on a different locale than the server? musachy On Mon, Feb 9, 2009 at 1:09 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hi, I migrated from struts 2.0.11 to 2.1.6 and the datetimepicker does not work anymore. I specifically set the display format to MM/dd/. Visually it displays correctly; however, when the page is submitted, the data I go back is in this format: -MM-ddT00:00:00-80:00. This tag worked on 2.0.11 without any custom conversion. I don't know why it does not work on 2.1.6. Can you help? Thanks. UI: From the log: input parameter 3 value set to 2009-01-02T00:00:00-08:00 input parameter 4 value set to 2009-01-30T00:00:00-08:00 A snip of my jsp code: %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/struts-tags prefix=s % %@ taglib prefix=sx uri=/struts-dojo-tags % html head sx:head/ /head body . sx:datetimepicker key=label.contract.approvaldate name=contract.approvalDate displayFormat=MM/dd// /body /html Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Notice: This e-mail message, together with any
Re: Problem with JSON Result and Form Submit
So you have a page that has a form, and that submits to an action that returns JSON? What is the message that you are talking about? Posting a section of the JSP would also help. musachy On Mon, Feb 9, 2009 at 2:31 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Hello everyone, Anyone know how to pass post message information from an action containing a form to an action returning JSON result via an JSP page with a DOJO script calling the JSON result action? Please see example below. I am loosing the post message on the way. One solution could be to get the post message parameters from the value stack and then pass them into the DOJO script, but this sounds like a non-Struts way to me. In the book Practical Apache Struts2 Web 2.0 projects written by Ian Roughley (Great book by the way!), chapter 10, there is an example without passing information into the action. I have based my solution on this example but cannot get it to work properly. package name=products namespace=/products extends=struts-default !-- ProductSearch Action -- action name=productSearch class=com.demand.product.ProductSearch result/jsp/product/productSearch.jsp/result /action !-- ProductSearchResult Action -- action name=productSearchResult class=com.demand.product.BaseProductAction result name=input/jsp/product/productSearch.jsp/result result/jsp/product/productSearchJsonResult.jsp/result /action /package package name=jsonProducts namespace=/json/products extends=json-default default-interceptor-ref name=json/ action name=productsJsonResult class=com.demand.product.ProductSearchResults result type=json param name=rootproducts/param /result /action /package Cheers! - Christer Gjerstad -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
SV: Problem with JSON Result and Form Submit
Almost. I have a page that has a form, and that submits (Post method) to a an action that has JSP page as result containing a DOJO script calling an action that returns a JSON result. It is a search form where the user provides information and the result shall be presented on another page. But I want JSON result back so that I can handle the search result with Ajax using Dojo. E.g. removing results based on filtering done by the user. Cheers! -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 20:44 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit So you have a page that has a form, and that submits to an action that returns JSON? What is the message that you are talking about? Posting a section of the JSP would also help. musachy On Mon, Feb 9, 2009 at 2:31 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Hello everyone, Anyone know how to pass post message information from an action containing a form to an action returning JSON result via an JSP page with a DOJO script calling the JSON result action? Please see example below. I am loosing the post message on the way. One solution could be to get the post message parameters from the value stack and then pass them into the DOJO script, but this sounds like a non-Struts way to me. In the book Practical Apache Struts2 Web 2.0 projects written by Ian Roughley (Great book by the way!), chapter 10, there is an example without passing information into the action. I have based my solution on this example but cannot get it to work properly. package name=products namespace=/products extends=struts-default !-- ProductSearch Action -- action name=productSearch class=com.demand.product.ProductSearch result/jsp/product/productSearch.jsp/result /action !-- ProductSearchResult Action -- action name=productSearchResult class=com.demand.product.BaseProductAction result name=input/jsp/product/productSearch.jsp/result result/jsp/product/productSearchJsonResult.jsp/result /action /package package name=jsonProducts namespace=/json/products extends=json-default default-interceptor-ref name=json/ action name=productsJsonResult class=com.demand.product.ProductSearchResults result type=json param name=rootproducts/param /result /action /package Cheers! - Christer Gjerstad -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Problem with JSON Result and Form Submit
Ok, so the Dojo script needs to pass some data to the action, and that data is the one that comes from the first request right? musachy On Mon, Feb 9, 2009 at 2:54 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Almost. I have a page that has a form, and that submits (Post method) to a an action that has JSP page as result containing a DOJO script calling an action that returns a JSON result. It is a search form where the user provides information and the result shall be presented on another page. But I want JSON result back so that I can handle the search result with Ajax using Dojo. E.g. removing results based on filtering done by the user. Cheers! -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 20:44 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit So you have a page that has a form, and that submits to an action that returns JSON? What is the message that you are talking about? Posting a section of the JSP would also help. musachy On Mon, Feb 9, 2009 at 2:31 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Hello everyone, Anyone know how to pass post message information from an action containing a form to an action returning JSON result via an JSP page with a DOJO script calling the JSON result action? Please see example below. I am loosing the post message on the way. One solution could be to get the post message parameters from the value stack and then pass them into the DOJO script, but this sounds like a non-Struts way to me. In the book Practical Apache Struts2 Web 2.0 projects written by Ian Roughley (Great book by the way!), chapter 10, there is an example without passing information into the action. I have based my solution on this example but cannot get it to work properly. package name=products namespace=/products extends=struts-default !-- ProductSearch Action -- action name=productSearch class=com.demand.product.ProductSearch result/jsp/product/productSearch.jsp/result /action !-- ProductSearchResult Action -- action name=productSearchResult class=com.demand.product.BaseProductAction result name=input/jsp/product/productSearch.jsp/result result/jsp/product/productSearchJsonResult.jsp/result /action /package package name=jsonProducts namespace=/json/products extends=json-default default-interceptor-ref name=json/ action name=productsJsonResult class=com.demand.product.ProductSearchResults result type=json param name=rootproducts/param /result /action /package Cheers! - Christer Gjerstad -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts 2 Portlet Validation Problems
It's a bit odd, but I seem to have got it working finally. I've set the messageStoreInterceptor before the portletDefaultStack. This threw an error about ItemView that having an input result - a bit odd considering it's the ItemEdit that needs the input result. I added this, and it magically works. Not sure this is the behaviour we'd expect, or even want - but it certainly seems to work. I also added a param name=title${title}/param, for each relevant param, to the input redirectAction to ensure the user's input was not lost during the failed validation redirect. -Original Message- From: Dean Pullen [mailto:dean.pul...@msp-uk.com] Sent: 09 February 2009 19:31 To: Struts Users Mailing List Subject: RE: Struts 2 Portlet Validation Problems I've tried, and reverted back for now, to using the MessageStoreInterceptor with no success, the messages are still lost. We've successfully used the MessageStoreInterceptor on non-portlet applications. Annoyingly, anything you input on the form is also lost, which will cause much chagrin for end-users. E.g. action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action action name=ItemEdit class=com.msp.portlets.ItemAction method=editItem interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param /result result type=redirectAction name=input param name=actionNameItemView/param /result /action Dean. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: 09 February 2009 19:19 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Messages will be lost if a redirectAction is used, unless the MessageStoreInterceptor is used, or is that different in portlets Nils? musachy On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen dean.pul...@msp-uk.com wrote: I can confirm that using validation xml instead of annotations does exactly the same thing. i.e. a forward to a JSP will display the messages, a redirectAction type result will 'lose' the messages during the dispatch. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 18:07 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Yeah, you're right... It's not using annotations. Have you tried with xml validation? It's not a solution, but at least it will narrow down the problem. Nils-H On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Nils-H, Thanks for the reply. I've looked at them - none of them actually use the annotations as such. It's definitely not working with or without MessageStoreInterceptor when you utilise a redirect - it's absolutely fine if you simply replace the redirect with a simple JSP result. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 17:57 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal 2.7.1 and Struts 2.1.6. It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags: s:actionerror / s:fielderror / We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set. For example this is the view, which is the input of the edit action: action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref
SV: Problem with JSON Result and Form Submit
Yes, correct. :-) So my question is; is that the way to do it? With the Dojo script that is, passing the data into the action? Will not the params interceptor handle this? What I've done so far is to make another action class implementing the ParameterAware interface so that I will get the incoming parameters. I then create and return a querystring and get this from the value stack in the page containing the Dojo script. I can then (hopefully) pass the information retrieved into the action returning the JSON result. This I will do with dojo.xhrPost and set the optional postData. Not solved this at the moment, but working on it. Seems like my solution is not that trivial so I would appreciate any help in this matter! :-) Cheers! -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 20:59 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit Ok, so the Dojo script needs to pass some data to the action, and that data is the one that comes from the first request right? musachy On Mon, Feb 9, 2009 at 2:54 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Almost. I have a page that has a form, and that submits (Post method) to a an action that has JSP page as result containing a DOJO script calling an action that returns a JSON result. It is a search form where the user provides information and the result shall be presented on another page. But I want JSON result back so that I can handle the search result with Ajax using Dojo. E.g. removing results based on filtering done by the user. Cheers! -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 20:44 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit So you have a page that has a form, and that submits to an action that returns JSON? What is the message that you are talking about? Posting a section of the JSP would also help. musachy On Mon, Feb 9, 2009 at 2:31 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Hello everyone, Anyone know how to pass post message information from an action containing a form to an action returning JSON result via an JSP page with a DOJO script calling the JSON result action? Please see example below. I am loosing the post message on the way. One solution could be to get the post message parameters from the value stack and then pass them into the DOJO script, but this sounds like a non-Struts way to me. In the book Practical Apache Struts2 Web 2.0 projects written by Ian Roughley (Great book by the way!), chapter 10, there is an example without passing information into the action. I have based my solution on this example but cannot get it to work properly. package name=products namespace=/products extends=struts-default !-- ProductSearch Action -- action name=productSearch class=com.demand.product.ProductSearch result/jsp/product/productSearch.jsp/result /action !-- ProductSearchResult Action -- action name=productSearchResult class=com.demand.product.BaseProductAction result name=input/jsp/product/productSearch.jsp/result result/jsp/product/productSearchJsonResult.jsp/result /action /package package name=jsonProducts namespace=/json/products extends=json-default default-interceptor-ref name=json/ action name=productsJsonResult class=com.demand.product.ProductSearchResults result type=json param name=rootproducts/param /result /action /package Cheers! - Christer Gjerstad -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Problem with JSON Result and Form Submit
There are a lots of different ways of doing that. What I would do is: 1. add a field for the first action wit getters and setters for the params 2. in the jsp do something like: script var param1 = s:property value=''param1' escapeJavaScript='true'/; var param2 = s:property value=''param2' escapeJavaScript='true'/; /script 3. Call the second action passing the params to Dojo like: { 'param1': param1, 'param2' : param2} Dojo accepts a map that it serializes into a query string (if it is GET request). I forgot the dojo method signatures, google it up :). This way you can avoid building the query string yourself, which is always error prone. musachy On Mon, Feb 9, 2009 at 3:15 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Yes, correct. :-) So my question is; is that the way to do it? With the Dojo script that is, passing the data into the action? Will not the params interceptor handle this? What I've done so far is to make another action class implementing the ParameterAware interface so that I will get the incoming parameters. I then create and return a querystring and get this from the value stack in the page containing the Dojo script. I can then (hopefully) pass the information retrieved into the action returning the JSON result. This I will do with dojo.xhrPost and set the optional postData. Not solved this at the moment, but working on it. Seems like my solution is not that trivial so I would appreciate any help in this matter! :-) Cheers! -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 20:59 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit Ok, so the Dojo script needs to pass some data to the action, and that data is the one that comes from the first request right? musachy On Mon, Feb 9, 2009 at 2:54 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Almost. I have a page that has a form, and that submits (Post method) to a an action that has JSP page as result containing a DOJO script calling an action that returns a JSON result. It is a search form where the user provides information and the result shall be presented on another page. But I want JSON result back so that I can handle the search result with Ajax using Dojo. E.g. removing results based on filtering done by the user. Cheers! -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 20:44 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit So you have a page that has a form, and that submits to an action that returns JSON? What is the message that you are talking about? Posting a section of the JSP would also help. musachy On Mon, Feb 9, 2009 at 2:31 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Hello everyone, Anyone know how to pass post message information from an action containing a form to an action returning JSON result via an JSP page with a DOJO script calling the JSON result action? Please see example below. I am loosing the post message on the way. One solution could be to get the post message parameters from the value stack and then pass them into the DOJO script, but this sounds like a non-Struts way to me. In the book Practical Apache Struts2 Web 2.0 projects written by Ian Roughley (Great book by the way!), chapter 10, there is an example without passing information into the action. I have based my solution on this example but cannot get it to work properly. package name=products namespace=/products extends=struts-default !-- ProductSearch Action -- action name=productSearch class=com.demand.product.ProductSearch result/jsp/product/productSearch.jsp/result /action !-- ProductSearchResult Action -- action name=productSearchResult class=com.demand.product.BaseProductAction result name=input/jsp/product/productSearch.jsp/result result/jsp/product/productSearchJsonResult.jsp/result /action /package package name=jsonProducts namespace=/json/products extends=json-default default-interceptor-ref name=json/ action name=productsJsonResult class=com.demand.product.ProductSearchResults result type=json param name=rootproducts/param /result /action /package Cheers! - Christer Gjerstad -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey
SV: Problem with JSON Result and Form Submit
Great! This sounds better than what I have done so far! I will try that ASAP. Thank you very much! Kind regards Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 21:25 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit There are a lots of different ways of doing that. What I would do is: 1. add a field for the first action wit getters and setters for the params 2. in the jsp do something like: script var param1 = s:property value=''param1' escapeJavaScript='true'/; var param2 = s:property value=''param2' escapeJavaScript='true'/; /script 3. Call the second action passing the params to Dojo like: { 'param1': param1, 'param2' : param2} Dojo accepts a map that it serializes into a query string (if it is GET request). I forgot the dojo method signatures, google it up :). This way you can avoid building the query string yourself, which is always error prone. musachy On Mon, Feb 9, 2009 at 3:15 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Yes, correct. :-) So my question is; is that the way to do it? With the Dojo script that is, passing the data into the action? Will not the params interceptor handle this? What I've done so far is to make another action class implementing the ParameterAware interface so that I will get the incoming parameters. I then create and return a querystring and get this from the value stack in the page containing the Dojo script. I can then (hopefully) pass the information retrieved into the action returning the JSON result. This I will do with dojo.xhrPost and set the optional postData. Not solved this at the moment, but working on it. Seems like my solution is not that trivial so I would appreciate any help in this matter! :-) Cheers! -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 20:59 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit Ok, so the Dojo script needs to pass some data to the action, and that data is the one that comes from the first request right? musachy On Mon, Feb 9, 2009 at 2:54 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Almost. I have a page that has a form, and that submits (Post method) to a an action that has JSP page as result containing a DOJO script calling an action that returns a JSON result. It is a search form where the user provides information and the result shall be presented on another page. But I want JSON result back so that I can handle the search result with Ajax using Dojo. E.g. removing results based on filtering done by the user. Cheers! -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 20:44 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit So you have a page that has a form, and that submits to an action that returns JSON? What is the message that you are talking about? Posting a section of the JSP would also help. musachy On Mon, Feb 9, 2009 at 2:31 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Hello everyone, Anyone know how to pass post message information from an action containing a form to an action returning JSON result via an JSP page with a DOJO script calling the JSON result action? Please see example below. I am loosing the post message on the way. One solution could be to get the post message parameters from the value stack and then pass them into the DOJO script, but this sounds like a non-Struts way to me. In the book Practical Apache Struts2 Web 2.0 projects written by Ian Roughley (Great book by the way!), chapter 10, there is an example without passing information into the action. I have based my solution on this example but cannot get it to work properly. package name=products namespace=/products extends=struts-default !-- ProductSearch Action -- action name=productSearch class=com.demand.product.ProductSearch result/jsp/product/productSearch.jsp/result /action !-- ProductSearchResult Action -- action name=productSearchResult class=com.demand.product.BaseProductAction result name=input/jsp/product/productSearch.jsp/result result/jsp/product/productSearchJsonResult.jsp/result /action /package package name=jsonProducts namespace=/json/products extends=json-default default-interceptor-ref name=json/ action name=productsJsonResult class=com.demand.product.ProductSearchResults result type=json param name=rootproducts/param /result /action /package Cheers! - Christer Gjerstad -- Hey you! Would you help me to carry the stone? Pink Floyd
Re: Problem with JSON Result and Form Submit
I forgot to say, escapeJavaScript is available on 2.1 only. If you are using 2.0, there is a similar method (actually the original one) in commons lang StringEscapeUtils. musachy On Mon, Feb 9, 2009 at 3:33 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Great! This sounds better than what I have done so far! I will try that ASAP. Thank you very much! Kind regards Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 21:25 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit There are a lots of different ways of doing that. What I would do is: 1. add a field for the first action wit getters and setters for the params 2. in the jsp do something like: script var param1 = s:property value=''param1' escapeJavaScript='true'/; var param2 = s:property value=''param2' escapeJavaScript='true'/; /script 3. Call the second action passing the params to Dojo like: { 'param1': param1, 'param2' : param2} Dojo accepts a map that it serializes into a query string (if it is GET request). I forgot the dojo method signatures, google it up :). This way you can avoid building the query string yourself, which is always error prone. musachy On Mon, Feb 9, 2009 at 3:15 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Yes, correct. :-) So my question is; is that the way to do it? With the Dojo script that is, passing the data into the action? Will not the params interceptor handle this? What I've done so far is to make another action class implementing the ParameterAware interface so that I will get the incoming parameters. I then create and return a querystring and get this from the value stack in the page containing the Dojo script. I can then (hopefully) pass the information retrieved into the action returning the JSON result. This I will do with dojo.xhrPost and set the optional postData. Not solved this at the moment, but working on it. Seems like my solution is not that trivial so I would appreciate any help in this matter! :-) Cheers! -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 20:59 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit Ok, so the Dojo script needs to pass some data to the action, and that data is the one that comes from the first request right? musachy On Mon, Feb 9, 2009 at 2:54 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Almost. I have a page that has a form, and that submits (Post method) to a an action that has JSP page as result containing a DOJO script calling an action that returns a JSON result. It is a search form where the user provides information and the result shall be presented on another page. But I want JSON result back so that I can handle the search result with Ajax using Dojo. E.g. removing results based on filtering done by the user. Cheers! -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 20:44 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit So you have a page that has a form, and that submits to an action that returns JSON? What is the message that you are talking about? Posting a section of the JSP would also help. musachy On Mon, Feb 9, 2009 at 2:31 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Hello everyone, Anyone know how to pass post message information from an action containing a form to an action returning JSON result via an JSP page with a DOJO script calling the JSON result action? Please see example below. I am loosing the post message on the way. One solution could be to get the post message parameters from the value stack and then pass them into the DOJO script, but this sounds like a non-Struts way to me. In the book Practical Apache Struts2 Web 2.0 projects written by Ian Roughley (Great book by the way!), chapter 10, there is an example without passing information into the action. I have based my solution on this example but cannot get it to work properly. package name=products namespace=/products extends=struts-default !-- ProductSearch Action -- action name=productSearch class=com.demand.product.ProductSearch result/jsp/product/productSearch.jsp/result /action !-- ProductSearchResult Action -- action name=productSearchResult class=com.demand.product.BaseProductAction result name=input/jsp/product/productSearch.jsp/result result/jsp/product/productSearchJsonResult.jsp/result /action /package package name=jsonProducts namespace=/json/products extends=json-default default-interceptor-ref name=json/ action name=productsJsonResult class=com.demand.product.ProductSearchResults result type=json
2.0.14 - 2.1.6 filter config issue
I'm trying to migrate from 2.0.14 to 2.1.6 and am getting the following error in my console preventing my app from starting: Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts2 java.lang.NullPointerException at com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) at com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(FileManager.java:60) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.needsReload(XmlConfigurationProvider.java:325) at org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(StrutsXmlConfigurationProvider.java:168) at com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(ConfigurationManager.java:220) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:61) at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:774) at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:191) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext start SEVERE: Error filterStart Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/WebDocs] startup failed due to previous errors My web.xml contains these lines referring to the filter struts2: filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping Has something changed in the filter configuration that would prevent startup? -- View this message in context: http://www.nabble.com/2.0.14--%3E-2.1.6-filter-config-issue-tp21921487p21921487.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: 2.0.14 - 2.1.6 filter config issue
It is a known problem in xwork: https://issues.apache.org/struts/browse/WW-2956 setting devMode to false would prevent it. musachy On Mon, Feb 9, 2009 at 3:41 PM, ryangr grigg...@gmail.com wrote: I'm trying to migrate from 2.0.14 to 2.1.6 and am getting the following error in my console preventing my app from starting: Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts2 java.lang.NullPointerException at com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) at com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(FileManager.java:60) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.needsReload(XmlConfigurationProvider.java:325) at org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(StrutsXmlConfigurationProvider.java:168) at com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(ConfigurationManager.java:220) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:61) at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:774) at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:191) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext start SEVERE: Error filterStart Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/WebDocs] startup failed due to previous errors My web.xml contains these lines referring to the filter struts2: filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping Has something changed in the filter configuration that would prevent startup? -- View this message in context: http://www.nabble.com/2.0.14--%3E-2.1.6-filter-config-issue-tp21921487p21921487.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2 Portlet Validation Problems
This should be handled by the default portlet interceptor stack. If it doesn't, it's a bug... Nils-H On Mon, Feb 9, 2009 at 8:19 PM, Musachy Barroso musa...@gmail.com wrote: Messages will be lost if a redirectAction is used, unless the MessageStoreInterceptor is used, or is that different in portlets Nils? musachy On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen dean.pul...@msp-uk.com wrote: I can confirm that using validation xml instead of annotations does exactly the same thing. i.e. a forward to a JSP will display the messages, a redirectAction type result will 'lose' the messages during the dispatch. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 18:07 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Yeah, you're right... It's not using annotations. Have you tried with xml validation? It's not a solution, but at least it will narrow down the problem. Nils-H On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Nils-H, Thanks for the reply. I've looked at them - none of them actually use the annotations as such. It's definitely not working with or without MessageStoreInterceptor when you utilise a redirect - it's absolutely fine if you simply replace the redirect with a simple JSP result. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 17:57 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal 2.7.1 and Struts 2.1.6. It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags: s:actionerror / s:fielderror / We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set. For example this is the view, which is the input of the edit action: action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action This is the edit action: action name=ItemEdit class=com.msp.portlets. ItemAction method=itemEdit interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param param name=itemId${itemId}/param /result result type=redirectAction name=input param name=actionName ItemView /param /result /action Does anyone know what the problem could be? Thanks in advance. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Scanned by MailDefender - managed email security from intY - www.maildefender.net - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Scanned by
Re: Struts 2 Portlet Validation Problems
That should not be necessary. Could you please register a JIRA issue, and if possible, a simple app that can reproduce the issue? Thanks. Nils-H On Mon, Feb 9, 2009 at 9:09 PM, Dean Pullen dean.pul...@msp-uk.com wrote: It's a bit odd, but I seem to have got it working finally. I've set the messageStoreInterceptor before the portletDefaultStack. This threw an error about ItemView that having an input result - a bit odd considering it's the ItemEdit that needs the input result. I added this, and it magically works. Not sure this is the behaviour we'd expect, or even want - but it certainly seems to work. I also added a param name=title${title}/param, for each relevant param, to the input redirectAction to ensure the user's input was not lost during the failed validation redirect. -Original Message- From: Dean Pullen [mailto:dean.pul...@msp-uk.com] Sent: 09 February 2009 19:31 To: Struts Users Mailing List Subject: RE: Struts 2 Portlet Validation Problems I've tried, and reverted back for now, to using the MessageStoreInterceptor with no success, the messages are still lost. We've successfully used the MessageStoreInterceptor on non-portlet applications. Annoyingly, anything you input on the form is also lost, which will cause much chagrin for end-users. E.g. action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action action name=ItemEdit class=com.msp.portlets.ItemAction method=editItem interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param /result result type=redirectAction name=input param name=actionNameItemView/param /result /action Dean. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: 09 February 2009 19:19 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Messages will be lost if a redirectAction is used, unless the MessageStoreInterceptor is used, or is that different in portlets Nils? musachy On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen dean.pul...@msp-uk.com wrote: I can confirm that using validation xml instead of annotations does exactly the same thing. i.e. a forward to a JSP will display the messages, a redirectAction type result will 'lose' the messages during the dispatch. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 18:07 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Yeah, you're right... It's not using annotations. Have you tried with xml validation? It's not a solution, but at least it will narrow down the problem. Nils-H On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Nils-H, Thanks for the reply. I've looked at them - none of them actually use the annotations as such. It's definitely not working with or without MessageStoreInterceptor when you utilise a redirect - it's absolutely fine if you simply replace the redirect with a simple JSP result. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 17:57 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal 2.7.1 and Struts 2.1.6. It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags: s:actionerror / s:fielderror / We're utilising the portletDefaultStack and our Portlet package is extending
Re: Struts 2 Portlet Validation Problems
You can reopen the one I closed, and add any extra info you found. musachy On Mon, Feb 9, 2009 at 3:49 PM, Nils-Helge Garli Hegvik nil...@gmail.com wrote: That should not be necessary. Could you please register a JIRA issue, and if possible, a simple app that can reproduce the issue? Thanks. Nils-H On Mon, Feb 9, 2009 at 9:09 PM, Dean Pullen dean.pul...@msp-uk.com wrote: It's a bit odd, but I seem to have got it working finally. I've set the messageStoreInterceptor before the portletDefaultStack. This threw an error about ItemView that having an input result - a bit odd considering it's the ItemEdit that needs the input result. I added this, and it magically works. Not sure this is the behaviour we'd expect, or even want - but it certainly seems to work. I also added a param name=title${title}/param, for each relevant param, to the input redirectAction to ensure the user's input was not lost during the failed validation redirect. -Original Message- From: Dean Pullen [mailto:dean.pul...@msp-uk.com] Sent: 09 February 2009 19:31 To: Struts Users Mailing List Subject: RE: Struts 2 Portlet Validation Problems I've tried, and reverted back for now, to using the MessageStoreInterceptor with no success, the messages are still lost. We've successfully used the MessageStoreInterceptor on non-portlet applications. Annoyingly, anything you input on the form is also lost, which will cause much chagrin for end-users. E.g. action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action action name=ItemEdit class=com.msp.portlets.ItemAction method=editItem interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param /result result type=redirectAction name=input param name=actionNameItemView/param /result /action Dean. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: 09 February 2009 19:19 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Messages will be lost if a redirectAction is used, unless the MessageStoreInterceptor is used, or is that different in portlets Nils? musachy On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen dean.pul...@msp-uk.com wrote: I can confirm that using validation xml instead of annotations does exactly the same thing. i.e. a forward to a JSP will display the messages, a redirectAction type result will 'lose' the messages during the dispatch. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 18:07 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Yeah, you're right... It's not using annotations. Have you tried with xml validation? It's not a solution, but at least it will narrow down the problem. Nils-H On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Nils-H, Thanks for the reply. I've looked at them - none of them actually use the annotations as such. It's definitely not working with or without MessageStoreInterceptor when you utilise a redirect - it's absolutely fine if you simply replace the redirect with a simple JSP result. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 17:57 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal 2.7.1 and Struts 2.1.6. It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the
SV: Problem with JSON Result and Form Submit
No worries. I have been using 2.1 since the beta was released. But thanks anyway, and thanks again for the help! :-) -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 21:38 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit I forgot to say, escapeJavaScript is available on 2.1 only. If you are using 2.0, there is a similar method (actually the original one) in commons lang StringEscapeUtils. musachy On Mon, Feb 9, 2009 at 3:33 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Great! This sounds better than what I have done so far! I will try that ASAP. Thank you very much! Kind regards Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 21:25 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit There are a lots of different ways of doing that. What I would do is: 1. add a field for the first action wit getters and setters for the params 2. in the jsp do something like: script var param1 = s:property value=''param1' escapeJavaScript='true'/; var param2 = s:property value=''param2' escapeJavaScript='true'/; /script 3. Call the second action passing the params to Dojo like: { 'param1': param1, 'param2' : param2} Dojo accepts a map that it serializes into a query string (if it is GET request). I forgot the dojo method signatures, google it up :). This way you can avoid building the query string yourself, which is always error prone. musachy On Mon, Feb 9, 2009 at 3:15 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Yes, correct. :-) So my question is; is that the way to do it? With the Dojo script that is, passing the data into the action? Will not the params interceptor handle this? What I've done so far is to make another action class implementing the ParameterAware interface so that I will get the incoming parameters. I then create and return a querystring and get this from the value stack in the page containing the Dojo script. I can then (hopefully) pass the information retrieved into the action returning the JSON result. This I will do with dojo.xhrPost and set the optional postData. Not solved this at the moment, but working on it. Seems like my solution is not that trivial so I would appreciate any help in this matter! :-) Cheers! -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 20:59 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit Ok, so the Dojo script needs to pass some data to the action, and that data is the one that comes from the first request right? musachy On Mon, Feb 9, 2009 at 2:54 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Almost. I have a page that has a form, and that submits (Post method) to a an action that has JSP page as result containing a DOJO script calling an action that returns a JSON result. It is a search form where the user provides information and the result shall be presented on another page. But I want JSON result back so that I can handle the search result with Ajax using Dojo. E.g. removing results based on filtering done by the user. Cheers! -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 20:44 Til: Struts Users Mailing List Emne: Re: Problem with JSON Result and Form Submit So you have a page that has a form, and that submits to an action that returns JSON? What is the message that you are talking about? Posting a section of the JSP would also help. musachy On Mon, Feb 9, 2009 at 2:31 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Hello everyone, Anyone know how to pass post message information from an action containing a form to an action returning JSON result via an JSP page with a DOJO script calling the JSON result action? Please see example below. I am loosing the post message on the way. One solution could be to get the post message parameters from the value stack and then pass them into the DOJO script, but this sounds like a non-Struts way to me. In the book Practical Apache Struts2 Web 2.0 projects written by Ian Roughley (Great book by the way!), chapter 10, there is an example without passing information into the action. I have based my solution on this example but cannot get it to work properly. package name=products namespace=/products extends=struts-default !-- ProductSearch Action -- action name=productSearch class=com.demand.product.ProductSearch result/jsp/product/productSearch.jsp/result /action !-- ProductSearchResult Action -- action name=productSearchResult class=com.demand.product.BaseProductAction result
Re: 2.0.14 - 2.1.6 filter config issue
I set devMode to false and the same issue still occurs, even after clearing the Tomcat work directory and caches. Can anything else be done about it or am I just going to have to downgrade back to 2.0.14 until the Xwork issue is fixed? Thanks, Ryan Musachy Barroso wrote: It is a known problem in xwork: https://issues.apache.org/struts/browse/WW-2956 setting devMode to false would prevent it. musachy On Mon, Feb 9, 2009 at 3:41 PM, ryangr grigg...@gmail.com wrote: I'm trying to migrate from 2.0.14 to 2.1.6 and am getting the following error in my console preventing my app from starting: Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts2 java.lang.NullPointerException at com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) at com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(FileManager.java:60) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.needsReload(XmlConfigurationProvider.java:325) at org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(StrutsXmlConfigurationProvider.java:168) at com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(ConfigurationManager.java:220) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:61) at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:774) at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:191) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext start SEVERE: Error filterStart Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/WebDocs] startup failed due to previous errors My web.xml contains these lines referring to the filter struts2: filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping Has something changed in the filter configuration that would prevent startup? -- View this message in context: http://www.nabble.com/2.0.14--%3E-2.1.6-filter-config-issue-tp21921487p21921487.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/2.0.14--%3E-2.1.6-filter-config-issue-tp21921487p21921721.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: 2.0.14 - 2.1.6 filter config issue
The issue was fixed in xwork trunk, you can build it yourself, or use a snapshot. musachy On Mon, Feb 9, 2009 at 3:53 PM, ryangr grigg...@gmail.com wrote: I set devMode to false and the same issue still occurs, even after clearing the Tomcat work directory and caches. Can anything else be done about it or am I just going to have to downgrade back to 2.0.14 until the Xwork issue is fixed? Thanks, Ryan Musachy Barroso wrote: It is a known problem in xwork: https://issues.apache.org/struts/browse/WW-2956 setting devMode to false would prevent it. musachy On Mon, Feb 9, 2009 at 3:41 PM, ryangr grigg...@gmail.com wrote: I'm trying to migrate from 2.0.14 to 2.1.6 and am getting the following error in my console preventing my app from starting: Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts2 java.lang.NullPointerException at com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) at com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(FileManager.java:60) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.needsReload(XmlConfigurationProvider.java:325) at org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(StrutsXmlConfigurationProvider.java:168) at com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(ConfigurationManager.java:220) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:61) at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:774) at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:191) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext start SEVERE: Error filterStart Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/WebDocs] startup failed due to previous errors My web.xml contains these lines referring to the filter struts2: filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping Has something changed in the filter configuration that would prevent startup? -- View this message in context: http://www.nabble.com/2.0.14--%3E-2.1.6-filter-config-issue-tp21921487p21921487.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/2.0.14--%3E-2.1.6-filter-config-issue-tp21921487p21921721.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd
Cookie Intercepter configuration
Struts 2.1.6 on Glassfish 9.1_02 I am trying to configure the cookie intercepter, but it looks like I am missing something. I have the following in my struts.xml: default-interceptor-ref name=paramsPrepareParamsStack/ action name=/soldier/view class=mil.army.usaac.conap.soldier.ViewAction interceptor-ref name=cookie param name=cookiesName*/param param name=cookiesValue*/param /interceptor-ref /action My server errors when I try to deploy the webapp. [#|2009-02-09T15:42:34.727-0500|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=17;_ThreadName=httpWorkerThread-4848-2;_RequestID=17f40931-feed-453a-902a-f45c6313df0d;|WebModule[/conap]PWC1270: Exception starting filter struts2 Unable to load configuration. - interceptor-ref - file:/C:/dev/sun/sjas9_1_u2/domains/domain1/applications/j2ee-modules/conap/WEB-INF/classes/struts.xml:17:44 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58) Norris Shelton Software Engineer Sun Certified Java 1.1 Programmer Shelton Consulting, LLC ICQ# 26487421 AIM NorrisEShelton YIM norrisshelton
Re: actionError id parameter
That would be a bug: https://issues.apache.org/struts/browse/WW-2988 I will fix it soon in trunk. You can always overwrite the template and add that attribute. musachy On Mon, Feb 9, 2009 at 11:32 AM, Ddlc revenan...@hotmail.com wrote: I see that there is an id parameter for the actionError tag. The name suggest that it should add an id attribute to the ul tag that the result generates, but this is not the case. Is there a way to add an id attribute to the HTML element the actionError tag generates? Thank you very much. -- View this message in context: http://www.nabble.com/actionError-id-parameter-tp21916434p21916434.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts 2 Portlet Validation Problems
No problem, will do - in the morning! Thanks. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: 09 February 2009 20:51 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems You can reopen the one I closed, and add any extra info you found. musachy On Mon, Feb 9, 2009 at 3:49 PM, Nils-Helge Garli Hegvik nil...@gmail.com wrote: That should not be necessary. Could you please register a JIRA issue, and if possible, a simple app that can reproduce the issue? Thanks. Nils-H On Mon, Feb 9, 2009 at 9:09 PM, Dean Pullen dean.pul...@msp-uk.com wrote: It's a bit odd, but I seem to have got it working finally. I've set the messageStoreInterceptor before the portletDefaultStack. This threw an error about ItemView that having an input result - a bit odd considering it's the ItemEdit that needs the input result. I added this, and it magically works. Not sure this is the behaviour we'd expect, or even want - but it certainly seems to work. I also added a param name=title${title}/param, for each relevant param, to the input redirectAction to ensure the user's input was not lost during the failed validation redirect. -Original Message- From: Dean Pullen [mailto:dean.pul...@msp-uk.com] Sent: 09 February 2009 19:31 To: Struts Users Mailing List Subject: RE: Struts 2 Portlet Validation Problems I've tried, and reverted back for now, to using the MessageStoreInterceptor with no success, the messages are still lost. We've successfully used the MessageStoreInterceptor on non-portlet applications. Annoyingly, anything you input on the form is also lost, which will cause much chagrin for end-users. E.g. action name=ItemView class=com.msp.portlets.ItemAction interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeRETRIEVE/param /interceptor-ref result/WEB-INF/jsp/welcome/admin/item.jsp/result /action action name=ItemEdit class=com.msp.portlets.ItemAction method=editItem interceptor-ref name=portletDefaultStack/ interceptor-ref name=messageStoreInterceptor param name=operationModeSTORE/param /interceptor-ref result type=redirectAction name=success param name=actionNameItemView/param /result result type=redirectAction name=input param name=actionNameItemView/param /result /action Dean. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: 09 February 2009 19:19 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Messages will be lost if a redirectAction is used, unless the MessageStoreInterceptor is used, or is that different in portlets Nils? musachy On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen dean.pul...@msp-uk.com wrote: I can confirm that using validation xml instead of annotations does exactly the same thing. i.e. a forward to a JSP will display the messages, a redirectAction type result will 'lose' the messages during the dispatch. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 18:07 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Yeah, you're right... It's not using annotations. Have you tried with xml validation? It's not a solution, but at least it will narrow down the problem. Nils-H On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Nils-H, Thanks for the reply. I've looked at them - none of them actually use the annotations as such. It's definitely not working with or without MessageStoreInterceptor when you utilise a redirect - it's absolutely fine if you simply replace the redirect with a simple JSP result. Dean. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 17:57 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input
Re: Cookie Intercepter configuration
There should be a more meaningful exception down there in the log, can you post the whole stack trace? musachy On Mon, Feb 9, 2009 at 4:38 PM, Norris Shelton norrisshel...@yahoo.com wrote: Struts 2.1.6 on Glassfish 9.1_02 I am trying to configure the cookie intercepter, but it looks like I am missing something. I have the following in my struts.xml: default-interceptor-ref name=paramsPrepareParamsStack/ action name=/soldier/view class=mil.army.usaac.conap.soldier.ViewAction interceptor-ref name=cookie param name=cookiesName*/param param name=cookiesValue*/param /interceptor-ref /action My server errors when I try to deploy the webapp. [#|2009-02-09T15:42:34.727-0500|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=17;_ThreadName=httpWorkerThread-4848-2;_RequestID=17f40931-feed-453a-902a-f45c6313df0d;|WebModule[/conap]PWC1270: Exception starting filter struts2 Unable to load configuration. - interceptor-ref - file:/C:/dev/sun/sjas9_1_u2/domains/domain1/applications/j2ee-modules/conap/WEB-INF/classes/struts.xml:17:44 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58) Norris Shelton Software Engineer Sun Certified Java 1.1 Programmer Shelton Consulting, LLC ICQ# 26487421 AIM NorrisEShelton YIM norrisshelton -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: actionError id parameter
Thank you very much Musachy :) -- View this message in context: http://www.nabble.com/actionError-id-parameter-tp21916434p21923699.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Nested iterator struts 2.1.6 -- automatically rebuild the collection
Hi, Using s:iterator .. tag, how do you instruct struts to rebuild the collection automatically? I have a List of List of Sample objects I use s:iterator tag to loop through and display data for user to make changes The displaying part is OK; however, when the form is submitted, the List of List of Sample objects is not populated. In Struts 1.x, the tag logic:iterator was used and if we add indexed=true for each element inside the logic:iterator tag, Struts automatically rebuild the collection. Is there a way that it can accomplish with s:iterator? Thank you. Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.
Re: Struts 2 file upload
Lund wrote: I'm using Strurs 2.1.2 and the s:file name=upload label=File / tag in the jsp page. My problem is that while the fileUpload appears to work most of the time I do get java.io.FileNotFoundException: on the .tmp file that Struts uses as part of the process (prob 1 in 10 times). Once this happens of course the whole process breaks down. I boiled the whole process down to a simple test action and tested it repeatedly and also checked if anyone else had this issue. It appears that this issue was fixed as of 2.0.9 release but I am still seeing it. I'm using commons-fileupload-1.2.1 and commons-io.1.3.2 Any ideas before I abandon struts 2 fileupload? Does the same thing happened with an actual release version of S2.1? Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Cookie Intercepter configuration
Norris Shelton wrote: Struts 2.1.6 on Glassfish 9.1_02 I am trying to configure the cookie intercepter, but it looks like I am missing something. I have the following in my struts.xml: default-interceptor-ref name=paramsPrepareParamsStack/ action name=/soldier/view class=mil.army.usaac.conap.soldier.ViewAction interceptor-ref name=cookie param name=cookiesName*/param param name=cookiesValue*/param /interceptor-ref /action Also be aware that you've configured *only* the cookie interceptor for that particular action--that may be what you intended. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Hiding s:select control
Hello all, I'm using Struts2 on Tomcat and am trying to hide a s:select tag depending on the selected option of another s:select tag. I'm able to disable the tag using javascript but am not able to hide it. Setting style.display=none; does not work, neither does adding a div tag because Struts writes its own trtd's and the div tag is placed somewhere else. Is there a way to do this? Could struts be told not to create tr and td fields? Any help is much appreciated. Thanks, Rajeshwari
Re: Struts 2 Portlet Validation Problems
Am Montag, 9. Februar 2009 21:48:33 schrieb Nils-Helge Garli Hegvik: This should be handled by the default portlet interceptor stack. If it doesn't, it's a bug... Its a bug i guess, i need to use a Message Store Interceptor too, because using PRG in portlets i lost my messages and errors always (can't remember that this worked once and i didn't know that this should have had to work ;-)). Torsten -- Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge. Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. -- Linus Torvalds smime.p7s Description: S/MIME cryptographic signature
Struts2.1.6 Tiles 2.1.1
hi, I am trying to integrate Struts2.1.6 with tiles2.1.1. When I click on the login link,I am getting Unable to find the definitionwarning Message in my logs.Any help on this issue will be appreciated. Thanks, Aarthy -- View this message in context: http://www.nabble.com/Struts2.1.6---Tiles-2.1.1-tp21928113p21928113.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Hiding s:select control
Hi Rajeshwari, it has nothing to do with struts2, use javascript for it, also setting html id property for your selects might help. Best greetings, Paweł Wielgus. 2009/2/10 Rajeshwari Godbole rgodb...@gmail.com: Hello all, I'm using Struts2 on Tomcat and am trying to hide a s:select tag depending on the selected option of another s:select tag. I'm able to disable the tag using javascript but am not able to hide it. Setting style.display=none; does not work, neither does adding a div tag because Struts writes its own trtd's and the div tag is placed somewhere else. Is there a way to do this? Could struts be told not to create tr and td fields? Any help is much appreciated. Thanks, Rajeshwari - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org