Hack Struts

O

orientphoebus

Is there anyone use Struts while can still get access to the sevlet
and make some operation?

The reason I ask is I wanna get access to some exception, which happen
before the Struts transfer request into Actions. Some of the
exceptions, like if connection suddenly drop, will only be caught in
the servlet level. The Form and Action object have not yet created,
then Struts will just terminate the communication. I'd like to catch
these exception.

Thanks
 
W

Wendy S

orientphoebus said:
Is there anyone use Struts while can still get access to the sevlet
and make some operation?
The reason I ask is I wanna get access to some exception, which happen
before the Struts transfer request into Actions. Some of the
exceptions, like if connection suddenly drop, will only be caught in
the servlet level. The Form and Action object have not yet created,
then Struts will just terminate the communication. I'd like to catch
these exception.

I think you'd do this in your Servlet Container config. If you're using
Tomcat, look at the <error-page> tag in web.xml.

I'm not sure what you mean by a dropped connection. HTTP is stateless; you
don't typically maintain a connection between the server and the client.
Are you talking about a database connection, or something else?

And if it's something *that* bad, what are you going to do with it when you
catch it? Forwarding to an apologetic error page is all I can think of to
do.

If I've totally misunderstood what you're trying to do, can you provide a
more detailed example? Are you getting stack traces in the browser window
that you don't want?
 
E

Eki Y. Baskoro

G'Day,

You can override the method Action::getServlet( :Servlet ) to monitor your
resources.
 

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,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top