If you're determined to put your business logic into your JSP pages, then just use a 
scriptlet to create the list object and put it into the session.  You can expect the 
JSTL to well support applications which use the MVC pattern (by having "view" logic in 
your JSP pages and "business" logic in Servlets or Struts Actions), but I wouldn't 
hold my breath waiting for features in the JSTL which will make it easy to write your 
entire application with JSTL tags.

The MVC pattern implies that JSP pages only extract information from beans to display. 
 If you're ever thinking about writing code in a JSP page to initialize list objects, 
then you're getting away from the MVC pattern.

In the Struts framework, you would always have a "prepare action" which executes 
before a JSP page is executed, where list objects and other complex objects are 
initialized and loaded from persistent stores.

> -----Original Message-----
> From: smallufo [mailto:[EMAIL PROTECTED]]
> 
> 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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to