tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "smallufo" <small...@bigfoot.com>
Subject How to add object to a List or Map with JSTL ?
Date Sun, 01 Dec 2002 23:07:45 GMT
For example , a shopping web site , there are many items , each item has its
'ID' :

In the AddShoppingCart.jsp page , I can get the item Object by this URL:
http://..../AddShoppingCart.jsp&ID=item001

In the jsp page , the code is as follows :

<jsp:useBean id="itemBean" class="my.ItemBean">
      <jsp:setProperty name="itemBean" property="iD" value="<%=
request.getParameter("ID") %>"/>
</jsp:useBean>
<c:set var="item" value="${itemBean}"/>

Here comes the problem , how do I 'initialize' a ShoppingCartList to store
it into session , without servlets ?

I know it is easy to accomplish by servlet's getSession() , but with JSTL ,
I cannot find a way to initialize a List (or Map)...

I only read the 'JSTL in Action' book , and there seems no discussion about
this...(It only discusses about how to extract List or Map ... not how to
'set' or 'add' Objects into List/Map with JSTL . )



--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message