开发者

How to pass a non-string Java object to an ActionBean - Stripes

I'm using the Stripes framework. I want to pass non-string Objects to an ActionBean. Is this possible?

I am trying to do:

<s:url var="statementUrl" beanclass="sempedia.action.StatementActionBean" prependContext="false" >
    <s:param name="property" value="${row.key}" />
    <s:param name="values" value="${row.value}" />
    <s:param name="myString" value="Why kick a moo cow" />
</s:url>
&开发者_开发问答lt;jsp:include page="${statementUrl}"/>

Where row.key resolvs to a custom class I have defined and row.value is an ArrayList of a custom class I have defined


Nope, nothing really.

I mean, there's always a way. You could serialize the forms out to a byte array and Base64 encode in to a string and then pass that as an argument.

But then you start running in to URL limits (they can only be so long).

If practical, you could save the data in the Session and simply refer to it later. You could use Stripes FlashScope, which stuffs it in the Session but only for the next request, then it goes away.

You could encode the data in to a HTML form, but then you would need to POST that rather than use a GET for it.

You could save the data out to another store (a database, memcache, something like that), and simply return a key to it, then pass in the key.

Really depends on the lifecycle of what you're trying to do, and the nature of the data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜