You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by D'Ottavio Alessandro <al...@elsagdatamat.com> on 2008/10/22 18:57:08 UTC

TAG embeded inside TAG struts 1

 

Hallo 

 

I need to set dinamically poperties of the TAG struts

 

Example

 

I have a easy form like this:

 

<html:form action="\MyAction" >

            <html:text property="myproperty"  readonly="true"   />

</html:form>     

 

 

I wont that read-only properties assume value true or false dynamically
using a specific bean that represent for me a mask on with field are
read-only and witch other no...

I have a bean with the properties of the filed and i wont to do someting
like this 

 

<html:text property="myproperty"  readonly=<bean:write
name="readonlyproperties" property="myproperty">   />

 

Obviously in the property myproperty of the bean readonlyproperties
there is a value string that is "true" or "false"

 

So I wont embed a TAG  inside another TAG,  in this specific case
beand:write inside a tag html:text

 

Thanks

 

Ing. Alessandro D'Ottavio
Elsag Datamat S.p.A. - Banking & Finance Division
Financing Systems Area Department - Tadawul
Via Naide 43 - 00155 - Rome Italy
Fax Number : +39 06 22796324
Office  : +39 06 22724617
Mobile : +39 3349067696
e-mail : alessandro.dottavio@elsagdatamat.com
<BL...@elsagdatamat.com> 

 



"Questo messaggio ed ogni suo allegato sono confidenziali e possono essere riservati o, comunque, protetti dall'essere diffusi. Se il ricevente non � il destinatario diretto del presente messaggio, � pregato di contattare l'originario mittente e di cancellare questo messaggio ed ogni suo allegato dal sistema di posta. Se il ricevente non � il destinatario diretto del presente messaggio, sono vietati l'uso, la riproduzione e la stampa di questo messaggio e di ogni suo allegato, nonch� la diffusione del loro contenuto a qualsiasi altro soggetto"
*****
"This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please contact the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not use, copy or print this message or attachment or disclose the contents to any other person."

Re: R: R: TAG embeded inside TAG struts 1

Posted by Antonio <an...@gmail.com>.
Il 23 ottobre 2008 17.05, D'Ottavio Alessandro
<al...@elsagdatamat.com> ha scritto:
> But One question.
> The differences between tags-html and tags-html-el are not in the tag that are identical.
>
> Why I should prefer to use tags-html? If tags-html-el give me the same TAG and also the possibility to use the EL expression
>
> Are there differences in the performance?

The impact on the performances are almost the same if you are using a
JSP 2.0-enabled container, so don't worry.
If you like Struts EL, just use it.

> So when it's not necessary to use EL I will import only tags-html and not tags-html-el

Right, Struts EL is incompatible with JSP 2.0

Antonio

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


R: R: TAG embeded inside TAG struts 1

Posted by D'Ottavio Alessandro <al...@elsagdatamat.com>.
Thanks Antonio, David 
Using the taglib tags-html-el I can use EL expression

But One question.
The differences between tags-html and tags-html-el are not in the tag that are identical.

Why I should prefer to use tags-html? If tags-html-el give me the same TAG and also the possibility to use the EL expression

Are there differences in the performance? 
So when it's not necessary to use EL I will import only tags-html and not tags-html-el


Ing. Alessandro D'Ottavio
Elsag Datamat S.p.A. - Banking & Finance Division
Financing Systems Area Department - Tadawul
Via Naide 43 - 00155 - Rome Italy
Fax Number : +39 06 22796324
Office  : +39 06 22724617
Mobile : +39 3349067696
e-mail : alessandro.dottavio@elsagdatamat.com

-----Messaggio originale-----
Da: Antonio [mailto:antonio.petrelli@gmail.com] 
Inviato: giovedì 23 ottobre 2008 16.17
A: Struts Users Mailing List
Oggetto: Re: R: R: TAG embeded inside TAG struts 1

Il 23 ottobre 2008 16.18, D'Ottavio Alessandro
<al...@elsagdatamat.com> ha > That mean that with my
Application Server version I can't set any attribute dynamically
inside the STRUTS TAG?

You have to use the EL version of Struts tags:
http://struts.apache.org/1.3.8/struts-el/index.html

Antonio

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


"Questo messaggio ed ogni suo allegato sono confidenziali e possono essere riservati o, comunque, protetti dall'essere diffusi. Se il ricevente non é il destinatario diretto del presente messaggio, é pregato di contattare l'originario mittente e di cancellare questo messaggio ed ogni suo allegato dal sistema di posta. Se il ricevente non é il destinatario diretto del presente messaggio, sono vietati l'uso, la riproduzione e la stampa di questo messaggio e di ogni suo allegato, nonché la diffusione del loro contenuto a qualsiasi altro soggetto"
*****
"This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please contact the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not use, copy or print this message or attachment or disclose the contents to any other person."

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


Re: R: R: TAG embeded inside TAG struts 1

Posted by Antonio <an...@gmail.com>.
Il 23 ottobre 2008 16.18, D'Ottavio Alessandro
<al...@elsagdatamat.com> ha > That mean that with my
Application Server version I can't set any attribute dynamically
inside the STRUTS TAG?

You have to use the EL version of Struts tags:
http://struts.apache.org/1.3.8/struts-el/index.html

Antonio

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


RE: R: TAG embeded inside TAG struts 1

Posted by "Kawczynski, David" <da...@merck.com>.
While it's dirty, you can use a scriptlet variable to specify the 
dynamic value in a struts html tag.

<% Object isEditable = "false"; %>
<html:text property="myproperty" readonly="<%= isEditable %>"/>

It gets even dirtier when the variable you wish to expose already 
exists in some scope.  Hopefully you know the scope.  Assuming it's
In the request scope:

<% Object isEditable = request.getAttribute("isEditable"); %>
<html:text property="myproperty" readonly="<%= isEditable %>"/>

Did I mention this is a very dirty approach?

-----Original Message-----
From: D'Ottavio Alessandro [mailto:alessandro.dottavio@elsagdatamat.com] 
Sent: Thursday, October 23, 2008 10:18 AM
To: Struts Users Mailing List
Subject: R: R: TAG embeded inside TAG struts 1

IBM WebSphere 5

No good for JSP 2.0 and Servlet 2.4

That mean if I want to set particulars attribute about the input field of forms like disabled, maxlength, readonly, with a EL expression
I can't use the <html:text> tag, but normal HTML.

That mean that with my Application Server version I can't set any attribute dynamically inside the STRUTS TAG?



Ing. Alessandro D'Ottavio
Elsag Datamat S.p.A. - Banking & Finance Division
Financing Systems Area Department - Tadawul
Via Naide 43 - 00155 - Rome Italy
Fax Number : +39 06 22796324
Office  : +39 06 22724617
Mobile : +39 3349067696
e-mail : alessandro.dottavio@elsagdatamat.com

-----Messaggio originale-----
Da: Antonio [mailto:antonio.petrelli@gmail.com] 
Inviato: giovedì 23 ottobre 2008 16.01
A: Struts Users Mailing List
Oggetto: Re: R: TAG embeded inside TAG struts 1

Il 23 ottobre 2008 15.54, D'Ottavio Alessandro
<al...@elsagdatamat.com> ha scritto:
> I'm using struts 1.3.8 and JSTL 1.0.6  JSP 1.2

This is the problem, you need at least JSP 2.0 and Servlet 2.4 (and
JSTL 1.1.x). What application server are you using?

Antonio

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



"Questo messaggio ed ogni suo allegato sono confidenziali e possono essere riservati o, comunque, protetti dall'essere diffusi. Se il ricevente non é il destinatario diretto del presente messaggio, é pregato di contattare l'originario mittente e di cancellare questo messaggio ed ogni suo allegato dal sistema di posta. Se il ricevente non é il destinatario diretto del presente messaggio, sono vietati l'uso, la riproduzione e la stampa di questo messaggio e di ogni suo allegato, nonché la diffusione del loro contenuto a qualsiasi altro soggetto"
*****
"This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please contact the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not use, copy or print this message or attachment or disclose the contents to any other person."

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

Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.


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


R: R: TAG embeded inside TAG struts 1

Posted by D'Ottavio Alessandro <al...@elsagdatamat.com>.
IBM WebSphere 5

No good for JSP 2.0 and Servlet 2.4

That mean if I want to set particulars attribute about the input field of forms like disabled, maxlength, readonly, with a EL expression
I can't use the <html:text> tag, but normal HTML.

That mean that with my Application Server version I can't set any attribute dynamically inside the STRUTS TAG?



Ing. Alessandro D'Ottavio
Elsag Datamat S.p.A. - Banking & Finance Division
Financing Systems Area Department - Tadawul
Via Naide 43 - 00155 - Rome Italy
Fax Number : +39 06 22796324
Office  : +39 06 22724617
Mobile : +39 3349067696
e-mail : alessandro.dottavio@elsagdatamat.com

-----Messaggio originale-----
Da: Antonio [mailto:antonio.petrelli@gmail.com] 
Inviato: giovedì 23 ottobre 2008 16.01
A: Struts Users Mailing List
Oggetto: Re: R: TAG embeded inside TAG struts 1

Il 23 ottobre 2008 15.54, D'Ottavio Alessandro
<al...@elsagdatamat.com> ha scritto:
> I'm using struts 1.3.8 and JSTL 1.0.6  JSP 1.2

This is the problem, you need at least JSP 2.0 and Servlet 2.4 (and
JSTL 1.1.x). What application server are you using?

Antonio

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



"Questo messaggio ed ogni suo allegato sono confidenziali e possono essere riservati o, comunque, protetti dall'essere diffusi. Se il ricevente non é il destinatario diretto del presente messaggio, é pregato di contattare l'originario mittente e di cancellare questo messaggio ed ogni suo allegato dal sistema di posta. Se il ricevente non é il destinatario diretto del presente messaggio, sono vietati l'uso, la riproduzione e la stampa di questo messaggio e di ogni suo allegato, nonché la diffusione del loro contenuto a qualsiasi altro soggetto"
*****
"This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please contact the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not use, copy or print this message or attachment or disclose the contents to any other person."

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


Re: R: TAG embeded inside TAG struts 1

Posted by Antonio <an...@gmail.com>.
Il 23 ottobre 2008 15.54, D'Ottavio Alessandro
<al...@elsagdatamat.com> ha scritto:
> I'm using struts 1.3.8 and JSTL 1.0.6  JSP 1.2

This is the problem, you need at least JSP 2.0 and Servlet 2.4 (and
JSTL 1.1.x). What application server are you using?

Antonio

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


R: TAG embeded inside TAG struts 1

Posted by D'Ottavio Alessandro <al...@elsagdatamat.com>.

<html:text property="myproperty" readonly="${readonlyproperties.myproperty}"/>

If I do like this the EL is not evaluated in the STRUTS TAG
I say this because after I tried to put the output whit the JSTL c:out and I see value of the expression correctly

Example 

In the request   variable myValue="test"

<html:test property="MyPro" value="${myValue}"/>  output result "${myValue}" EL not evaluated   

<c:out value="${myValue}"/> output result "test"  EL evaluated

Why the EL are not evaluated in the STRUTS TAG?

I'm using struts 1.3.8 and JSTL 1.0.6  JSP 1.2



-----Messaggio originale-----
Da: Antonio [mailto:antonio.petrelli@gmail.com] 
Inviato: giovedì 23 ottobre 2008 9.19
A: Struts Users Mailing List
Oggetto: Re: TAG embeded inside TAG struts 1

2008/10/22 D'Ottavio Alessandro <al...@elsagdatamat.com>:
> <html:text property="myproperty"  readonly=<bean:write
> name="readonlyproperties" property="myproperty">   />

You cannot nest tags in JSP, but you can use EL (if you are using at
least Servlet 2.4):

<html:text property="myproperty"
readonly="${readonlyproperties.myproperty}"  />

HTH
Antonio

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



"Questo messaggio ed ogni suo allegato sono confidenziali e possono essere riservati o, comunque, protetti dall'essere diffusi. Se il ricevente non é il destinatario diretto del presente messaggio, é pregato di contattare l'originario mittente e di cancellare questo messaggio ed ogni suo allegato dal sistema di posta. Se il ricevente non é il destinatario diretto del presente messaggio, sono vietati l'uso, la riproduzione e la stampa di questo messaggio e di ogni suo allegato, nonché la diffusione del loro contenuto a qualsiasi altro soggetto"
*****
"This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please contact the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not use, copy or print this message or attachment or disclose the contents to any other person."

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


Re: TAG embeded inside TAG struts 1

Posted by Antonio <an...@gmail.com>.
2008/10/22 D'Ottavio Alessandro <al...@elsagdatamat.com>:
> <html:text property="myproperty"  readonly=<bean:write
> name="readonlyproperties" property="myproperty">   />

You cannot nest tags in JSP, but you can use EL (if you are using at
least Servlet 2.4):

<html:text property="myproperty"
readonly="${readonlyproperties.myproperty}"  />

HTH
Antonio

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


RE: TAG embeded inside TAG struts 1

Posted by gcj <ga...@comcast.net>.
Could you use JSTL to accomplish the same thing?  For example,

<c:choose>
	<c:when test='${empty readOnly}'>
        	<html:text property="myproperty"  readonly="false"/>

	</c:when>
	<c:otherwise>
         	<html:text property="myproperty"  readonly="true"/>

	</c:otherwise>
</c:choose>

-----Original Message-----
From: D'Ottavio Alessandro [mailto:alessandro.dottavio@elsagdatamat.com] 
Sent: Wednesday, October 22, 2008 10:57 AM
To: user@struts.apache.org
Subject: TAG embeded inside TAG struts 1

 

Hallo 

 

I need to set dinamically poperties of the TAG struts

 

Example

 

I have a easy form like this:

 

<html:form action="\MyAction" >

            <html:text property="myproperty"  readonly="true"   />

</html:form>     

 

 

I wont that read-only properties assume value true or false dynamically
using a specific bean that represent for me a mask on with field are
read-only and witch other no...

I have a bean with the properties of the filed and i wont to do someting
like this 

 

<html:text property="myproperty"  readonly=<bean:write
name="readonlyproperties" property="myproperty">   />

 

Obviously in the property myproperty of the bean readonlyproperties
there is a value string that is "true" or "false"

 

So I wont embed a TAG  inside another TAG,  in this specific case
beand:write inside a tag html:text

 

Thanks

 

Ing. Alessandro D'Ottavio
Elsag Datamat S.p.A. - Banking & Finance Division
Financing Systems Area Department - Tadawul
Via Naide 43 - 00155 - Rome Italy
Fax Number : +39 06 22796324
Office  : +39 06 22724617
Mobile : +39 3349067696
e-mail : alessandro.dottavio@elsagdatamat.com
<BL...@elsagdatamat.com> 

 



"Questo messaggio ed ogni suo allegato sono confidenziali e possono essere
riservati o, comunque, protetti dall'essere diffusi. Se il ricevente non i
il destinatario diretto del presente messaggio, i pregato di contattare
l'originario mittente e di cancellare questo messaggio ed ogni suo allegato
dal sistema di posta. Se il ricevente non i il destinatario diretto del
presente messaggio, sono vietati l'uso, la riproduzione e la stampa di
questo messaggio e di ogni suo allegato, nonchi la diffusione del loro
contenuto a qualsiasi altro soggetto"
*****
"This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure. If you are not the intended recipient,
please contact the sender and delete this message and any attachment from
your system. If you are not the intended recipient you must not use, copy or
print this message or attachment or disclose the contents to any other
person."


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