You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian Moseley <bc...@maz.org> on 2005/02/16 05:20:16 UTC

url rewriting problem

(i don't think this made it through the first time i sent 
it, so i'm trying again. apologies if you get this twice.)

i'm getting some weird problems with url rewriting in a
struts 1.2.4 webapp.

specifically, the urls generated by the form, link, and
rewrite tags have an extra "/" prepended to them.

struts is mapped like so in web.xml:

    <servlet-mapping>
      <servlet-name>action</servlet-name>
      <url-pattern>/console/*</url-pattern>
    </servlet-mapping>

here are examples of what's happening:

    source: <html:rewrite page="/chandler.css"/>
    output: //chandler.css

    source: <html:link page="/console/user/list">
    output: <a href="//console/user/list">

    source: <html:form action="/user/create">
    output: <form name="userForm" method="post"
                  action="//console/user/create">

i don't have any modules configured in struts-xml. here's
the mapping for the page that generates the above output:

      <action path="/user/list"
              type="org.osaf.chandler.server.web.UserAction"
              name="userForm"
              scope="request"
              validate="false"
              parameter="list">
        <forward name="ok" path="user.list"/>
      </action>

and here's the mapping for the action pointed to by the form:

      <action path="/user/create"
              type="org.osaf.chandler.server.web.UserAction"
              name="userForm"
              scope="request"
              validate="true"
              input="/console/user/list"
              parameter="create">
        <forward name="failure" path="/console/user/list"/>
        <forward name="success" path="/console/user/list"
                 redirect="true"/>
      </action>

i've attached the full web.xml and struts-config.xml, in
case something non-obvious is throwing me off.

thanks!