You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Raul Montoya <rm...@intesys.es> on 2003/07/17 09:51:05 UTC
Acces form name in the jsp
Hi
I want to know if there is any way to obtain the form name associated to
a JSP without put it form the strut-config.
Because, if the name of the form change on the strut-config; i have to
change the name of the form in all of my JSP's.
Example of the problem:
<html:form action="/SaveReception">
<html:hidden property="id" />
<html:hidden property="stateId" />
<html:hidden property="editable" />
<table cellpadding=0 cellspacing=0 border=0 width="100%">
...
...
...
<logic:equal name="receptionForm" property="editable" scope="request"
value="true">
...
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Acces form name in the jsp
Posted by Sandeep Takhar <sa...@yahoo.com>.
good idea...
sandeep
--- Nicolas De Loof <ni...@cgey.com> wrote:
> No form-bean is "associated" with a JSP; Some JSP
> use <html:tags> to use form-beans.
>
> I use some constants for form-beans so that
> form-bean names are duplicated only one time : in
> constant definition class
> and in struts-config.xml
>
> public class Forms {
>
> public final static String USERFORM =
> "UserForm";
> ....
>
> }
>
> Then mly JSP use such code :
>
> <logic:equal name="<%= Forms.USERFORM %>"
> property="editable" value="true">
>
> This way I can change form-bean name without
> changing JSP (just need to force recompile them)
>
> Nico.
>
>
>
> Hi
> I want to know if there is any way to obtain the
> form name associated to
> a JSP without put it form the strut-config.
>
> Because, if the name of the form change on the
> strut-config; i have to
> change the name of the form in all of my JSP's.
>
> Example of the problem:
>
>
> <html:form action="/SaveReception">
> <html:hidden property="id" />
> <html:hidden property="stateId" />
> <html:hidden property="editable" />
> <table cellpadding=0 cellspacing=0 border=0
> width="100%">
> ...
> ...
> ...
> <logic:equal name="receptionForm"
> property="editable" scope="request"
> value="true">
> ...
>
> Thanks.
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Acces form name in the jsp
Posted by Nicolas De Loof <ni...@cgey.com>.
No form-bean is "associated" with a JSP; Some JSP use <html:tags> to use form-beans.
I use some constants for form-beans so that form-bean names are duplicated only one time : in constant definition class
and in struts-config.xml
public class Forms {
public final static String USERFORM = "UserForm";
....
}
Then mly JSP use such code :
<logic:equal name="<%= Forms.USERFORM %>" property="editable" value="true">
This way I can change form-bean name without changing JSP (just need to force recompile them)
Nico.
Hi
I want to know if there is any way to obtain the form name associated to
a JSP without put it form the strut-config.
Because, if the name of the form change on the strut-config; i have to
change the name of the form in all of my JSP's.
Example of the problem:
<html:form action="/SaveReception">
<html:hidden property="id" />
<html:hidden property="stateId" />
<html:hidden property="editable" />
<table cellpadding=0 cellspacing=0 border=0 width="100%">
...
...
...
<logic:equal name="receptionForm" property="editable" scope="request"
value="true">
...
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Acces form name in the jsp
Posted by Sandeep Takhar <sa...@yahoo.com>.
A bit of a hack is to have something like this in your
action
request.setAttribute("otherName", theForm)
This will make it work on the jsp anyways for now...
sandeep
--- Nagendra Kumar O V S <na...@ikigo.com> wrote:
> hi,
>
> u can use "nested" taglib which will not require
> "name" attribute, it takes
> the form_name associated with the <html:form
>
>
> <html:form action="/SaveReception">
> <html:hidden property="id" />
> <html:hidden property="stateId" />
> <html:hidden property="editable" />
> <table cellpadding=0 cellspacing=0 border=0
> width="100%">
> .
> .
> .
> <nested:equal property="editable" scope="request"
> value="true">
> ............
> </nested:equal>
>
>
>
> -- nagi
>
>
>
> -------Original Message-------
>
> From: Struts Users Mailing List
> Date: Thursday, July 17, 2003 01:23:32 PM
> To: struts-user@jakarta.apache.org
> Subject: Acces form name in the jsp
>
> Hi
> I want to know if there is any way to obtain the
> form name associated to
> a JSP without put it form the strut-config.
>
> Because, if the name of the form change on the
> strut-config; i have to
> change the name of the form in all of my JSP's.
>
> Example of the problem:
>
>
> <html:form action="/SaveReception">
> <html:hidden property="id" />
> <html:hidden property="stateId" />
> <html:hidden property="editable" />
> <table cellpadding=0 cellspacing=0 border=0
> width="100%">
> .
> .
> .
> <logic:equal name="receptionForm"
> property="editable" scope="request"
> value="true">
> .
>
> Thanks.
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
>
>
> .
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Acces form name in the jsp
Posted by Nagendra Kumar O V S <na...@ikigo.com>.
hi,
u can use "nested" taglib which will not require "name" attribute, it takes
the form_name associated with the <html:form
<html:form action="/SaveReception">
<html:hidden property="id" />
<html:hidden property="stateId" />
<html:hidden property="editable" />
<table cellpadding=0 cellspacing=0 border=0 width="100%">
.
.
.
<nested:equal property="editable" scope="request" value="true">
............
</nested:equal>
-- nagi
-------Original Message-------
From: Struts Users Mailing List
Date: Thursday, July 17, 2003 01:23:32 PM
To: struts-user@jakarta.apache.org
Subject: Acces form name in the jsp
Hi
I want to know if there is any way to obtain the form name associated to
a JSP without put it form the strut-config.
Because, if the name of the form change on the strut-config; i have to
change the name of the form in all of my JSP's.
Example of the problem:
<html:form action="/SaveReception">
<html:hidden property="id" />
<html:hidden property="stateId" />
<html:hidden property="editable" />
<table cellpadding=0 cellspacing=0 border=0 width="100%">
.
.
.
<logic:equal name="receptionForm" property="editable" scope="request"
value="true">
.
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
.