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


Please Help Members By Posting Answers For Below Questions

What is the default location of result pages and how can we change it?

762


What is difference between lookupdispatchaction and dispatchaction?

854


Can you explain value stack?

710


Does Struts2 action and interceptors are thread safe?

763


What are the core components of a struct2 based application?

765


Who makes the struts?

711


Mark the differences between html tags and strut specific html tags.

761


What is struts and why it is used?

694


What are the life cycle methods of interceptor?

704


Describe the basic steps used to create a tiles application?

772


How can we handle exceptions thrown by application in Struts2?

719


Do I have to credit struts on my own website?

730


What is the difference between struts and spring? Explain

678


What are the core classes of the struts framework?

692


What is the purpose of @doublerangefieldvalidator annotation?

762