Glad the problem was identified. It's kind of a tricky thing when the
context-relative path starts with the context name. I know it's not ideal,
but as a work-around in the future, I think this will work:

<s:url var="action" beanclass="..." prependContext="true" />
<s:form action="${action}"> ... </s:form>

Explicitly setting prependContext="true" on s:url causes it *always* to
include the context path in the generated URL. Not sure why we didn't think
to do that for s:form as well.

-Ben

On Tue, May 25, 2010 at 1:24 PM, Chris Cheshire <cheshira...@gmail.com>wrote:

> Ben,
>
> Under production the context path won't be there - but I use different
> contexts to test different branches of the code and I name them
> according to the feature I am adding to the application. This is the
> first time where the context (and branch) name has coincided with the
> action name.
>
> In this case, the action does have the same name as the context path.
> I modified the action name so that it wasn't the same as the context
> and it then worked.
>
> Cheers,
>
> Chris
>
>
> On Tue, May 25, 2010 at 6:49 AM, Ben Gunter <gunter...@gmail.com> wrote:
> > It's not supposed to do that. I just tried to replicate it using your
> > example, and I couldn't. Usually when someone complains that their
> context
> > path is being stripped off a URL it's because the context-relative path
> > begins with the context name. E.g., in context /foo you might have
> problems
> > working with the path /foo/bar (where you want the full path to be
> > /foo/foo/bar).
> >
> > If you can pass along some specific code that definitely triggers this in
> > your environment then I'll try it out. My testing was on the same version
> of
> > Stripes, Tomcat and Java.
> >
> > -Ben
> >
> > On Mon, May 24, 2010 at 8:17 PM, Chris Cheshire <cheshira...@gmail.com>
> > wrote:
> >>
> >> (Using Stripes 1.5.3, Tomcat 6.0.x, Java6)
> >>
> >> I have an action bound as "/action/{blah}" as part of an app installed
> >> under a sub-context /foo.
> >>
> >> In a stripes:form tag I put a stripes:param for blah and the resultant
> >> html shows the action url as just "/action/blah", instead of
> >> "/foo/action/blah".
> >>
> >> If I change the param to a hidden field instead, the action for the
> >> form is now "/foo/action".
> >>
> >> Why is the context being stripped from the form action url when a
> >> param is being used inside the form?
> >>
> >
> >
> ------------------------------------------------------------------------------
> >
> >
> > _______________________________________________
> > Stripes-users mailing list
> > Stripes-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/stripes-users
> >
> >
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------

_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to