I have an application that requires users to sign on. I would like to access JForum without users having to sign on again. I tried to follow the guide at the following location: https://coderanch.com/t/574564 .
So I made all the code changes, and after I add the UserSession to the SessionFacade, i try to print out the values. When I run the code, it produces a null pointer exception, at the following statement:
So it seems like my session was not updated.
So my code looks like this:
This is all done in JForum.java, right under the "this.checkCookies()" call. I've also added the configureThreadLocal method, but I'm not sure from where it gets called. Also, at the
statement, which session do I assign? "tmpUs" or "us"?
I've only been using Java for 6 months, so please feel free to point and laugh at the obvious mistakes!
Pieter [originally posted on jforum.net by Anonymous]
So Pieter, the problem with your code is that you set a "dummy" session ID, but SessionFacade.getUserSession() makes a call to JForum.getRequest().getSession().getId(), that must probably has a different session id.
You can try using the method getUserSession(String sessionId) .
Rafael [originally posted on jforum.net by Rafael Steil]
Pieter, can you please post your final solution here. It would help me out a ton. I'm trying to do the same thing but also can't figure out where configureThreadLocal gets called from. Thanks so much in advance. [originally posted on jforum.net by rzavi4jc]
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop