c:forEach tag

Hi,
I'm trying to use the forEach tag in the jstl in order to display the contents of an Hashtable. The table is written in the session and arrives populated with the results of a SELECT query.
The elements of the table are instances of a class of mine, and I'd like to display some of the fields (all accessible by getters and setters) of this class.
The fact is that if I try to write the elements of the table, I obviously get the class of the elements followed by their ID number (like Object@64383265), but if I try to access a field, I get nothing.
Here is the code reading the elements:
risposta = Hashtable in the session, contains dap.obj.Notizia objects
<jsp:useBean id="notizia" scope="page" class="dap.obj.Notizia" />
<c:forEach var="notizia" items="${risposta}">
     <c:out value="${notizia}" />
</c:forEach>
And if I try to replace the line of output with:
     <c:out value="${notizia.ID}" />
I obtain an error saying:
(...) Unable to find a value for "ID" in object of class "java.util.Hashtable$Entry" using operator "." (null)
If I use
     <c:out value="${notizia.[ID]}" />
no errors and nothing appears..
Do I need to know something about the cast inside the tags of jstl or am I trying to do something wrong?
I admit that these are my first days with jstl, but I've searched among some books with no results. Thanks in advantage for your jelp

Seeing as you are accessing a Map, the object you get back is a Map.Entry
So you can access it as ${notizia.key} to get the hash key, and ${notizia.value} to get the object of type Notizia
<c:forEach var="notizia" items="${risposta}">
<c:out value="${notizia.value.ID}" />
</c:forEach>Cheers,
evnafets

Similar Messages

  • Using a viewobject with foreach tag in .jsp

    Hi guys I have the following scenario:
    1- I call a certain .jsp page
    2- a controller class (extends servlet) is called, this class: takes a view object (let's call it view), executes it's query, forwards the result to the jsp page.
    3- jsp page has a foreach tag that iterates over the query result.
    My problem is that foreach tag only takes list or array in its "items" attribute.
    Now is there a way to put the view object result in an array/list? in other words in my servlet what should I put in the request so that the foreach tag can iterate over the rows of the query. Thank you in advance for the reply.

    This code works fine for me:
    <%@ taglib uri="/jstl-c" prefix="c" %>
    <html>
         <body>
         <%
              int array[] = new int[] {1,2};
              session.setAttribute("array", array);
              String arrayNames[] = new String[]{"One", "Two"};
              session.setAttribute("arrayNames", arrayNames);
         %>
              <form action="?">
              <select name="select">
                   <c:forEach items='${ sessionScope.array}' var="row">
                        <c:choose>  
                             <c:when test="${param.select== row}"> >
                                  <option value="<c:out value='${row}'/>" selected><c:out value="${sessionScope.arrayNames[row-1]}"/></option>
                             </c:when>   
                             <c:otherwise>
                                  <option value="<c:out value='${row}'/>"><c:out value="${sessionScope.arrayNames[row-1]}"/></option>
                             </c:otherwise>
                        </c:choose>
                   </c:forEach>
              </select>
              <input type="submit" name="submit" value="submit"></input>
              </form>
         </body>
    </html>
    good luck.
    MatrixPooh
    www.bizdisplay.com

  • How use forEach tag in xml tag library

    Hi,
    Can u please explain the procedure for using forEach tag for displaying the parsed xml tags?
    This is the code snippet
    <%@ page contentType="text/html" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
    <html>
    <body>
         <c:import url="\books.xml" var="url" />
         <x:parse xml="${url}" var="doc" />
              <x:forEach var="n" select="${doc}/books/book">
                   <x:out select="${n}/title"/>
                   <x:out select="${n}/author" />
         </x:forEach>
    </body>
    </html>
    but I got the fallowing error.
    java.lang.NoClassDefFoundError: org/saxpath/SAXPathException
         at org.apache.taglibs.standard.tag.common.xml.ForEachTag.prepare(ForEachTag.java:51)
         at javax.servlet.jsp.jstl.core.LoopTagSupport.doStartTag(LoopTagSupport.java:262)
         at jsp_servlet.__index._jspService(__index.java:197)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    Just the same way as you do in JSP. Since JSF 1.2 you can use unified EL #{ } in c:forEach.
    You can also use Tomahawk's [t:dataList|http://myfaces.apache.org/tomahawk-project/tomahawk12/tagdoc/t_dataList.html] by the way. It is more efficient.

  • Using ViewObject with a foreach tag in a jsp

    Hi guys I have the following scenario:
    1- I call a certain .jsp page
    2- a controller class (extends servlet) is called, this class: takes a view object, executes it's query, forwards the result to the jsp page.
    3- jsp page has a foreach tag that iterates over the query result.
    My problem is that foreach tag only takes list or array in its "items" attribute.
    Now is there a way to put the view object result in an array/list? in other words in my servlet what should I put in the request so that the foreach tag can iterate over the rows of the query. Thank you in advance for the reply.

    Thank you for the reply.
    But my application is not a web based one.
    I am developing a framework (as swf) in which some other swf files (target files) are played as movie clip. Since the framework swf should be considered as a general one, no direct linking to the other swfs preferred. I follow some (my own) rules to get things worked. For example, I need to show a simple movie cilp as the title in the framework. This movie clip will be different in different target swfs, and they will be stored inside the target swfs itself. I was thinking about giving them a unique id (eg. title_id) and after loading the target swfs, show their titles (movie clips) in one of the framework's empty movie clip (using attachMovie).
    Could please suggest me any idea to get things work?

  • JSTL forEach tag taking longer time than scriplets ???

    Hi Gurus,
    My STRUTS action class setsup a collection object [roughly 900 + records stored as java beans] to be displayed on my view [JSP]. The problem is, when I iterate over this collection in JSP using <c:forEach> tag, it takes around 4-5 minutes to build up the page.
    I coded the same looping logic through java scriplets embedded within JSP and the processing came down to 1 minute. Should I assume that <c:forEach> tag will have a processing overhead over plain java code in JSP?
    FYI, I checked the server generated SERVLET code under WORK directory of TOMCAT for this JSP with <c:forEach> tag and find lot of code being generated for this <c:forEach> tag implementation. Could it be that the processing of these generated code takes longer than plain java using scriplets?
    Please Help.
    Thanks,
    Karthik.
    <b>JSP using <c:forEach></b>
    <c:forEach var="refurb" items="${BOMDataForm.refurbSummary}" varStatus="loopStatus">                    
    <tr valign="top" bgcolor="#FFFFFF"> 
    <td>
    <div align="center"><span class="modulecontent"><c:out value="${refurb.configName}" /></span></div>
    </td>                     
    <td>
    <div align="center"><span class="modulecontent"><c:out value="${refurb.itemName}" /></span></div>
    </td>
    </tr>
    </c:forEach><b>JSP using embedded scriplets</b>
    <%
    BOMDataForm bomDataForm = (BOMDataForm) request.getAttribute("BOMDataForm");
    ArrayList arrayList = (ArrayList) bomDataForm.getRefurbSummary();
    int loop = arrayList.size();
    for (int i=0;i<loop;i++) {
    out.println("<tr valign=\"top\" bgcolor=\"#FFFFFF\">");
    out.println("<td>");
    out.println("<div align=\"center\"><span class=\"modulecontent\">");
    out.println(((RefurbSearchResult)arrayList.get(i)).getConfigName());
    out.println("</span></div>");
    out.println("</td>");
    out.println("<td>");
    out.println("<div align=\"center\"><span class=\"modulecontent\">");
    out.println(((RefurbSearchResult)arrayList.get(i)).getItemName());
    out.println("</span></div>");
    out.println("</td>");
    out.println("</tr>");                         
    %>

    Never looked at the speed issues. For me it has always been "fast enough"
    When displaying pages with 900 records on it the common approach is to split the result across multiple pages, so that loading doesn't get too long.
    The JSTL tags obviously introduce some overhead in extra procedure calling. As you found out by looking at the generated servlet code.
    Also the EL expressions have to be evaluated. using the reflection APIs. Its pretty certain that direct access to the object is faster.
    The forEach tag uses an iterator under the hood, where you are calling get(i) directly on an ArrayList.
    Any or all of these would be contributing. My guess would be the EL expression evaluation is probably the most overhead.
    One thing about your example I would like to see is how long it would take using an Iterator, rather than calling get(i) on the array elements. That would remove at least one of the differences.
    So in short, yes the JSTL is adding overhead to your page. I'm a bit surprised to hear it is so much though.
    Cheers,
    evnafets

  • ForEach tag problem in JSP

    I have this next code, but the forEach tag doesn't seem to work! However, the line <c:out value='${lista[1]}'/> does work. Can you help me with the problem, please?
    <%@     page
         contentType = "text/html;charset=iso-8859-1"
         session="true"
         language="java"
         import = "java.lang.*"
         import = "java.util.*"
    %>
    <c_rt:if test='<%= request.getParameter("hinicio") != null %>'>
              <%
                   ArrayList Valores = new ArrayList(4);
                   Valores.add(request.getParameter("text1"));
                   Valores.add(request.getParameter("text2"));
                   Valores.add(request.getParameter("text3"));
                   Valores.add(request.getParameter("text4"));
                   Valores.add(request.getParameter("text5"));
                   pageContext.setAttribute("lista", Valores);
              %>
              <c:forEach var='x' items='<%= Valores %>'>
                   <c:out value='${x}'/>
              </c:forEach>
    <c:out value='${lista[1]}'/>
    </c_rt:if>
    <html>
    <head>
         <title>Tarea</title>
         <script type="text/javascript">
              function Inicio()
                   forma.hinicio.value = "ok";
                   forma.submit();
         </script>
    </head>
    <body>
    <form name="forma" method="post" action="Tarea.jsp">    //Redirects to itself
         <input type="hidden" name="hinicio">
         <center>
         <br>
         <input type="text" name="text1" value="0">
         <br>
         <input type="text" name="text2" value="0">
         <br>
         <input type="text" name="text3" value="0">
         <br>
         <input type="text" name="text4" value="0">
         <br>
         <input type="text" name="text5" value="0">
         <br>
         <br>
         <input type="text" name="rango1" value="0">   <input type="text" name="rango2" value="0">
         <br>
         <br>
         <input type="button" value="Aceptar" onClick="Inicio()">
         <br>
         <br>
         <input type="text" name="resultado" value="0">
         </center>
    </form>
    </body>
    </html>

    You seem to be using both the EL and the RT JSTL libs on the same page.
    If you are in a JSP1.2 container, then you can only use EL with the EL tags, and <%= expr %> with the rt tags.
    If you have a JSP2.0 container (eg Tomcat 5) properly configured (ie web.xml is version 2.4) then you should use JSTL1.1, which accepts both sorts of expressions. (${expr} is a runtime expression in JSP2.0)
    Try either
    <c:forEach var='x' items='${lista}'>
    or
    <c_rt:forEach var='x' items='<%= Valores %>'>

  • Foreach tag

    hello,
    I use a foreach tag to browse a map, but some ">" are add betwen two items. I would like to know why...
    here is my code:
    <c:forEach var="map" items ="${dependency.versions}">
              <c:set scope="session" var="project" value="${map.key}" />
              ${project.name} [${map.value}]  
    </c:forEach>
    here is the result:
              <
                   <a href="project6 [1.9.3]  
              <
                   <a href=" project4 [1.8.2]  
              <
                   <a href="project5 [1.9.2]  
              <
                   <a href="project7 [1.8.1]  
              <
                   <a href=" project1 [1.8.1]  
              <
                   <a href="project3 [1.9.1]  
              <
                   <a href=" project2 [1.8.1]  
    thank you for yours future responses
    Julien

    I'm not entirely sure wat u stored in "requestScope.cdo.intexDeal.tranches"; make sure every level follows the "getCdo()" "java.util.Collection" ... rules, try debug using varStatus
    <c:forEach var="z" items="${requestScope.cdo.intexDeal.tranches} " varStatus="tranches_status">
    <p>debug status: <c:out value="${tranches_status}"/></p>
    <p>debug var: <c:out value="${z}"/></p>
    </c:forEach>if it is not the object instance you are expecting, at least you'll know where the error occurs!
    do define more clearly on your solution u r trying to use ..., actually I don't quite get you.
    By Avatar Ng

  • Getting current index of forEach tag

    How do you get the current index of the forEach tag, that is looping through a Vector?
    <c:forEach var="rows" items="${myRequestManager.solPORList}">

    Yes, use the varStatus attribute:
    <c:forEach items="${variables}" var="variable" varStatus="status">
       <c:out value="${status.index}"/>
       <c:out value="${status.count}"/>
    </c:forEach>status.index, the current index, starts with 0. status.count, a running count of loop iterations, starts with 1.
    Get a JSTL book. Shawn Bayern's "JSTL In Action" is the best, IMO. - MOD

  • JSTL : problems with sql:query /forEach  tag

    I am not able to iterate thru the resultset provided by <sql:query> tag in JSTL. rowcount and columnName works, which means that query does produce a resultset. However, the <c:forEach> tag doesnt display the retrieved data. Code is approx like:
    c:catch var="e">
    <sql:query var="queryResults" >
    select * from emp
    </sql:query>
    </c:catch>
    <c:if test="${e!=null}">The caught exception is: ${e}
    ${queryResults.rowCount} <br>
    <c:forEach var="row" items="${queryResults.rows}">
    <tr>
    <td> <c:out value="${row.EMPNO}" /></td>
    </tr>
    </c:forEach>
    </table>
    Error thrown is :
    javax.servlet.ServletException: Unable to find a value for "EMPNO" in object of class "java.lang.String" using operator "."
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
         org.apache.jsp.jsp.sql.query_jsp._jspService(query_jsp.java:92)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    Pls. help!

    Thanks a lot all. My problem was solved by simply replacing the taglib directive
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    to
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    Cheers!

  • C:forEach tags

    Hi- I'm trying to use a c:forEach tag and am having some problems.
    Basically, I want to use an iterator that I get from a helper class to loop over, but I don't want to use EL (this is not a possibility at the moment). Is there any way to do this? Every example I've found uses EL, but there must be a solution that was used before EL was introduced... I hope...

    but there must be a solution that was used before EL was introduced... Sorry to disappoint you but EL was introduced hand in hand with the JSTL.
    What sort of server are you using?
    JSP2.0 container (eg Tomcat 5), use JSTL 1.1, and you can use <%= expr %> instead of ${expr} easily.
    In a JSP1.2 container, you have to use the JSTL1.0 "runtime" version of the taglib.
    <%@ taglib prefix="c-rt" uri="http://java.sun.com/jstl/core-rt"%>
    This taglib lets you use runtime expressions <%= expr %> with the JSTL tags in a JSP1.2 container.
    Good luck,
    evnafets

  • Pt foreach tag issue

    I have the following code, oddly enough the nested foreach repeats the data from the first pass in all subsequent passes???
                                            <pt:logic.foreach pt:data="salessubs" pt:var="temp">
                                              <tr>
                                                 <td class="menuNormal">
                                                   <pt:core.html pt:tag="a" href="$temp.url" class="menuitem"><pt:logic.value pt:value="$temp.title" /></pt:core.html>
                                                 </td>
                                               </tr>
                                               <!-- now get subcommunities, level 1 -->
                                                    <pt:ptdata.subcommunitiesdata pt:id="subs2" pt:commid="$temp.objid"/>
                                                 <pt:logic.foreach pt:data="subs2" pt:var="comm2">
                                                    <tr>
                                                         <td class="menuNormal">
                                                           <pt:core.html pt:tag="a" href="$comm2.url" class="menuitem"><pt:logic.value pt:value="$comm2.title" /></pt:core.html>
                                                         </td>
                                                       </tr>
                                                 </pt:logic.foreach>
                                               </pt:logic.foreach>

    Greetings,
    There is an easy fix for this problem. I am guessing that subs2 is what is causing the issue. Put this:
    <pt:logic.collection pt:key="subs2"/>
    Before this line:
    <pt:ptdata.subcommunitiesdata pt:id="subs2" pt:commid="$temp.objid"/>
    I hope this helps. It should clear the data from subs2 each time through the outer loop.
    Regards,
    Andrew Bays | bdg
    [email protected] | http://www.thebdgway.com
    Edited by andrew.bays at 08/24/2007 10:56 AM

  • JSTL nesting of foreach tag in the c:import

    Ran into the problem when migrated the jstl to 1.2.
    We have the code like below with the c:import and dynamic parameters.
    jstl 1.2 is complaining about the nesting of tags.
    <c:import url="Ixxxxxxxx">
    <c:forEach var="entry" items="${usebean1.htmlParameters}">
    <c:param name="${entry.key}" value="${entry.value}" />
    </c:foreach>
    </c:import>
    What is suggested approach for the c:import with dynamic parameters?
    Any suggestions/solutions will be appreciated.
    Thank you,
    -Sreeni.

    Are you the one who commented out the code you're looking for ?//String desc = StringFactory.getString(attributes.getValue("desc"));You just have to modify you AttributeObject class to hold a new field : String description. And then, it's up to you to create a new constructor or a new setter method.
    Btw, this is not a Swing related question.

  • Error  while working with JSF SelectOneMenu and JSTL forEach Tag

    Hello,
    I have set up few things in ArrayList in my contextListener as like below
    ServletContext context=event.getServletContext();
    List list=new ArrayList();
    list1.add("Honda");
    list1.add("Mazda");
    list1.add("eClipse");
    context.setAttribute("carList", list)
    I just wanted to display the list in my JSF page, I wrote the below statements in my JSF page
    <h:selectOneMenu value="{com.carSelection}">
    <c:forEach var="car" items="${applicationScope.carList}" >
    <f:selectItem itemLabel="${car}"/>
    </c:forEach>
    </h:selectOneMenu>
    I am getting the below exception
    org.apache.jasper.JasperException: /pages/protected/cmt/index.jsp(23,2) According to TLD or attribute directive in tag file, attribute itemLabel does not accept any expressions
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
    org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1124)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:819)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:838)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator
    Could some one help to solve this error (Or) How should I display from my applicationScope list into MenuItems ?
    Edited by: Saravvij on Apr 9, 2008 8:37 PM
    Edited by: Saravvij on Apr 9, 2008 8:38 PM

    Hi,
    get your original message source from SXMB_MONI
    (right click - view source ) then paste your message to your message mapping (Test Tab) in the Integration Repository
    test your mapping and check if it's ok
    Regards,
    michal

  • C:forEach tag inside another c:forEach tag

    Hi,
    I've got en error when I tried to use <c:forEach> inside another <c:forEach> to display a vector of String arrays.
    The error message is:
    javax.servlet.ServletException: The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer.
    The concerned section of the javabean mybean.java is:
    //connect to database to get the resultset
    ResultSet rs = cst.getResultSet();
    if (rs != null) {
    myVector = new Vector();
    while (rs.next()) {
    String myArray[] = new String[10];
    myArray[0]=rs.getString(1);
    myArray[1]=rs.getString(2);
    myArray[9]=rs.getString(10);
    myVector.addElement(myArray);
    rs.close()
    The concerned jsp calling the bean is:
    <jsp:useBean id="theBean" scope="session" class="mybean" />
    <jsp:setProperty name="theBean" property="..." />
    <%
    Vector myVector=theBean.getResultFromDatabaseIntomyVector();
    pageContext.setAttribute("myVector",myVector);
    %>
    <table>
    <c:forEach var = 'vectorItem' items='${myVector}'>
    <tr>
    <c:forEach var = 'arrayItem' items='${vectorItem.value}'>
    <td><c out value='${arrayItem}'/></td>
    </c:forEach>
    </tr>
    </table>
    Can anyone show me what's the right jsp for displaying a vector of String arrays?
    Thanks in advance.
    Geraldine

    I think your problem is with the second forEach loop.
    The first for loop goes through the items in "myVector"
    Each item "vectorItem" should be of type String[]
    Accessing ${vectorItem.value} is what creates the error.
    JSTL converts this as
    vectorItem["value"] , can't turn the string "value" into an integer (to use as an array index) and thus throws an error.
    To fix: use ${vectorItem} rather than ${vectorItem.value}
    (nb you would use {vectorItem.value} if you were iterating over a Map, as the iterator exposes an object of type Map.Entry
    Also in your code, I only see one closing tag for a forEach.
    I think it should be like this (indented for readability)
    <table>
    <c:forEach var = 'vectorItem' items='${myVector}'>
    <tr>
      <c:forEach var = 'arrayItem' items='${vectorItem}'>
        <td><c out value='${arrayItem}'/></td>
      </c:forEach>
    </tr>
    </c:forEach>
    </table>Cheers,
    evnafets

  • C:forEach tag giving bad times

    hi there,
    i have 4 combo boxes, each one depending on the next one.
    The first is COUNTRY once you've selected the country, STATE will be populated, then COUNTY and then CITY.
    all the informations must be retrieved querying a database.
    i'm having hard times with this but i'm trying to do it in the most easily way i can find.
    actually i am able to populate the country box and this works fine, then i'm trying to trigger an onChange event on the country box to pass the value of the selected option to a javascript that will take care of the next step.
    here is the code:
    JSP page
    <select name="nazione" onChange="javascript:pescaRegioni(this.value)">
         <option value=""> -- Nazione --
         <c:forEach items="${requestScope.nazioni}" var="country">
         <option value="<c:out value='country'/>"> <c:out value='${country}'/>
         </c:forEach>
         </select>
    JAVASCRIPT
    function pescaRegioni(country)
         alert(country);
         location.href="PopulateBoxes?nazione="+country+"&regione=&azione=inserisci";
    }i put the alert in the javascript just to check the value of country and whether i check France or Italy or whatever the value i get is "country".
    i know this is because the var country defined in the for each tag is invisible outside the tag.
    i also tryed this.[this.selectedIndex].value but it's obvious that is the same thing of this.value and that it won't solve the nested visibility problem at all any way.
    moreover even if a c:out could help (it won't), i cannot put it in the onChange event because i'm using a javascript there.
    please help!!
    thanks in advance

    double post http://forum.java.sun.com/thread.jspa?messageID=4063433
    ram.

Maybe you are looking for