how can u handle run time exceptions in struts and jsp plz
explain briefly not single word answer?
Answer Posted / m.gangadhar from sathya techno
Hi.
In Struts we can handle the run time exceptions in two ways.
1).Programmatic Approach by using try& catch Blocks in
ActionSubClass
2).declarative Approach by Using <exception> in struts-
config.xml this is two ways
a) Either handle exceptions globally by using
<global-exceptions>
<exception
key="error.message"
type="java.lanag.Exception"
path="/error.jsp"/>
</global-exceptions>
In this approach if u get exception any jsp page it
automatically goes to error.jsp and their u dispay the
errors by
using <html-errors/>
b) or u can handle the exceptions as locally i.e particular
to action class
<action-mappings>
<action
name="rf"
path="/regs"
type="RegAction"
validate="true"
input="1.jsp">
<exception
key="error.message"
type="java.lanag.Exception"
path="/error.jsp"/>
</action>
</action-mappings>
Is This Answer Correct ? | 46 Yes | 0 No |
Post New Answer View All Answers
Difference between html tags and struts specific html tags
What is the use of namespace in action mapping in Struts2?
What is the purpose of @customvalidator annotation?
What is structs 2 validation framework?
What are the bundled validators?
What is package name in struts xml?
What is apache struts framework?
Explain about tiles?
What are different ways to create Action classes in Struts2?
What do you mean by dynaactionform?
Does struts include its own unit tests?
When do I need “struts.jar” on my classpath?
What does action do in struts?
Explain how can we upload files in struts2 application?
Which configuration files are used in struts?