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
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 |
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 |
What do you mean by actionservlet?
What is struts xml?
What is ognl?
In which order struts framework searches for a message bundle?
How Struts will follow the MVC?
How to explain struts work flow
12 Answers CSS, iFlex, iGate, mpower, TCS,
its a ActionForm controller or model?
16 Answers Patni, TCS, Wipro,
why do we typecast ActionForm into our plain java bean class in Action class? What is the reason?
Hi Friends, why struts introduced in to web application. Plz dont send any links . Need main reason for implementing struts. Thanks Prakash
How to get data from the velocity page in a action class?
Is struts mvc framework?
How can we integrate log4j in Struts2 application?