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

Name some of the features of struts2?

573


Why was reload removed from struts (since 1.1)?

550


How an actionform bean is created?

575


What is action class?

583


Name the different types of actions found in struts.

562






Why is action servlet a singleton in struts?

595


How to display validation errors on jsp page?

571


Is struts mvc framework?

484


What are struts in java?

510


Briefly tell the two kinds of form beans.

565


How nested beans can be used in Struts applications?

552


How to upload struts file?

606


What are the differences between Struts1 and Struts2 or how Struts2 is better than Struts1?

587


What do you mean by a custom tag?

547


How long do struts last?

535