I can never remember which things can be accessed through EL, but my
guess is that you can't get "language" because the top of the struts
value stack is not the same thing as a request scoped variable.
Instead of the el notation try using the s:property tag like this -
<s:property value="%{#language.active}" /> notice the hash mark in
front of language... This is because you created a named variable with
the iterator tag and this is the explicit way to address that
variable.-Wes On 8/20/09, Tommy Pham <[email protected]> wrote: > Hi, > > Looks like I'm still having problems with the <s:checkbox />. I have a > LinkedHashMap list which I want to iterate and show the contents. This is > the code for it: > > <s:if test="%{!list.isEmpty}"> > <table border="1" cellspacing="0" cellpadding="3"> > <tr> > <td>ID</td> > <td>ISO <br /> > Code 2</td> > <td>ISO <br /> > Code 3</td> > <td>Name</td> > <td>Native Name</td> > <td>Active</td> > <td>Image</td> > </tr> > <s:iterator var="language" value="list.values"> > <tr> > <td>${language.languageId}</td> > <td>${language.isoCode2}</td> > <td>${language.isoCode3}</td> > <td>${language.name}</td> > <td>${language.nativeName}</td> > <td>${language.active} <s:checkbox name="languageActive" > value="%{language.active}" disabled="true" /> > <input type="checkbox" disabled > <s:if test="%{language.active}">checked</s:if> /> > <input type="checkbox" disabled > <c:if test="${language.active}">checked</c:if> /></td> > <td>${language.image}</td> > </tr> > <tr> > <td> </td> > <td> </td> > <td> </td> > <td> </td> > <td> </td> > <td> </td> > <td> </td> > </tr> > <tr> > <td> </td> > <td> </td> > <td> </td> > <td> </td> > <td> </td> > <td> </td> > <td> </td> > </tr> > </s:iterator> > </table> > </s:if> > > The only way I can get a <input type="checkbox" /> to show correctly is > using JSTL1.2 c tag. I've tried using just language.active without the %{} > without success even though the 1st <c:if test="!list.isEmpty"> works fine > without %{} (pls see SS http://img20.imageshack.us/img20/8029/languages.jpg > ). Anyone has any ideas why it doesn't work? devmode is true in struts.xml. > My log4j setting is info. The only thing I see that is above INFO is a > bunch of: > 2009-08-20 16:40:07,895 WARN [OgnlValueStack ] Could not find property > [struts.actionMapping] > 2009-08-20 16:40:07,807 WARN [OgnlValueStack ] Could not find property > [templateDir] > 2009-08-20 16:40:07,807 WARN [OgnlValueStack ] Could not find property > [theme] > > These WARN logs go away when devmode is false. > > I've been at this for 2 days now. I expected struts to be a learning a > curve but I had faster results just implementing JSTL1.2 to the same point > on this :(... > > TIA, > Tommy > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

