action mapping 'input' question
I guess it's simple, but why can't I put an action /MyAction.do in the 'input' field in a action-mapping in the struts-config.xml? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: action mapping 'input' question
You can but have to account for the state the form associated with /MyAction.do. Before I try to suggest a solution can you please tell us specifically what problem you are experiencing? -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 9:46 AM To: 'Struts Users Mailing List' Subject: action mapping 'input' question I guess it's simple, but why can't I put an action /MyAction.do in the 'input' field in a action-mapping in the struts-config.xml? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: action mapping 'input' question
I am using struts/tiles/validator in my application. Using the following configuration works fine, still I see that on the first invocation the form gets validated and I get validation errors. My ForgotPasswordAction action is used both for the INIT and the SUBMIT operations. The only solution I read about is putting 'validate'=false and control the invocation of the super.validate() in my code. Is this true? action name=ForgotPasswordForm type=web.ForgotPasswordAction validate=true input=.forgotPassword scope=request path=/ForgotPassword forward name=show path=.forgotPassword redirect=false / /action If I use the following: action name=ForgotPasswordForm type=web.ForgotPasswordAction validate=true input=/ForgotPassword.do scope=request path=/ForgotPassword forward name=show path=.forgotPassword redirect=false / /action Then I get the following error: (now it's endless... really so sorry :) javax.servlet.ServletException: Servlet execution threw an exception at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:19 9) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja va:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 5) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:59 4) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:56 5) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:619) at java.lang.Thread.run(Thread.java:536) root cause java.lang.StackOverflowError at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(Application HttpRequest.java:247) at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(Application HttpRequest.java:250) at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(Application HttpRequest.java:250) at
RE: action mapping 'input' question
Unless validation suceeds, this looks like an infinite loop to me: input=/ForgotPassword.do path=/ForgotPassword m --- Erez Efrati [EMAIL PROTECTED] wrote: I am using struts/tiles/validator in my application. Using the following configuration works fine, still I see that on the first invocation the form gets validated and I get validation errors. My ForgotPasswordAction action is used both for the INIT and the SUBMIT operations. The only solution I read about is putting 'validate'=false and control the invocation of the super.validate() in my code. Is this true? action name=ForgotPasswordForm type=web.ForgotPasswordAction validate=true input=.forgotPassword scope=request path=/ForgotPassword forward name=show path=.forgotPassword redirect=false / /action If I use the following: action name=ForgotPasswordForm type=web.ForgotPasswordAction validate=true input=/ForgotPassword.do scope=request path=/ForgotPassword forward name=show path=.forgotPassword redirect=false / /action Then I get the following error: (now it's endless... really so sorry :) javax.servlet.ServletException: Servlet execution threw an exception at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:19 9) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja va:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 5) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:59 4) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:56 5) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:619) at java.lang.Thread.run(Thread.java:536) root cause java.lang.StackOverflowError at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(Application HttpRequest.java:247) at
RE: action mapping input
Okay, I misunderstood what John was saying and this is what I have: 1) forward failure is NOT the same as input which is required if validate=true 2) input CAN forward to a tiles definition. I looked at the original post and realized that it was pretty ambiguous. what i wanted to do (and it was successful) was: action path=/siteSelect type=SiteSelectAction name=siteSelectForm validate=true scope=request input=site.select.page forward name=success path=site.select.global/ /action where site.select.page was a tiles definition. Thanks, -Tim -Original Message- From: Chen, Gin [mailto:Gin_Chen;tvratings.com] Sent: Friday, October 18, 2002 3:19 PM To: 'Struts Users Mailing List' Subject: RE: action mapping input Okay, just to get this straight. So I define a failure forward and it will behave the same as validation error following the input tag? No additional coding required? Also, the reason that I wanted to use the input tag instead of another forward is that I want to use the 1.1b2 method getInputForward(). It would almost make sense that with the inclusion of this new method, the intent was for it to behave as if it were looking up a forward or global. No? -Tim -Original Message- From: John Nicholas [mailto:jakarta;mobosplash.com] Sent: Friday, October 18, 2002 2:45 PM To: Struts Users Mailing List Subject: Re: action mapping input Chen, Gin wrote: Hi all, I'm still new to struts and I cant find this in the documentation but, lets say that you have one of the struts-config from the docs. global-forwards type=org.apache.struts.action.ActionForward/ forward name=logon path=/logon.jsp redirect=false / /global-forwards action-mappings action path=/logon type=org.apache.struts.example.LogonAction name=logonForm scope=request input=/logon.jsp unknown=false validate=true / /action-mappings Rather than have input=/logon.jsp as in the snip can you have input=logon and have it use the path from the global-forwards? It just seems like it would make more sense since that means that you only have to change one location in case the location of the file ever has to change. The input attribute is used when validation of the form bean fails. if the validation in the form bean (or the validator) fails the action is never run so it couldn't use the forward. The controller is returning you to the input page. If a validation in the action fails (like a business logic failure)then you can use a failure forward. John Nicholas -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
action mapping input
Hi all, I'm still new to struts and I cant find this in the documentation but, lets say that you have one of the struts-config from the docs. global-forwards type=org.apache.struts.action.ActionForward/ forward name=logon path=/logon.jsp redirect=false / /global-forwards action-mappings action path=/logon type=org.apache.struts.example.LogonAction name=logonForm scope=request input=/logon.jsp unknown=false validate=true / /action-mappings Rather than have input=/logon.jsp as in the snip can you have input=logon and have it use the path from the global-forwards? It just seems like it would make more sense since that means that you only have to change one location in case the location of the file ever has to change. Thanks, -Tim -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Wednesday, October 09, 2002 1:25 PM To: Struts Users Mailing List Subject: Re: Avoid Heavy Use of Logic Tags ??? ... and now that we have the JSTL you can have your tags optimized into actual code. It's my understanding, for example, that a forEach tag would be translated into an actual while (or was it for ... anyway, you get the point). So, you're bypassing the tag-usage overhead some. Hopefully Martin will see this and elaborate (and correct me if I'm wrong). I believe that's fairly close though ... Of course - not all of us are on containers that even support the JSTL ... but some of us are :-) Robert wrote: I think that statement Using custom tags for logic provides little benefit... is bit vague. I would say that custom tags the do PRESENTATION logic are of benefit, e.g. iterators, formatting, html controls, etc. all fit into that category for me. You are right, you have to do it somehow, where otherwise you end up with just static HTML right? I'm not sure why he would say that XML syntax is more difficult to maintain than other types. That is probably more of an 'eye of the beholder' issue. If you have web developers that are unfamiliar with Java, then the XML syntax is probably easier than a bunch of scriptlets, no? Personally I think it is a lot easier to read than other dynamic page systems (ASP, PHP, etc.), but that is just me. - Robert -- Eddie Bush -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: action mapping input
Chen, Gin wrote: Hi all, I'm still new to struts and I cant find this in the documentation but, lets say that you have one of the struts-config from the docs. global-forwards type=org.apache.struts.action.ActionForward/ forward name=logon path=/logon.jsp redirect=false / /global-forwards action-mappings action path=/logon type=org.apache.struts.example.LogonAction name=logonForm scope=request input=/logon.jsp unknown=false validate=true / /action-mappings Rather than have input=/logon.jsp as in the snip can you have input=logon and have it use the path from the global-forwards? It just seems like it would make more sense since that means that you only have to change one location in case the location of the file ever has to change. The input attribute is used when validation of the form bean fails. if the validation in the form bean (or the validator) fails the action is never run so it couldn't use the forward. The controller is returning you to the input page. If a validation in the action fails (like a business logic failure)then you can use a failure forward. John Nicholas -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: action mapping input
Okay, just to get this straight. So I define a failure forward and it will behave the same as validation error following the input tag? No additional coding required? Also, the reason that I wanted to use the input tag instead of another forward is that I want to use the 1.1b2 method getInputForward(). It would almost make sense that with the inclusion of this new method, the intent was for it to behave as if it were looking up a forward or global. No? -Tim -Original Message- From: John Nicholas [mailto:jakarta;mobosplash.com] Sent: Friday, October 18, 2002 2:45 PM To: Struts Users Mailing List Subject: Re: action mapping input Chen, Gin wrote: Hi all, I'm still new to struts and I cant find this in the documentation but, lets say that you have one of the struts-config from the docs. global-forwards type=org.apache.struts.action.ActionForward/ forward name=logon path=/logon.jsp redirect=false / /global-forwards action-mappings action path=/logon type=org.apache.struts.example.LogonAction name=logonForm scope=request input=/logon.jsp unknown=false validate=true / /action-mappings Rather than have input=/logon.jsp as in the snip can you have input=logon and have it use the path from the global-forwards? It just seems like it would make more sense since that means that you only have to change one location in case the location of the file ever has to change. The input attribute is used when validation of the form bean fails. if the validation in the form bean (or the validator) fails the action is never run so it couldn't use the forward. The controller is returning you to the input page. If a validation in the action fails (like a business logic failure)then you can use a failure forward. John Nicholas -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: action mapping input
You can also leverage the input attribute in an action by returning the following from perform/execute: new ActionForward(mapping.getInput()) Quoting John Nicholas [EMAIL PROTECTED]: Chen, Gin wrote: Hi all, I'm still new to struts and I cant find this in the documentation but, lets say that you have one of the struts-config from the docs. global-forwards type=org.apache.struts.action.ActionForward/ forward name=logon path=/logon.jsp redirect=false / /global-forwards action-mappings action path=/logon type=org.apache.struts.example.LogonAction name=logonForm scope=request input=/logon.jsp unknown=false validate=true / /action-mappings Rather than have input=/logon.jsp as in the snip can you have input=logon and have it use the path from the global-forwards? It just seems like it would make more sense since that means that you only have to change one location in case the location of the file ever has to change. The input attribute is used when validation of the form bean fails. if the validation in the form bean (or the validator) fails the action is never run so it couldn't use the forward. The controller is returning you to the input page. If a validation in the action fails (like a business logic failure)then you can use a failure forward. John Nicholas -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- Kris Schneider mailto:kris;dotech.com D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: action mapping input
I haven't played much with 1.1, but here's a snippet from the 1.1 DTD about the controller element's inputForward attribute: inputForward Set to true if you want the input attribute of action elements to be the name of a local or global ActionForward, which will then be used to calculate the ultimate URL. Set to false (the default) to treat the input parameter of action elements as a module-relative path to the resource to be used as the input form. Since Struts 1.1. [false] So, it sounds like you can configure it to have the behavior you want. The attribute affects the way ActionMapping.getInputForward behaves. It's a small piece of code, so here it is: public ActionForward getInputForward() { if (getApplicationConfig().getControllerConfig().getInputForward()) { return (findForward(getInput())); } else { return (new ActionForward(getInput())); } } Quoting Chen, Gin [EMAIL PROTECTED]: Okay, just to get this straight. So I define a failure forward and it will behave the same as validation error following the input tag? No additional coding required? Also, the reason that I wanted to use the input tag instead of another forward is that I want to use the 1.1b2 method getInputForward(). It would almost make sense that with the inclusion of this new method, the intent was for it to behave as if it were looking up a forward or global. No? -Tim -Original Message- From: John Nicholas [mailto:jakarta;mobosplash.com] Sent: Friday, October 18, 2002 2:45 PM To: Struts Users Mailing List Subject: Re: action mapping input Chen, Gin wrote: Hi all, I'm still new to struts and I cant find this in the documentation but, lets say that you have one of the struts-config from the docs. global-forwards type=org.apache.struts.action.ActionForward/ forward name=logon path=/logon.jsp redirect=false / /global-forwards action-mappings action path=/logon type=org.apache.struts.example.LogonAction name=logonForm scope=request input=/logon.jsp unknown=false validate=true / /action-mappings Rather than have input=/logon.jsp as in the snip can you have input=logon and have it use the path from the global-forwards? It just seems like it would make more sense since that means that you only have to change one location in case the location of the file ever has to change. The input attribute is used when validation of the form bean fails. if the validation in the form bean (or the validator) fails the action is never run so it couldn't use the forward. The controller is returning you to the input page. If a validation in the action fails (like a business logic failure)then you can use a failure forward. John Nicholas -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- Kris Schneider mailto:kris;dotech.com D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
mapping-input
hi there, I want to validate my input, if there are any errors, i get a server-error mapping-input is null. How to do values come in the mapping-input, in my mapping-path, there is the correct path? hans _ Senden und empfangen Sie Hotmail über Ihr Mobilgerät: http://mobile.msn.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: mapping-input
I want to validate my input, if there are any errors, i get a server-error mapping-input is null. How to do values come in the mapping-input, in my mapping-path, there is the correct path? hans Without seeing your code it is hard to say for sure what the problem maybe. However, I think the message is saying your action mapping is missing the input parameter which specifies the input JSP. When you get validation errors the controller would like to display them on the input page for you. Without that mapping it can't. Or I could be wrong. /mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]