Re: client side validation in struts2
Try changing <%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld" %> to <%@ taglib prefix="s" uri="/struts-tags" %> Chris On Tue, 2011-02-15 at 06:38 -0800, dasariprasad wrote: > in clValid.jsp, i had used input page > <%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld" %> > > > Strut2's actions > > > > > Service Application > > > > > > > > > list="{'DrivingLicence','ElectricityBill', > 'WaterBill','InsurancePremium'}" > name="service" /> > > > > > > > in struts.xml > > extends="struts-default"> > > class="htcstruts.ClientValidAction"> > > > /clResult.jsp > > > >/clValid.jsp > > > > action class is > > public class ClientValidAction extends ActionSupport { > > private String applName; > private String service; > private double charges; > > private String resStr; > > private ConcurrentHashMap services; > > public ClientValidAction() { >services = new ConcurrentHashMap(); >services.put("DrivingLicence",new Double(100.5)); >services.put("ElectricityBill",new Double(40.5)); >services.put("WaterBill",new Double(35.5)); >services.put("InsurancePremium",new Double(30.5)); > } > > public String execute() throws Exception { >double cost = services.get(service); >resStr = "hello! "+applName+" Charges for "+ > service+ " are "+cost+".Please ready to pay"; >return SUCCESS; > } > > public String getResStr() { >return resStr; > } > > public String getApplName() { >return applName; > } > > public void setApplName(String newName) { >applName = newName; > } > > public String getService() { >return service; > } > > public void setService(String newService) { > service = newService; > } > > public double getCharges() { >return charges; > } > > public void setCharges(double newCharge) { > charges = newCharge; > } > } > > used a validator.xml ClientValidAction-validation.xml > > >"-//OpenSymphony Group//XWork Validator 1.0.2//EN" > >"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";> > > > > > > > > true > > Applicant's name is required > > > > > > > > > >9.99 > >120.0 > > > Charges should be higher than ${minExclusive} and lessequal to > ${maxInclusive} > > > > > > > > > > when i am asking the input , i am getting in browser > > FreeMarker template error! > > Method public java.util.List > org.apache.struts2.components.Form.getValidators(java.lang.String) threw an > exception when invoked on org.apache.struts2.components.Form@1be20c > The problematic instruction: > -- > ==> list tag.getValidators("${tagName}") as validator [on line 46, column 9 > in template/xhtml/form-close-validate.ftl] > in include "/${parameters.templateDir}/xhtml/form-close-validate.ftl" [on > line 25, column 1 in template/xhtml/form-close.ftl] > -- > > Java backtrace for programmers: > -- > freemarker.template.TemplateModelException: Method public java.util.List > org.apache.struts2.components.Form.getValidators(java.lang.String) threw an > exception when invoked on org.apache.struts2.components.Form@1be20c > at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:130) > at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93) > at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) > at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94) > at freemarker.core.Environment.visit(Environment.java:210) > at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:167) > at freemarker.core.Environment.visit(Environment.java:417) > at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102) > at freemarker.core.Environment.visit(Environment.java:210) > at freemarker.core.MixedContent.accept(MixedContent.java:92) > at freemarker.core.Environment.visit(Environment.java:210) > at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) > at freemarker.core.Environment.visit(Environment.java:210) > at freemarker.core.MixedContent.accept(MixedContent.java:92) > at freemarker.core.Environment.visit(Environment.java:210) > at freemarker.core.Environment.include(Environment.java:1483) > at freemarker.core.Include.accept(Include.java:169) > at freemarker.core.Environment.visit(Environment.java:210) > at freemarker.core.MixedContent.accept(MixedContent.java:92) > at freemarker.core.Environment.visit(Environment.java:210) > at freemarker.core.Environment.process(Environment.java:190) > at freemarker.template.Template.process(Template.java:237) > at > org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157) > at org.apache.struts2.co
client side validation in struts2
t.java:389) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:332) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:237) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.NullPointerException at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorKey(AnnotationActionValidatorManager.java:212) at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:69) at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:65) at org.apache.struts2.components.Form.getValidators(Form.java:265) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at freemarker.ext.beans.BeansWrapper.invokeMet -- View this message in context: http://old.nabble.com/client-side-validation-in-struts2-tp30931442p30931442.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: validation in struts2
Thanks all. It was working fine after changing to LoginAction-validation.xml . musomesa wrote: > > > Also, the file should be LoginAction-validation.xml . Use the > config-browser to see that you have the validators in place. > > > > Chris > > > > > -Original Message- > From: Gabriel Belingueres > To: Struts Users Mailing List > Sent: Wed, Jan 20, 2010 10:12 am > Subject: Re: validation in struts2 > > > the form tag is wrong? > > try: > > > > 2010/1/19 Shasha : >> >> Hi All, >> >> I am not able to get the validation errors from Login-validation.xml when >> i >> am using Modeldriven . >> >> Login-validation.xml >> 1. > 2. "-//OpenSymphony Group//XWork Validator 1.0.2//EN" >> 3. >> "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";> >> 4. >> 5. >> 6. >> 7. >> 8. >> 9. >> 10. >> 11. >> 12. >> 13. >> 14. >> 15. >> 16. >> >> LoginAction.java >> >> 1. public class LoginAction extends ActionSupport implements >> ModelDriven,SessionAware{ >> 2. >> 3. private User user = new User(); >> 4. private Map session; >> 5. private UserDAO userDAO = new UserDAOImpl(); >> 6. >> 7. public String execute() throws Exception { >> 8. >> 9. boolean success=userDAO.verifyUser(user); >> 10. if (success) >> 11. return SUCCESS; >> 12. else >> 13. return ERROR; >> 14. } >> 15. >> 16. public Object getModel() { >> 17. return user; >> 18. } >> 19. >> 20. public void setSession(Map session) { >> 21. this.session=session; >> 22. } >> 23. >> 24. public Map getSession() { >> 25. return session; >> 26. } >> 27. >> 28. } >> >> login.jsp >> >> 1. <%@ taglib prefix="s" uri="/struts-tags" %> >> 2. >> 3. >> 4. Struts 2 Login Application! >> 5. >> 6. " rel="stylesheet" >> type="text/css"/> >> 7. >> 8. >> 9. >> 10. >> 11. >> 12. Login >> 13. >> 14. >> 15. >> 16. >> 17. >> 18. >> 19. >> 20. >> 21. >> 22. >> 23. >> 24. >> 25. >> 26. >> 27. >> 28. >> 29. >> >> http://old.nabble.com/file/p27236040/error.jpg >> >> >> -- >> View this message in context: >> http://old.nabble.com/validation-in-struts2-tp27236040p27236040.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 >> >> > > - > 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://old.nabble.com/validation-in-struts2-tp27236040p27266241.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: validation in struts2
Your XML file needs to be renamed as,LoginAction-validation.xml -Original Message- From: Gabriel Belingueres [mailto:belingue...@gmail.com] Sent: Wednesday, January 20, 2010 8:43 PM To: Struts Users Mailing List Subject: Re: validation in struts2 the form tag is wrong? try: 2010/1/19 Shasha : > > Hi All, > > I am not able to get the validation errors from Login-validation.xml when i > am using Modeldriven . > > Login-validation.xml > 1. 2. "-//OpenSymphony Group//XWork Validator 1.0.2//EN" > 3. "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";> > 4. > 5. > 6. > 7. > 8. > 9. > 10. > 11. > 12. > 13. > 14. > 15. > 16. > > LoginAction.java > > 1. public class LoginAction extends ActionSupport implements > ModelDriven,SessionAware{ > 2. > 3. private User user = new User(); > 4. private Map session; > 5. private UserDAO userDAO = new UserDAOImpl(); > 6. > 7. public String execute() throws Exception { > 8. > 9. boolean success=userDAO.verifyUser(user); > 10. if (success) > 11. return SUCCESS; > 12. else > 13. return ERROR; > 14. } > 15. > 16. public Object getModel() { > 17. return user; > 18. } > 19. > 20. public void setSession(Map session) { > 21. this.session=session; > 22. } > 23. > 24. public Map getSession() { > 25. return session; > 26. } > 27. > 28. } > > login.jsp > > 1. <%@ taglib prefix="s" uri="/struts-tags" %> > 2. > 3. > 4. Struts 2 Login Application! > 5. > 6. " rel="stylesheet" > type="text/css"/> > 7. > 8. > 9. > 10. > 11. > 12. Login > 13. > 14. > 15. > 16. > 17. > 18. > 19. > 20. > 21. > 22. > 23. > 24. > 25. > 26. > 27. > 28. > 29. > > http://old.nabble.com/file/p27236040/error.jpg > > > -- > View this message in context: http://old.nabble.com/validation-in-struts2-tp27236040p27236040.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 > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: validation in struts2
Also, the file should be LoginAction-validation.xml . Use the config-browser to see that you have the validators in place. Chris -Original Message- From: Gabriel Belingueres To: Struts Users Mailing List Sent: Wed, Jan 20, 2010 10:12 am Subject: Re: validation in struts2 the form tag is wrong? try: 2010/1/19 Shasha : > > Hi All, > > I am not able to get the validation errors from Login-validation.xml when i > am using Modeldriven . > > Login-validation.xml > 1.2. "-//OpenSymphony Group//XWork Validator 1.0.2//EN" > 3. "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";> > 4. > 5. > 6. > 7. > 8. > 9. > 10. > 11. > 12. > 13. > 14. > 15. > 16. > > LoginAction.java > > 1. public class LoginAction extends ActionSupport implements > ModelDriven,SessionAware{ > 2. > 3. private User user = new User(); > 4. private Map session; > 5. private UserDAO userDAO = new UserDAOImpl(); > 6. > 7. public String execute() throws Exception { > 8. > 9. boolean success=userDAO.verifyUser(user); > 10. if (success) > 11. return SUCCESS; > 12. else > 13. return ERROR; > 14. } > 15. > 16. public Object getModel() { > 17. return user; > 18. } > 19. > 20. public void setSession(Map session) { > 21. this.session=session; > 22. } > 23. > 24. public Map getSession() { > 25. return session; > 26. } > 27. > 28. } > > login.jsp > > 1. <%@ taglib prefix="s" uri="/struts-tags" %> > 2. > 3. > 4. Struts 2 Login Application! > 5. > 6. " rel="stylesheet" > type="text/css"/> > 7. > 8. > 9. > 10. > 11. > 12. Login > 13. > 14. > 15. > 16. > 17. > 18. > 19. > 20. > 21. > 22. > 23. > 24. > 25. > 26. > 27. > 28. > 29. > > http://old.nabble.com/file/p27236040/error.jpg > > > -- > View this message in context: > http://old.nabble.com/validation-in-struts2-tp27236040p27236040.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 > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: validation in struts2
the form tag is wrong? try: 2010/1/19 Shasha : > > Hi All, > > I am not able to get the validation errors from Login-validation.xml when i > am using Modeldriven . > > Login-validation.xml > 1. 2. "-//OpenSymphony Group//XWork Validator 1.0.2//EN" > 3. "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";> > 4. > 5. > 6. > 7. > 8. > 9. > 10. > 11. > 12. > 13. > 14. > 15. > 16. > > LoginAction.java > > 1. public class LoginAction extends ActionSupport implements > ModelDriven,SessionAware{ > 2. > 3. private User user = new User(); > 4. private Map session; > 5. private UserDAO userDAO = new UserDAOImpl(); > 6. > 7. public String execute() throws Exception { > 8. > 9. boolean success=userDAO.verifyUser(user); > 10. if (success) > 11. return SUCCESS; > 12. else > 13. return ERROR; > 14. } > 15. > 16. public Object getModel() { > 17. return user; > 18. } > 19. > 20. public void setSession(Map session) { > 21. this.session=session; > 22. } > 23. > 24. public Map getSession() { > 25. return session; > 26. } > 27. > 28. } > > login.jsp > > 1. <%@ taglib prefix="s" uri="/struts-tags" %> > 2. > 3. > 4. Struts 2 Login Application! > 5. > 6. " rel="stylesheet" > type="text/css"/> > 7. > 8. > 9. > 10. > 11. > 12. Login > 13. > 14. > 15. > 16. > 17. > 18. > 19. > 20. > 21. > 22. > 23. > 24. > 25. > 26. > 27. > 28. > 29. > > http://old.nabble.com/file/p27236040/error.jpg > > > -- > View this message in context: > http://old.nabble.com/validation-in-struts2-tp27236040p27236040.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 > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
validation in struts2
Hi All, I am not able to get the validation errors from Login-validation.xml when i am using Modeldriven . Login-validation.xml 1. http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";> 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. LoginAction.java 1. public class LoginAction extends ActionSupport implements ModelDriven,SessionAware{ 2. 3. private User user = new User(); 4. private Map session; 5. private UserDAO userDAO = new UserDAOImpl(); 6. 7. public String execute() throws Exception { 8. 9. boolean success=userDAO.verifyUser(user); 10. if (success) 11. return SUCCESS; 12. else 13. return ERROR; 14. } 15. 16. public Object getModel() { 17. return user; 18. } 19. 20. public void setSession(Map session) { 21. this.session=session; 22. } 23. 24. public Map getSession() { 25. return session; 26. } 27. 28. } login.jsp 1. <%@ taglib prefix="s" uri="/struts-tags" %> 2. 3. 4. Struts 2 Login Application! 5. 6. " rel="stylesheet" type="text/css"/> 7. 8. 9. 10. 11. 12. Login 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. http://old.nabble.com/file/p27236040/error.jpg -- View this message in context: http://old.nabble.com/validation-in-struts2-tp27236040p27236040.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: How to bypass validation in struts2
Hi, thanks for the solutions. It works when i follow your advise. I will like to ask another question. It seems that when i use this example to escape the validation, i'm not able to access to another page when i click on the submit button. Please correct me if i'm wrong. It is because of this line: in the struts.xml that that the method="{1}" always caused struts to have the value input and forgo calling the class file to process the data? Thanks newbie-gero wrote: > > Hi, > > i'm new to struts 2 and i'm trying out the example in the struts2 webpage. > Currently i'm trying on the struts2 tutorial on bypassing the validation > as listed on http://struts.apache.org/2.x/docs/validating-input.html > > However i encounter a few problems when i deploy the code in tomcat > server. > When the page is up by entering > http://localhost:8080/tutorial/HelloWorld.action in the url section on the > browser, i click on the English language. > > NExt i click on the 'Sign On' hyperlink. It should direct me to the > Logon.jsp page, but the result on my browser shows error 404 and states > that the requested source /tutorial/Login_input.jsp is not available. > > This is my section on the validation on my struts.xml > > /Logon.jsp > Menu > > > > I have already follow every possible instruction on the struts tutorial > page but i still cannot solve this issue. I have upload my code running on > my tomcat server along with this post. > http://www.nabble.com/file/p20082857/tutorial.zip tutorial.zip > > Please help me with this issue. > Thanks in advance > > -- View this message in context: http://www.nabble.com/How-to-bypass-validation-in-struts2-tp20082857p20083722.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to bypass validation in struts2
Your problem is in the following line in your struts.xml file - /{1}.jsp In itself, this configuration is not a bad thing, but it's location is your problem. I think order is important in the struts.xml file. Since this wildcard is located before your "Logon_*" action, it is matched first. Try moving your wildcard action further down in your package configuration so that Logon_* will be matched first. -Wes On Mon, 2008-10-20 at 20:26 -0700, newbie-gero wrote: > Hi, > > i'm new to struts 2 and i'm trying out the example in the struts2 webpage. > Currently i'm trying on the struts2 tutorial on bypassing the validation as > listed on http://struts.apache.org/2.x/docs/validating-input.html > > However i encounter a few problems when i deploy the code in tomcat server. > When the page is up by entering > http://localhost:8080/tutorial/HelloWorld.action in the url section on the > browser, i click on the English language. > > NExt i click on the 'Sign On' hyperlink. It should direct me to the > Logon.jsp page, but the result on my browser shows error 404 and states that > the requested source /tutorial/Login_input.jsp is not available. > > This is my section on the validation on my struts.xml > > /Logon.jsp > Menu > > > > I have already follow every possible instruction on the struts tutorial page > but i still cannot solve this issue. I have upload my code running on my > tomcat server along with this post. > http://www.nabble.com/file/p20082857/tutorial.zip tutorial.zip > > Please help me with this issue. > Thanks in advance > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to bypass validation in struts2
Hi, i'm new to struts 2 and i'm trying out the example in the struts2 webpage. Currently i'm trying on the struts2 tutorial on bypassing the validation as listed on http://struts.apache.org/2.x/docs/validating-input.html However i encounter a few problems when i deploy the code in tomcat server. When the page is up by entering http://localhost:8080/tutorial/HelloWorld.action in the url section on the browser, i click on the English language. NExt i click on the 'Sign On' hyperlink. It should direct me to the Logon.jsp page, but the result on my browser shows error 404 and states that the requested source /tutorial/Login_input.jsp is not available. This is my section on the validation on my struts.xml /Logon.jsp Menu I have already follow every possible instruction on the struts tutorial page but i still cannot solve this issue. I have upload my code running on my tomcat server along with this post. http://www.nabble.com/file/p20082857/tutorial.zip tutorial.zip Please help me with this issue. Thanks in advance -- View this message in context: http://www.nabble.com/How-to-bypass-validation-in-struts2-tp20082857p20082857.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Questions on action chaining and validation in struts2 - please help
More than one year later, I have the exact same problem. If the original poster has found a solution, or if anyone else knows how to solve this issue, I'd be very glad! I have tried Action Chaining the result: @Result(name="input",type=ActionChainResult.class,value="product" ,params= {"method","getOne"}), However, Struts will try to find the "input" result of the chained action (product), and will never reach the method. aj123 wrote: > > Hi > I am trying to use action chaining in struts2 and am stuck. Any help would > be really appreciated. > > Scenario - I have a page that shows a list of records and also has a form > to add a new record. When user clicks on add I call addAction and chain it > to list action to go back to list page again showing the newly added > record. > > My struts.xml looks something like this -> > > > >list > >list > > >/proj/list.jsp > > > I have 2 issues/questions - > a) My validation does not work if I chain actions. If I don't enter > anything in add textbox and click on Add then I get a html 404 error. If I > route to list.jsp instead of chaning to list action then I see validation > messages. But I really need to show list on that page as well. So I can > not forward to the jsp. > > b) When I chain 2 actions, can I pass new params for second action? It > does not seem to work for me e.g. In following example, I can not pass foo > param to list action that is chained to add action. > > > > list > bar > > list > > > I would really appreciate some feedback/help here. > -- View this message in context: http://www.nabble.com/Questions-on-action-chaining-and-validation-in-struts2---please-help-tp10036082p17980459.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Questions on action chaining and validation in struts2 - please help
Hi I am trying to use action chaining in struts2 and am stuck. Any help would be really appreciated. Scenario - I have a page that shows a list of records and also has a form to add a new record. When user clicks on add I call addAction and chain it to list action to go back to list page again showing the newly added record. My struts.xml looks something like this -> list list /proj/list.jsp I have 2 issues/questions - a) My validation does not work if I chain actions. If I don't enter anything in add textbox and click on Add then I get a html 404 error. If I route to list.jsp instead of chaning to list action then I see validation messages. But I really need to show list on that page as well. So I can not forward to the jsp. b) When I chain 2 actions, can I pass new params for second action? It does not seem to work for me e.g. In following example, I can not pass foo param to list action that is chained to add action. list bar list I would really appreciate some feedback/help here. -- View this message in context: http://www.nabble.com/Questions-on-action-chaining-and-validation-in-struts2---please-help-tf3590988.html#a10036082 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]