This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • StrutsStupidUriTricks
Skip to end of metadata
Go to start of metadata

Why is the URI in my form tags truncated?

In the JSP template, we've specified

  • <html:form action="/input.do">

and in the struts-config.xml, we've specified

  • <action type="MyAction" path="/input" name="myform" parameter="301" scope="session"/>

If the page is accessed using a URI like

when the page renders, the html source contains only the application name

  • <form action="/myApp">.

As a result, the form is not submitted to the proper URI or ActionMapping.

struts version - 1.1 environment- wsad 5.0

Here are two things you can try,

  • First, specify the ActionMapping in the html:form tag, not the URI form with the extension. Using the URI extension with the form tag has been deprecated since Struts 0.5.
  • Second, check whether there is a leading slahs specified by the servlet mapping in the web.xml deployment descriptor. Usually you will want to specify

** <url-pattern>*.do</url-pattern>

without a leading slash.

(Submitted by Rainer Podlas)

  • No labels