|
From: Kopylenko, D. <dko...@ac...> - 2003-09-05 15:12:22
|
Ivan,
Personally the ServletException thrown by MultiActionController in the case
of missing request handling method does not bother me. IMO the
DispatcherServlet is a generic "front controller" servlet which could be
parameterized with different HandlerAdaptors and should not care about
specifics of any particular handler. So I guess it's ok for the
DispatcherServlet to "get" ServletExceptions with "wrapped" exeptions from
handlers. Besides the NoSuchRequestHandlingMethodException does a good job
in terms of info message:
public NoSuchRequestHandlingMethodException(String name,
MultiActionController multiActionRequestController) {
super(
"No request handling method with name '" + name + "'
in class " + multiActionRequestController.getClass().getName());
this.name = name;
}
}
May be I'm wrong. Any other opinions on this?
Regards,
Dmitriy.
-----Original Message-----
From: Ivan Ristic [mailto:iv...@we...]
Sent: Friday, September 05, 2003 7:45 AM
To: spr...@li...
Subject: [Springframework-developer] Throwing HTTP status 404 instead of
exceptions in
Right now, when a MultiActionController can't find the handler for the
request it throws an instance of ServletException. This exception is then
propagated back to the user.
I propose that we change this exception into a HTTP 404 Not found error
(which makes perfect sense to me). Or even better, allow the servlet to make
that decision. Something along the lines of letting the
NoSuchRequestHandlingMethodException (or some alternative
exception) propagate to reach the servlet, which could catch it if it wants
to.
A part of MultiActionController.java:
try {
String name = methodNameResolver.getHandlerMethodName(request);
return invokeNamedMethod(name, request, response);
}
catch (NoSuchRequestHandlingMethodException ex) {
throw new ServletException("No handler", ex);
}
--
ModSecurity (http://www.modsecurity.org)
[ Open source IDS for Web applications ]
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf _______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|