Oops... was playing around with a number of solutions. This one won't
work because it didn't solve the fact that form action="/article" is
unable to hit the @UrlBinding for the ArticleActionBean.
So far what appears to work is doing the following:
<s:form action="${actionBean.formUrlBinding}" method="POST">
And then having on the action bean:
public String getFormUrlBinding() {
StringBuilder sb = new StringBuilder();
sb.append("/article/").append(this.authorId).append('/').append(this.id).append('/').append(this.titleUrlified);
return (sb.toString());
}
Still appears to be a hack as I am duplicating the @UrlBinding but at
least its encapsulated in the ActionBean... if that is any solace ;-)
Cheers,
--Nikolaos
Nikolaos Giannopoulos wrote:
> Hi,
>
> So I figured out a solution to the problem:
>
> <s:hidden name="authorId"></s:hidden>
> <s:hidden name="id"></s:hidden>
> <s:hidden name="titleUrlified"></s:hidden>
>
> At first I thought it would be nice to force Stripes to build the
> complete @UrlBinding i.e. it is already obviously consulting the
> @UrlBinding to produce "/article" but understand why it isn't so. Even
> in my case above I didn't want "event" to be the same so I guess this
> offers the most flexibility... because how far do you go in binding
> parameters is not black & white.
>
> Cheers,
>
> --Nikolaos
>
>
>
> Nikolaos Giannopoulos wrote:
>
>> Hi,
>>
>> We have the following Url binding:
>> @UrlBinding("/article/{authorId}/{id}/{titleUrlified}/{$event}")
>>
>> And when we direct to the following url:
>> /web/article////add
>>
>> It does a ForwardResolution to a form which contains:
>> <s:form
>> beanclass="org.test.ui.web.action.content.ArticleActionBean" method="POST">
>> ...
>> <s:submit name="save" />
>> <s:submit name="cancel" />
>> </s:form>
>>
>> However the HTML output is as follows:
>> <form action="/web/article" method="POST">
>> ...
>> <input name="save" value="Save" type="submit" />
>> <input name="cancel" value="Cancel" type="submit" />
>> </form>
>>
>> But the action ="/web/article" isn't sufficient to hit our Url
>> binding... when we click on the "save" or "cancel" buttons???
>>
>> Am I missing something obvious like in the case of addParameter on
>> RedirectResolution?
>>
>> Anyone?
>>
>> --Nikolaos
>>
>>
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users