how can u handle run time exceptions in struts and jsp plz
explain briefly not single word answer?

Answer Posted / gangadhar m

Hi.

In Struts we can handle the run time exceptions in two ways.

1). by using try& catch Blocks in ActionSubClass

2). by Using <exception> in struts-config.xml this is two ways

a) Either handle exceptions globally by using
<global-exceptions>
<exception-type>java.lang.Exception</exception-type>
<exception-location>1.jsp</exception-location>
</global-exceptions>

In this approach if u get exception any jsp page it
automatically goes to 1.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=""
type=""
validate="true"
input="1.jsp">
</action>
</action-mappings>

Is This Answer Correct ?    21 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the benefits of Struts framework?

726


What is used to display the intermediate result in an interceptor?

723


Explain about struts relation to html tags?

734


What are best practices to follow while developing Struts2 application?

789


Which library is provided by struts for form elements like check boxes, text boxes etc?

697


Which design pattern the interceptors in struts2 is based on?

708


Are struts and shocks the same?

672


What is Custom Type Converter in Struts2?

840


What are the core components of a struct2 based application?

768


What is the purpose of action tag in struts.xml?

729


What is value stack?

801


What is the purpose of @key annotation annotation?

814


How duplicate form submission can be controlled in struts?

869


Are the struts tags xhtml compliant ?

710


What is the struts in java?

696