You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andrew Hill <an...@gridnode.com> on 2002/09/27 15:39:44 UTC

RE: changing "action" for a form dynamically

This has nothing to do with the action attribute per se, but rather the sad
fact that you cannot 'nest' jsp tags in that manner.

You will need to use an ugly scriptlet in place of that nice clean
bean:write tag to render the attribute value to the page.



-----Original Message-----
From: deepank [mailto:deepank@sasken.com]
Sent: Friday, September 27, 2002 21:42
To: Struts Users Mailing List
Subject: changing "action" for a form dynamically


Hi,


how can i cange the "action" attrbute of the html:form tag
dynamically, so that the path that to which the form will be submitted
changes everytime the JSP is brought up

if i do something like this in my action class


if (((ReviewTeamForm)form).getCommand()!=null)
  request.setAttribute("performAction", "/reviewTeam");
 else
  request.setAttribute("performAction", "/editReviewTeam");

then in the jsp i do
<html:form name="someform" type =
"com.sasken.erp.sdlc.action.ReviewTeamForm" action ="<bean:write
name='performAction' />" >

this does not work

any help help willbe appreciated

Deepank


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: changing "action" for a form dynamically

Posted by Eddie Bush <ek...@swbell.net>.
It's been added to contrib (but not committed yet that I can tell).  You 
can find it as an attachment to bug ... Well, I'll quote David :-) :

>The library isn't in the form of a patch, it's an
>independent library, and the distribution is an attachment on the enhancement
>request (#12365).
>
You'll have to rename it to struts-el.tar.gz.  Bugzilla will want to 
name it as a CGI file.

Andrew Hill wrote:

>I keep seeing references to this struts-el in the list.
>While Im not using JSPs myself I wouldnt mind taking a look at what features
>it provides.
>Where does one get it from?
>

-- 
Eddie Bush




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: changing "action" for a form dynamically

Posted by Andrew Hill <an...@gridnode.com>.
I keep seeing references to this struts-el in the list.
While Im not using JSPs myself I wouldnt mind taking a look at what features
it provides.
Where does one get it from?

-----Original Message-----
From: Eddie Bush [mailto:ekbush@swbell.net]
Sent: Friday, September 27, 2002 22:42
To: Struts Users Mailing List
Subject: Re: changing "action" for a form dynamically


Or use the newly-contributed struts-el taglib.  You can get rid of the
RTE (what I think Andrew was calling a scriplet) and use an
EL-expression to refer to the name of your form once you're using struts-el.

--
Eddie Bush




--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: changing "action" for a form dynamically

Posted by Eddie Bush <ek...@swbell.net>.
Or use the newly-contributed struts-el taglib.  You can get rid of the 
RTE (what I think Andrew was calling a scriplet) and use an 
EL-expression to refer to the name of your form once you're using struts-el.

-- 
Eddie Bush




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>