Uh... I suggest finding out what other frameworks (like JSP) do
because last time I checked they all use "jsession" regardless of the
webapp and no problems occur, so why is that? There might be a cleaner
way to do this...

Gili

On Sat, 29 Jan 2005 18:39:39 +0100, Juergen Donnerstag wrote:

>The required change is fairly simple. Make the wicket session
>attribute name unique per servlet. Instead of "session", it should be
>"session" + request.getServletPath()
>
>
>    static HttpSession getSession(final Application application, final
>HttpServletRequest request)
>    {
>        // Get session, creating if it doesn't exist
>        final javax.servlet.http.HttpSession httpServletSession =
>request.getSession(true);
>
>        // The request session object is unique per web application,
>but wicket requires it
>        // to be unique per servlet.
>        final String sessionAttributeName = "session" +
>request.getServletPath();
>        
>        // Get Session abstraction from httpSession attribute
>        HttpSession session =
>(HttpSession)httpServletSession.getAttribute(sessionAttributeName);
>
>        if (session == null)
>        {
>            // Create session
>            session = new HttpSession(application, httpServletSession);
>
>            // Set the client Locale for this session
>            session.setLocale(request.getLocale());
>
>            // Attach to httpSession
>            httpServletSession.setAttribute(sessionAttributeName, session);
>        }
>        else
>        {
>            // Reattach http servlet session
>            session.httpServletSession = httpServletSession;
>        }
>
>        // Set the current session to the session we just retrieved
>        Session.set(session);
>
>        return session;
>    }
>
>Juergen
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
>Tool for open source databases. Create drag-&-drop reports. Save time
>by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
>Download a FREE copy at http://www.intelliview.com/go/osdn_nl
>_______________________________________________
>Wicket-develop mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/wicket-develop
>




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to