Struts: <Global-Exception>

E

etienno

HI,

I am try to do something simple in struts, but there's no updated
documentation on it.

I have declared a global exception thrown when I get this particular
exception:

<global-exceptions>
<exception
type="my.exception.SessionExpiredRtException"
key="error.fatal.session.expired"
path="/WEB-INF/jsp/error/fatal-error.jsp"
/>
</global-exceptions>


And I just want to redirect to a simple page at
/WEB-INF/jsp/error/fatal-error.jsp when this exception is thrown. And
in the property file, there is a error.fatal.session.expired key where
the text is put.

Ok. So how must I write the JSP page to get back the error message??

I have tried many possibilities, and I dont find it. Where does Struts
store the error key "message"??

I have tried that and it does'n work.

<logic:present name="<%=Globals.MESSAGE_KEY%>">
<P><html:errors property="<%=Globals.MESSAGE_KEY%>"/></P>
</logic:present>

What is the good JSP code?

Thanks
 
E

etienno

HI,

I am try to do something simple in struts, but there's no updated
documentation on it.

I have declared a global exception thrown when I get this particular
exception:

<global-exceptions>
<exception
type="my.exception.SessionExpiredRtException"
key="error.fatal.session.expired"
path="/WEB-INF/jsp/error/fatal-error.jsp"
/>
</global-exceptions>


And I just want to redirect to a simple page at
/WEB-INF/jsp/error/fatal-error.jsp when this exception is thrown. And
in the property file, there is a error.fatal.session.expired key where
the text is put.

Ok. So how must I write the JSP page to get back the error message??

I have tried many possibilities, and I dont find it. Where does Struts
store the error key "message"??

I have tried that and it does'n work.

<logic:present name="<%=Globals.MESSAGE_KEY%>">
<P><html:errors property="<%=Globals.MESSAGE_KEY%>"/></P>
</logic:present>

What is the good JSP code?

Thanks


Found it: <html:errors/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top