Hello,

In bare container (tomcat) everything is good: Servlet throws exception and
container logs it and displays 500 error page with certain status.
Each uncounght exception should lead to 500 error because uncought exception
is _program_ error. 

But struts-2 breaks this scheme. 

1) it does not pass exception to container so container can't log it.
2) even if I use "exception" interceptor (ExceptionMappingInterceptor)
struts does not set "500" error code to my result. So I have to set it in my
JSP (or servlet) manually. 
I can't use static 500 error page as I did in tomcat. 

So, my questions are: 

1) Why do not struts passes exception to container by default? Could I
configure it to do so?
2) If struts can't do it -- how can I make it to send 500 status for my
exception? I do not want to configure my jsp
3) Who really needs exeption handling in struts?  Somebody wants user to be
redirected to different actions based on exception type? What for? Smells
like exception-based business logic moved from java to struts.xml and does
not look like good practice.

I need to write a lot just to get back to default container behavior (500
status and logging):

1) Create _new_ stack to set logEnabled and logLevel
2) Configure package to use it
3) Add global error result
4) Add global exception handling
5) Create JSP with "status 500" instead of my 500.html page

Is not it too big for such simple task?



Ilya Kazakevich,
Developer
JetBrains Inc
http://www.jetbrains.com
"Develop with pleasure!"


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to