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

Difference between html tags and struts specific html tags

513


What is the use of namespace in action mapping in Struts2?

578


What is the purpose of @customvalidator annotation?

575


What is structs 2 validation framework?

568


What are the bundled validators?

591






What is package name in struts xml?

563


What is apache struts framework?

524


Explain about tiles?

577


What are different ways to create Action classes in Struts2?

595


What do you mean by dynaactionform?

554


Does struts include its own unit tests?

529


When do I need “struts.jar” on my classpath?

543


What does action do in struts?

540


Explain how can we upload files in struts2 application?

621


Which configuration files are used in struts?

527