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>
<a href="/mpsdemo/user/UserLogout.jsp">Logout</a>
</td>
</tr>
</table>
HTML:
<div wicket:id="includedJSP">included JSP goes here</div>
--
View this message in context:
http://www.nabble.com/Including-dynamic-JSP-content-in-Wicket-page-tp15430548p15430548.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]