You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Claire Suttle <cl...@tmicha.net> on 2004/07/22 22:17:05 UTC

Submitting form does nothing

Hi,

I am working on moving our current struts based server from Java 1.3 / tomcat 3 to Java 1.4 / tomcat 5. The forms that were working before do not seem to be working now - when I hit the submit button, I just get forwarded to a blank page. My action classes are not hit. I extended the ActionServlet class, and my extended class does not get hit either.

I know that my paths are set up correctly, and that my struts-config file is being read because in some places I have links directly to action classes, and those links are all fine, it just seems to be the submit mechanism that is failing.

Has anyone come across anything like this, or has any ideas?

Thanks,
Claire

Re: Submitting form does nothing

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
Claire,

If you like, send the code to my personal email, 
michael@michaelmcgrady.com, and let me have a looksee.  Please send your 
struts-config.xml and web.xml as well as the pages and associated code.

Michael

At 09:12 AM 7/27/2004, you wrote:
>Hi Craig,
>
> >
> > The only thng I can think of that would cause the symptoms you
> > describe is if the URLs with which the forms are being submitted are
> > either incorrect (not mapping to the Struts servlet at all), or are
> > somehow not mapping to the correct action.  Have you double checked
> > the HTML source (use View Source in your browser) to make sure that
> > the "action" attribute of the <form> element is correctly formed,
> > based on what you have your servlet mapping set to?
> >
>
>That's exactly what happens - the URL displayed in the action of the pages
>that don't work is incorrect. I have a couple of pages where the form
>command expands as
>
>and then in the rest it expands as I've now managed to track this down to 
>the org.apache.struts.util.RequestUtils class, and the getActionMappingURL 
>method. The second line of this method reads: StringBuffer value = new 
>StringBuffer(request.getContextPath()); on the pages that work, this line 
>returns an empty string buffer. On the pages that don't work, the string 
>buffer is returned containing a single character - '/' Then, what I would 
>expect to be filled in is filled in several lines down - 
>value.append(actionMapping); value.append(servletMapping.substring(1)); 
>these two lines always evaluate to /actionname.do So I now know where the 
>extra '/' is coming from...but I really have no idea why Thanks, Claire 
>--------------------------------------------------------------------- To 
>unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional 
>commands, e-mail: user-help@struts.apache.org



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


Re: Submitting form does nothing

Posted by Craig McClanahan <cr...@gmail.com>.
On Tue, 27 Jul 2004 09:12:21 -0700, Claire Suttle <cl...@geoviz.com> wrote:
> Hi Craig,
> 
> >
> > The only thng I can think of that would cause the symptoms you
> > describe is if the URLs with which the forms are being submitted are
> > either incorrect (not mapping to the Struts servlet at all), or are
> > somehow not mapping to the correct action.  Have you double checked
> > the HTML source (use View Source in your browser) to make sure that
> > the "action" attribute of the <form> element is correctly formed,
> > based on what you have your servlet mapping set to?
> >
> 
> That's exactly what happens - the URL displayed in the action of the pages
> that don't work is incorrect. I have a couple of pages where the form
> command expands as
> 
> <html:form action="/AddNewUser.do">
> 
> and then in the rest it expands as
> 
> <html:form action="//NewProjectID.do">
> 
> I've now managed to track this down to the
> org.apache.struts.util.RequestUtils class, and the getActionMappingURL
> method. The second line of this method reads:
> 
> StringBuffer value = new StringBuffer(request.getContextPath());
> 
> on the pages that work, this line returns an empty string buffer. On the
> pages that don't work, the string buffer is returned containing a single
> character - '/'
> 
> Then, what I would expect to be filled in is filled in several lines down -
> 
> value.append(actionMapping);
> value.append(servletMapping.substring(1));
> 
> these two lines always evaluate to /actionname.do
> 
> So I now know where the extra '/' is coming from...but I really have no idea
> why
> 

It must be coming from your servlet container (i.e. the code inside
getContextPath()), and it's broken or misconfigured ... "/" is not a
legal context path.  If this is the default application for your
servet container, the context path returned by the container should be
"" (a zero length string).

> Thanks,
> Claire

Craig

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


Re: Submitting form does nothing

Posted by Claire Suttle <cl...@geoviz.com>.
Hi Craig,

>
> The only thng I can think of that would cause the symptoms you
> describe is if the URLs with which the forms are being submitted are
> either incorrect (not mapping to the Struts servlet at all), or are
> somehow not mapping to the correct action.  Have you double checked
> the HTML source (use View Source in your browser) to make sure that
> the "action" attribute of the <form> element is correctly formed,
> based on what you have your servlet mapping set to?
>

That's exactly what happens - the URL displayed in the action of the pages
that don't work is incorrect. I have a couple of pages where the form
command expands as

<html:form action="/AddNewUser.do">

and then in the rest it expands as

<html:form action="//NewProjectID.do">

I've now managed to track this down to the
org.apache.struts.util.RequestUtils class, and the getActionMappingURL
method. The second line of this method reads:

StringBuffer value = new StringBuffer(request.getContextPath());

on the pages that work, this line returns an empty string buffer. On the
pages that don't work, the string buffer is returned containing a single
character - '/'

Then, what I would expect to be filled in is filled in several lines down -

value.append(actionMapping);
value.append(servletMapping.substring(1));

these two lines always evaluate to /actionname.do

So I now know where the extra '/' is coming from...but I really have no idea
why

Thanks,
Claire



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


Re: Submitting form does nothing

Posted by Craig McClanahan <cr...@gmail.com>.
On Thu, 22 Jul 2004 13:17:05 -0700, Claire Suttle <cl...@tmicha.net> wrote:
> Hi,
> 
> I am working on moving our current struts based server from Java 1.3 / tomcat 3 to Java 1.4 / tomcat 5. The forms that were working before do not seem to be working now - when I hit the submit button, I just get forwarded to a blank page. My action classes are not hit. I extended the ActionServlet class, and my extended class does not get hit either.
> 

The only thng I can think of that would cause the symptoms you
describe is if the URLs with which the forms are being submitted are
either incorrect (not mapping to the Struts servlet at all), or are
somehow not mapping to the correct action.  Have you double checked
the HTML source (use View Source in your browser) to make sure that
the "action" attribute of the <form> element is correctly formed,
based on what you have your servlet mapping set to?

Craig

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