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

In struts.xml, what does the attribute "method" stands for in the "action" tag?

541


How can duplicate form submission be handled in struts 2?

549


Are actions thread safe?

549


What are the advantages of spring mvc over struts mvc?

507


Who wrote struts?

562






Can you explain the directory structure for a struts folder in brief ?

530


What is s token?

543


What is spring and struts in java?

526


What are result types in struts?

582


How we can install struts?

570


What is the purpose of @doublerangefieldvalidator?

622


What is the life cycle of actionform?

564


Does apache struts run on windows?

544


What does apache struts do?

512


What is discontinuous strut?

502