Jump to content
We've recently updated our Privacy Statement, available here ×

Customizing LOGOUT feature


kadimulam

Recommended Posts

 

Hi,

Could you please tell me how can the LOGOUT feature be customized. I need to customize it in the following way:

I will allow the user to Login using the following URL:

http://localhost:8082/jasperserver/flow.html?_flowId=listReportsFlow&curlnk=2

When the user Logouts i again want to redirect him to the above page instead of http://localhost:8082/jasperserver/flow.html?_flowId=repositoryExplorerFlow

Is that possible, if yes can you please guide me in acheiving it?

Thanks,

Kiran

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Have a look at http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=51919 for how to customize the home page.

 

Hmmm, but you are after something a bit different than that. If the user is not logged in and then goes to a URL like:

 

http://myserver/jasperserver/olap/viewOlap.html?name=%2fanalysis%2fviews%2fFoodmart_sample

 

or

 

http://myserver/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=%2freports%2fsamples%2fEmployees

 

JasperServer will force them to login and on successful login, will take them to the original URL they requested.

 

Sherman

Jaspersoft

Link to comment
Share on other sites

  • 1 month later...
  • 6 months later...

Implement your logout logic in a new class:

 

public class MyLogoutController extends MultiActionController {

    public ModelAndView logout(HttpServletRequest req, HttpServletResponse res)
            throws ServletException {
        // invalidate session
        HttpSession session = req.getSession(false);
        if (session != null) {
            session.invalidate();
        }
        SecurityContextHolder.clearContext(); //invalidate authentication
        return new ModelAndView("redirect:/login.html" + "?" + "showPasswordChange="+req.getParameter("showPasswordChange"));
    }
}

 

Create a bean that instantiates an instance of the class and include it in the configuration in WEB-INF/jasperserver-servlet.xml

 

    <bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
            <props>
            ...

                <prop key="/logout.html">myLogoutController </prop>

 

 

Sherman

Jaspersoft
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...