You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chetan Pandey <cp...@BLUEsingapore.com> on 2006/08/23 06:21:36 UTC

Can we specify variables in html form tags action attribute

Dear All:

 

I am trying to put a variable in action attribute but it doesnt work.

 

 

<%String propertyaction = "/manageProperty?function=edit";

pageContext.setAttribute(propertyaction,"propertyaction");%>

 

<html:form action="${propertyaction}">

 

 

Thanks.

 

Chetan


Re: Can we specify variables in html form tags action attribute

Posted by Scott Van Wart <sc...@indosoft.com>.
Chetan Pandey wrote:
> pageContext.setAttribute(propertyaction,"propertyaction");%>
>   
pageContext.setAttribute() is a standard map-based pattern.  All of 
these use (key, value) and not (value, key) as you have above.  Swap the 
two arguments.

Remember your scope (third parameter).

- Scott

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


RE: Can we specify variables in html form tags action attribute

Posted by Vidya Mahavadi <Vi...@discovery.co.za>.
Exactly what you are trying to do.. 

-----Original Message-----
From: Chetan Pandey [mailto:cpandey@BLUEsingapore.com] 
Sent: Wednesday 23 August 2006 06:22
To: 'Struts Users Mailing List'
Subject: Can we specify variables in html form tags action attribute

Dear All:

 

I am trying to put a variable in action attribute but it doesnt work.

 

 

<%String propertyaction = "/manageProperty?function=edit";

pageContext.setAttribute(propertyaction,"propertyaction");%>

 

<html:form action="${propertyaction}">

 

 

Thanks.

 

Chetan

Discovery Holdings Limited

Registration number: 1999/007789/06

This message and any attachments are confidential and intended solely for the addressee. If you have received this message in error, please notify Discovery immediately, telephone number +27 11 529 2888. Any unauthorised use; alteration or dissemination of the contents of this email is strictly prohibited. In no event will Discovery or the sender be liable in any manner whatsoever to any person for any loss or any direct, indirect, special or consequential damages arising from use of this email or any linked website, including, without limitation, from any lost profits, business interruption, loss of programmes or other data that may be stored on any information handling system or otherwise from any assurance that this email is virus free even if Discovery is expressly advised of the possibility of such damages. Discovery is an Authorised Financial Services Provider. A full list of directors is available on our website at 
https://www.discovery.co.za/index_login.jhtml?p_content=/investor_relations/directorate.jhtml alternatively, to obtain a full list of Directors via email, please email directors_list@discovery.co.za

 

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