Question for the dev guys.
AbstractApplicationServlet.getRequestType() is protected but the inner RequestType enum is package-private. Any reason for this? I’d like to be able to use it for safely detecting “noisy” URL paths and do something like:
http://demo.vaadin.com/sampler/12345abc/ → whoa!? → auto redirect to → http://demo.vaadin.com/sampler/
getRequestType() gives me a chance to do that in a reasonably safe way by letting me filter out anything that’s not a RequestType.OTHER type but I have to toString() it since said enum is package-private.
Here’s some simplified code of what I’m doing:
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
if (isStandardUserRequest(request) && isFunkyPath(request))
{
response.sendRedirect(getCorrectPath(request));
}
else
{
super.service(request, response);
}
}
Thanks in advance.