Thanks Dave.
I am using Struts 2.2.3. For #2 question i have a common jsp which is used for both Add and Edit operation. So on the basis of whether it is add/edit i want to set appropriate action. Well one tweak just now came in my mind is to set the action name in request scope and use this as OGNL in setting form action.

Best regards,
Sachin

On 27-05-2011 20:30, Dave Newton wrote:
On Fri, May 27, 2011 at 10:40 AM, Sachin Lale wrote:
1. In Jsp while displaying text box and i want this to populate from
ApplicationResource.properties file. I did this be adding getText() method
like below. Is this the only way?
<s:textfield name="name" label="%{getText('site.name')}"/>
Nope; you can use the "key" tag attribute to define the property name
and label key at once.

JSP:<s:textfield key="name"/>
Resource: name=Full Name

2. I want the 'action' property of s:form tag to be populated dynamically.
For this i added a instance variable in my action 'onsubmitAction' and
setting this value before action forward to result.
<s:form action="onSubmitAction">  or<s:form action="%{onSubmitAction}">. But
this is not working. Is there any way for this use case.
Not sure; I might consider doing this a different way, though, perhaps
through a custom JSP-based tag (possibly a thin layer over an existing
tag).

(Why that way? I find it more informative, and it allows some
interesting games to be played.)

In any case, which version of S2 are you using?

Dave

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


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

Reply via email to