Re: Exception Handling in Struts 2.0.11
Hi Terry, My struts.xml looks like this : 405 The requested method is unsupported /JSPPages/Exception.jsp /JSPPages/LoginPage.jsp /JSPPages/Admin.jsp /JSPPages/Common.jsp /JSPPages/Blank.jsp /JSPPages/Error.jsp My action class LoginValidation.java contains getter and setter methods for the textfield (username) and password (password) field defined in LoginPage.jsp. In the execute method of action class I am explicitely calling the NullPointerException. i.e., @Override public String execute() throws Exception { throw new NullPointerException(); } When this action class is called I should get the /JSPPages/Exception.jsp page but currently I am not getting the actual page. Is it necessary to define exception in the action tags of struts.xml Thanks in advance, === Terry Gardner-2 wrote: > > Can you be a little more clear about your ask? Using the examples in > the given URL, are you asking about: > > 1. How to code exception.jsp? > 2. How to code SQLExceptionAction.java? > 3. What is on the ValueStack in these examples and an Exception occurs? > 4. something else? > > On Apr 27, 2009, at 4:34 AM, NR031 wrote: > >> >> Hi, >> >> I am using Struts 2.0.11 and NetBeans 6.1. Is there any way to >> handle >> exception in Struts 2? >> >> I saw the tutorial given >> http://struts.apache.org/2.0.11/docs/exception-configuration.html >> http://struts.apache.org/2.0.11/docs/exception-configuration.html , >> but it >> doesn't contain a sample example that demonstrate the Exception >> Handling. I >> am new to Struts so please explain with an example. >> >> >> Thanks in advance, >> -- >> View this message in context: >> http://www.nabble.com/Exception-Handling-in-Struts-2.0.11-tp23252025p23252025.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 >> > > > == > > Terry Gardner > terry.gard...@sun.com > Skype: Terry_J_Gardner > > "Vulcans never bluff." -- Spock > > > ----------------- > 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/Exception-Handling-in-Struts-2.0.11-tp23252025p23252800.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: Exception Handling in Struts 2.0.11
2009/4/27 NR031 : > I am using Struts 2.0.11 and NetBeans 6.1. Is there any way to handle > exception in Struts 2? Just define global result and put entries for given exceptions in struts.xml, like below 405 The requested method is unsupported /jsp/error.jsp 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
Re: Exception Handling in Struts 2.0.11
Can you be a little more clear about your ask? Using the examples in the given URL, are you asking about: 1. How to code exception.jsp? 2. How to code SQLExceptionAction.java? 3. What is on the ValueStack in these examples and an Exception occurs? 4. something else? On Apr 27, 2009, at 4:34 AM, NR031 wrote: Hi, I am using Struts 2.0.11 and NetBeans 6.1. Is there any way to handle exception in Struts 2? I saw the tutorial given http://struts.apache.org/2.0.11/docs/exception-configuration.html http://struts.apache.org/2.0.11/docs/exception-configuration.html , but it doesn't contain a sample example that demonstrate the Exception Handling. I am new to Struts so please explain with an example. Thanks in advance, -- View this message in context: http://www.nabble.com/Exception-Handling-in-Struts-2.0.11-tp23252025p23252025.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 == Terry Gardner terry.gard...@sun.com Skype: Terry_J_Gardner "Vulcans never bluff." -- Spock - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Exception Handling in Struts 2.0.11
Hi, I am using Struts 2.0.11 and NetBeans 6.1. Is there any way to handle exception in Struts 2? I saw the tutorial given http://struts.apache.org/2.0.11/docs/exception-configuration.html http://struts.apache.org/2.0.11/docs/exception-configuration.html , but it doesn't contain a sample example that demonstrate the Exception Handling. I am new to Struts so please explain with an example. Thanks in advance, -- View this message in context: http://www.nabble.com/Exception-Handling-in-Struts-2.0.11-tp23252025p23252025.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