I'm using Struts1.1rc2 with sslext for Struts1.1rc2 and am seeing some
peculiar behavior
when an invalid path is requested.
What should happen is the RequestProcessor.processMapping() should recognize
that
there is no action mapping for the path, log a message, and send an 400
(Invalid Request) response
directly back to the client.
That's what is happening here.
10156: Aug 29, 2003 4:53:36 PM org.apache.struts.action.RequestProcessor
processMapping
SEVERE: Invalid path /something was requested
But what happens is that SecureRequestProcess.preProcess() invokes
RequestProcessor.processMapping()
which logs the above error message, then returns null.
SecureRequestProcessor then returns true because
no mapping was found. Then RequestProcessor invokes its own processMapping()
which is when the
IllegalStateException is thrown because the response has already been
committed.
10156: Aug 29, 2003 4:53:36 PM org.apache.struts.action.RequestProcessor
processMapping
SEVERE: Invalid path /something was requested
10156: ServletExec: caught exception - java.lang.IllegalStateException:
sendError() failed - data has already
been sent to client
10156: java.lang.IllegalStateException: sendError() failed - data has
already been sent to client
10156: at com.newatlanta.servletexec.Response.sendError(Response.java:670)
10156: at
org.apache.struts.action.RequestProcessor.processMapping(RequestProcessor.ja
va:679)
10156: at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:242)
10156: at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1421)
10156: at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:500)
10156: at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
10156: at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
10156: at
com.newatlanta.servletexec.ServletExec.CallServletService(ServletExec.java:1
679)
10156: at
com.newatlanta.servletexec.SERequestDispatcher.forwardServlet(SERequestDispa
tcher.java:280)
10156: at
com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDispatcher.j
ava:191)
10156: at
com.newatlanta.servletexec.ApplicationInfo.processApplRequest(ApplicationInf
o.java:1447)
10156: at
com.newatlanta.servletexec.ServerHostInfo.processApplRequest(ServerHostInfo.
java:1242)
10156: at
com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1235)
10156: at
com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1113)
I'm assuming that this exception is trapped, because I get the expected page
back in the browser.
Should I be worried about this? One possible work around would be to check
to see if the
response has already been commited before attempting to write to it. I'm not
sure how that would
impact the rest of the logic in the RequestProcessor.
robert
PS. I've created a test web app which duplicates the behavior described
above. If I remove
<controller
processorClass="org.apache.struts.action.SecureRequestProcessor"/> from
struts-config.xml
then I don't see the exception stack trace.
BTW: Below is a snippet of code from RequestProcessor where the exception is
being thrown:
<snip>
// No mapping can be found to process this request
log.error(getInternal().getMessage("processInvalid", path));
response.sendError(HttpServletResponse.SC_BAD_REQUEST, // <===== Here
getInternal().getMessage("processInvalid", path));
</snip>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]