Can you attach with debugger to see what is in the Session actually?

Because if you set the User object via Wicket's Session then it prepends
a prefix to the key of all objects in the session. See
o.a.w.protocol.http.WebApplication.getSessionAttributePrefix(WebRequest) 

On Tue, 2008-02-12 at 02:28 -0800, Declan wrote:
> I'm trying to include JSP content in my Wicket page. The JSP content depends
> on some data that is stored in the HttpSession - in this case the data is a
> user object.
> 
> I have tried to use the Wicket Include like this:
> 
> add(new Include("includedJSP", "user/include.jsp"));
> 
> Using the this form always returns a null user object because the underlying
> code in the Include class opens a new URL connection that has a different
> session, so my user object is not available.
> 
> Can anyone suggest a way of getting around this?
> Thanks,
> Declan
> 
> JSP file:
> <[EMAIL PROTECTED] import="sg.com.mps.demo.model.persistence.User" %>
> 
> <jsp:useBean id="reqHandler" scope="page"
> class="sg.com.mps.demo.web.RequestHandler"/>
> <%
> 
>     System.out.println("Session ID: " + session.getId()); // every call
> returns a different session ID
>     User user = reqHandler.getLoggedInUser(session); // always returns null
> 
>     System.out.println(null==user?"null":user.toString());
>     if (user == null) {
>         return;
>     }
> 
> %>
> 
>   <table width="100%">
>     <tr>
>       <td class="small-label">
>         Logged in as: <%= user.getLoginName() %>
>         <br>
>         &lt;a href="/mpsdemo/user/UserLogout.jsp"&gt;Logout&lt;/a&gt;
>       </td>
>     </tr>
>   </table>
> 
> 
> HTML:
> 
> <div wicket:id="includedJSP">included JSP goes here</div>
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to