struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Brown <aa...@thebrownproject.com>
Subject Re: Help... My url grows...
Date Tue, 14 Dec 2010 21:34:23 GMT
Every time I've had a URL with an extra path element that I didn't
intend, it was always because I messed up the namespace for the action
- I have a bad habit of forgetting the leading "/" on my namespaces.

I see you don't have a namespace defined for your package, that's part
of the stock package tag:
    namespace="/"
...is the typical assignment for the default package. So, something like:

<package name="etasstruts2" namespace="/" extends="struts-default">

See if that helps.

 - Aaron

On Tue, Dec 14, 2010 at 4:24 PM, Ellson, Jared L <jellson@usbr.gov> wrote:
> Hey anybody have a quick idea what would cause my URL to grow.
>
> First time I hit the page:
>
> http://localhost:8080/XXXX/struts/locationAssign
>
> submit the page then:
>
> http://localhost:8080/XXXX/struts/struts/locationAssign
>
> then submit again:
>
> http://localhost:8080/XXXX/struts/struts/struts/locationAssign
>
> Here is my struts.xml:
>
> <struts>
>
>      <constant name="struts.devMode" value="true" />
>
>      <package name="etasstruts2" extends="struts-default">
>
>            <action name="test" class="gov.usbr.etas.web.struts.StrutsTestAction"
method="execute">
>                  <result name="success">/struts/test.jsp</result>
>                  <result name="input">/struts/test.jsp</result>
>            </action>
>            <action name="locationAssign" class="gov.usbr.etas.web.struts.LocationAssignAction"
method="execute">
>                  <result name="success">/struts/locationAssign.jsp</result>
>                  <result name="input">/struts/locationAssign.jsp</result>
>            </action>
>      </package>
>
> </struts>
>
> And my web.xml:
>
>      <filter>
>            <filter-name>struts2</filter-name>
>            <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
>      </filter>
>
>      <filter-mapping>
>            <filter-name>struts2</filter-name>
>            <url-pattern>/struts/*</url-pattern>
>      </filter-mapping>
>
> Thank you for your help!!!
>
>



-- 
Aaron Brown : aaron@thebrownproject.com

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


Mime
View raw message