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
Which servlet does the struts framework use?
Why struts 1 classes are not thread safe whereas struts 2 classes are thread safe?
What are the benefits of Struts framework?
If the framework doesn’t do what I want, can I request that a feature be added?
What is struts actionmapping?
What are the major differences between html tags and strut specific html tags?
How an actionform bean is created?
What is actioncontext?
How to work with error tags?
What is action support class in struts2?
What is Struts2?
What is struts 2 framework in java?
What are the bundled validators?
Which design pattern the interceptors in struts2 is based on?
What is action chaining ?