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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / 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

More Struts Interview Questions

How does struts work?

0 Answers  


I facing problems while explaining project details in the interview...... can any tell complete project architecture that followed in companies

1 Answers   ID,


What is controller in struts2?

0 Answers  


Can you explain aware interfaces in struts2?

0 Answers  


what is the use of cvs in struts?

2 Answers  


What is Request Dispatcher and What is reuest Processor??

2 Answers  


session menagement in servlets explaion briefly?

1 Answers  


What is life cycle of an interceptor?

0 Answers  


What is front controller in struts2?

0 Answers  


What is apache struts cve 2017 5638?

0 Answers  


How to use forward action to restrict a strut application to mvc?

0 Answers  


What is the purpose of struts.xml in struct2?

0 Answers  


Categories