Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

RE: Scriptlets in Struts tag

Frank W. Zammetti

2007-02-27

Replies:

I believe your running into something I ran into the other day, something
I didn't know... if you have an attribute:

someAttribute="123<%=someVar%>"

...the value of someVar isn't inserted. However, if you do:

<% someVar = "123" + someVar %>
someAttribute="<%=someVar%>"

...that works. The combination of static text and a scriplet seems to not
work. Give it a shot, see if that does the trick for you...

Frank


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: fzammetti@(protected)
Author of "Practical Ajax Projects With Java Technology"
(2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Tue, February 27, 2007 1:40 pm, Chaudhary, Harsh wrote:
> I tried that. But in the HTML rendered, the id attribute is rendered as:
>
> id='BLABLA<%=indexVal.intValue()%>'
>
> Harsh.
>
> -----Original Message-----
> From: Nuwan Chandrasoma [mailto:mymailnot@(protected)]
> Sent: Tuesday, February 27, 2007 6:09 PM
> To: Struts Users Mailing List
> Subject: Re: Scriptlets in Struts tag
>
>
> hi,
>
> try this code.
>
> <%=indexVal.intValue()%>
>
> Regards,
>
> Nuwan.
>
> ----- Original Message -----
> From: "Chaudhary, Harsh" <HCHAUDHA@(protected)>
> To: "Struts Users Mailing List" <user@(protected)>
> Sent: Tuesday, February 27, 2007 6:22 PM
> Subject: Scriptlets in Struts tag
>
>
> My code:
>
> <logic:iterate name="FDA3Form" property="dependentsInfoAl" id="element"
> indexId="indexVal">
> <html:text name="element" property="dependentName" size="20"
> maxlength="35" indexed="true" style="display:block;"
> styleId='BLABLABLA----->>><%= indexVal %><<<-----'/>
> </logic:iterate>
>
> The code within the ----->>> and <<<----- is not working. I think it
> might be due to the way the tag is parsed in the JSP but does anyone
> know of a way to do this.
>
> Basically, I would like to have id='BLA1', id='BLA2' ...... in the
> rendered HTML.
>
> Harsh.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.