| Author |
usebean id problem
|
M Burke
Ranch Hand
Joined: Jun 25, 2004
Posts: 375
|
|
I bind an ArrayList called ans into the request in a servlet.... req.setAttribute("ans", ejbClient.getAns()); RequestDispatcher rd = req.getRequestDispatcher("/Output"); rd.forward(req, resp); Then in Output.jps I try to access it using usebean. But I get an error in the scriptlet "ans cannot be resolved" at line "Iterator pAll = ans.iterator();" What am I missing here? <HTML> <HEAD> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> <%@ page import="java.util.*" %> <jsp:usebean id="ans" class="java.util.ArrayList" scope="request"> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <META name="GENERATOR" content="IBM WebSphere Studio"> <TITLE>Output.jsp</TITLE> </HEAD> <BODY> <% String invName; Iterator pAll = ans.iterator(); while(pAll.hasNext()){ invName= (String) pAll.next(); %> <P>output:<%=invName%><br></P> <%}%> </BODY> </HTML>
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56191
|
|
|
You forgot to close your usebean tag.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
M Burke
Ranch Hand
Joined: Jun 25, 2004
Posts: 375
|
|
thanks
|
 |
 |
|
|
subject: usebean id problem
|
|
|