dcsimg
<newbie alert> HTTP 405 (POST not supported) error when forwarding from one JSP to another
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jerry_Gaines
Posted On:   Monday, May 13, 2002 06:40 PM

We are building a Struts application in which the user maintains information about a widget across multiple pages. Like this: JSP1 -> FormBean b -> Action a -> JSP2 In JSP1 the user enters initial information about the widget. This gets copied into b and picked up for handling by a . a checks with some Model components - doing extended biz-logic validation - and if all is well forwards to JSP2 . JSP2 has its own form fields, some copied from JSP1 and some extras. But when a does the forwarding, the server throws a HTTP 405 (POST not supported) error. If we go back to JSP1 and add m   More>>

We are building a Struts application in which the user maintains information about a widget across multiple pages. Like this:

			
JSP1 -> FormBean b -> Action a -> JSP2


In JSP1 the user enters initial information about the widget. This gets copied into b and picked up for handling by a . a checks with some Model components - doing extended biz-logic validation - and if all is well forwards to JSP2 . JSP2 has its own form fields, some copied from JSP1 and some extras.

But when a does the forwarding, the server throws a HTTP 405 (POST not supported) error.

If we go back to JSP1 and add method="get" to the html:form tag, then everthing works fine, except that we see this in the browser address line:

			
http://localhost/testapp/JSP2.jsp?foo=bar&fred=barney etc,

with all the parameters from JSP1 appended as a query string.

A workaround of sorts is to redirect to JSP2 , rather than forwarding. That seems to work, but it seems like it adds an extra network round trip. Plus, it seems an unlikely thing to have to do - suggests to us that we are not grokking the Struts framework correctly.

Other people don't seem to have struck this, so we must be doing some simple thing wrong. Any hints? Thanks in advance.

PS Environment: Tomcat 4.0.3, JDK 1.4.0, Struts 1.0.2

   <<Less

Re: &lt;newbie alert&gt; HTTP 405 (POST not supported) error when forwarding from one JSP to another

Posted By:   Alberto_Poza  
Posted On:   Tuesday, May 14, 2002 12:39 AM

Are you fowarding returning an ActionForward with mapping.findForward()?
About | Sitemap | Contact