A off hand response, try changing the scope of the object maybe to request
in both the action and the jsp page. Also in the action try to put a name
like "nameOfObject" in
session.setAttribute("nameOfObject", employeeList );
----- Original Message -----
From: "Tuan H. Le" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, October 20, 2002 3:56 PM
Subject: RE: <logic:present> return false
I even replaced the variable IConstants.USER_EMPLOYEE_LIST_KEY to the actual
value "com.xyz.key.USER" in the session.getAttribute( ... ) method, but
still have the same issue. Again, the for loop works just fine.
Thanks,
Tuan
-----Original Message-----
From: Tuan H. Le
Sent: Sunday, October 20, 2002 12:50 PM
To: Struts Users Mailing List
Subject: RE: <logic:present> return false
Hi David,
Thanks for your response!
IConstants.USER_EMPLOYEE_LIST_KEY is a string of value "com.xyz.key.USER".
I'm not sure that's the issue, because the session.getAttribute returned a
correct ArrayList object employeeList and the for loop works fine.
Any ideas?
Thanks,
Tuan
-----Original Message-----
From: David M. Karr [mailto:dmkarr@;earthlink.net]
Sent: Sunday, October 20, 2002 12:45 PM
To: [EMAIL PROTECTED]
Subject: Re: <logic:present> return false
>>>>> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:
Tuan> Hi,
Tuan> In my Action class I set an object in one of the session attribute
before forwarding to a JSP view. But, the <logic:present> in the JSP view
always return false on that object.
Tuan> **************** My Action code ***********************
Tuan> ...
Tuan> session.setAttribute( USER_EMPLOYEE_LIST_KEY, employeeList );
Tuan> // Forward to the appropriate View
Tuan> return ( mapping.findForward( target ) );
Tuan> ********* My JSP page *********************************
Tuan> <%
Tuan> ArrayList employeeList = (ArrayList)session.getAttribute(
IConstants.USER_EMPLOYEE_LIST_KEY );
Tuan> // *************************************************
Tuan> // THIS CODE WORK, BUT THE <logic:present> does not work
Tuan> // *************************************************
Tuan> //for ( int i = 0; i < employeeList.size(); i++ ) {
Tuan> // out.println( "i = " + i + "<BR>" );
Tuan> // EmployeeVO e = (EmployeeVO)employeeList.get( i );
Tuan> // out.println( "Employee ID --> " + e.getEmployeeId() +
"<BR>");
Tuan> //}
Tuan> %>
Tuan> <logic:present name="employeeList" scope="session">
Tuan> <!-- Iterate over the results of the query -->
Tuan> <logic:iterate name="employeeList" id="employee" scope="session"
type="com.phs.ezhr.business.vo.EmployeeVO" indexId="idx">
Tuan> ....
Tuan> </logic:iterate>
Tuan> </logic:present>
What is the value of "IConstants.USER_EMPLOYEE_LIST_KEY"?
--
===================================================================
David M. Karr ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]
--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>
--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>
--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>
--
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>