I have started to use JSTL this week. I simply love it !!!
However, I have one small problem that I cannot seem to get working.
Here is a snippet of code that works fine:
c:forEach items=${dynaCWWHistoryForm.map.historyItems} var=
historyItems varStatus=status
tr valign=top
td id=cc:out
PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 14, 2005 7:59 AM
To: user@struts.apache.org
Subject: JSTL simply love it however ...
I have started to use JSTL this week. I simply love it !!!
However, I have one small problem that I cannot seem to get working.
Here is a snippet of code
Users Mailing List
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)
Subject:RE: JSTL simply love it however ...
Classification:
I think ${status.index} in place of s_SOMETHING_HERE would work fine
[EMAIL PROTECTED] wrote:
Niether solution works...
The expression is never evaluated. The output is:
select name=historyItems[2].scheduleTypeId
onchange=addTableRow('historyTable','sc:out value='${status.index}'/')
class=dropdowns2
Are you using the EL version of the struts tags?
Dave
:Re: JSTL simply love it however ...
Classification:
[EMAIL PROTECTED] wrote:
Niether solution works...
The expression is never evaluated. The output is:
select name=historyItems[2].scheduleTypeId
onchange=addTableRow('historyTable','sc:out
value='${status.index}'/')
class=dropdowns2
[EMAIL PROTECTED] wrote:
How can I tell which version of the struts tags?
You choose to use the struts EL tags by a) using the struts EL tld (like
struts-html-el.tld) and b) by having the struts-el tag JAR file. I don't
know if they come by default with the latest release or not; you'd have
Okay... I am not using the Struts EL taglibs.
Should I be using them?
You choose to use the struts EL tags by a) using the struts EL tld (like
struts-html-el.tld) and b) by having the struts-el tag JAR file. I don't
know if they come by default with the latest release or not; you'd have
to
I think Dave's got it. Use the struts-el tags if you want to have EL
expressions instead of RT expressions (%= ... %)
If you want/have to stick with RT, then you'd need this instead of
${status.index}
%= ((javax.servlet.jsp.jstl.core.LoopTagStatus)
[EMAIL PROTECTED] wrote the following on 4/14/2005 12:03 PM:
Okay... I am not using the Struts EL taglibs.
Should I be using them?
I think you should. Makes the code a lot cleaner. Remember if you are
using a JSP2.0 container (ie Tomcat 5), just use the regular html tags
(not the el ones). (Then
Okay...
I tried the following:
html:select name=historyItems property=scheduleTypeId indexed=true
styleClass=dropdowns2
onchange=addTableRow('historyTable',
's%=((javax.servlet.jsp.jstl.core.LoopTagStatus)
pageContext.getAttribute(status)).getIndex()%')
html:optionsCollection
I think that with RT the attribute is all expression or no expression.
so try :
html:select name=historyItems
property=scheduleTypeId indexed=true
styleClass=dropdowns2
onchange=% = addTableRow('historyTable', 's +
((javax.servlet.jsp.jstl.core.LoopTagStatus)
Umh... I am now getting this error: Attribute addTableRow( has now value.
I have downloaded the Struts 1.2.4 and noticed that there is a lib
directory and then there is a contrib/lib.
What is necessary to use the Struts-EL tags?
I think that with RT the attribute is all expression or no
The error is suggesting that it can't find an entry for status in the
page scope of your page. Do you still have the c:forEach in there?
If you have the scope attribute, make sure it's set to page. Otherwise
you'll have to replace pageContext with request, or session depending on
your
13 matches
Mail list logo