You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nikhil Sidhaye <ja...@swissinfo.org> on 2004/06/17 17:03:38 UTC

Re: jstl trouble

Hello Pavlikus,

 I got the same problem. I overcome this problem with very crude method.

use import jsp tag for  getting appropriate classes

First I create 1 instance with <jsp:useBean  id="info" class=.. 
scope="session">

Then I reinitialise the info with session.getAttribute in JSP.

& then you can use your methods using JSTL or simple java code.

I wonder if

<c:out value="${info.user.login}"/>

this will run / not. Because I don't try like info.user.login though 
conceptually it sounds pretty good. In my case so I use single different 
methods such as info.user etc.

Please correct me if I am wrong some where. Because It is my learning curve.

Regards,

Nikhil Sidhaye.


Pavlikus wrote:

>Hello all.
>
><%
>  UserSessionInfo info = (UserSessionInfo)
>        session.getAttribute(UserSessionInfo.USER_SESSION_INFO_KEY);
>        
>  <!-- Print user's login ok -->
>  out.println(info.getUser().getLogin());
>%>
>
>Later on page:
>
><!-- Prints empty strings instead of user's login -->
><c:out value="${info.user.login}"/>
><c:out value="${info.user.role.title}"/>
>
>Please tell me where my mistake.
>Also, is there ways to avoid scriptlets on my jsp?
>I use <jsp:useBean> but it always try to create new instance
>of UserSessionInfo, instead of find it in session.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>  
>





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org