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

Adding Multiple Login Pages in Jasperserver


rohit.shinde9690

Recommended Posts

Hi,

I want to add multiple login pages to single jasperserver.
i have customize the code and added login1.jsp and login2.jsp in moudles/login/ folder.
also i have added following code in jasperserver-warsrcmainwebappWEB-INFjasperserver-servlet.xml

Capture.JPG.aa5978b5e73d0b3f20fde780a3cac1fd.JPG

..............................

and

Capture1(1).JPG.a64457122de9436ab0e38be98f2a24ba.JPG
 
I have also added following code to JSCommonController.java in com.jaspersoft.jasperserver.war.control package.

public ModelAndView login1(HttpServletRequest req, HttpServletResponse res)
            throws ServletException {
        setupLoginPage(req);
 
        return new ModelAndView("modules/login/login");
    }

 

public ModelAndView login2(HttpServletRequest req, HttpServletResponse res)
            throws ServletException {
        setupLoginPage(req);
 
        return new ModelAndView("modules/login/login");
    }
 
i deployed server after rebuilting it.
but when i enter http://localhost:8080/jasperserver/login1.html it takes me to http://localhost:8080/jasperserver/login.html and after login on this page it takes me to http://localhost:8080/jasperserver/login1.html
but when i try to login on this page login event occures succesfully but it keeps me on same page.

Anybody know how to add multiple login pages in jasper server??
Please help me out.

Thanks.

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

 

Procedure to add new login page:

Create a new login jsp page. Example entry.jsp
Keep it in jasperserver-war/src/main/webapp/WEB-INF/jsp/modules/login/

Add entry of property of page in urlHandlerMapping bean section in jasper-servlet.xml in anonymous pages section as follows:

"urlHandlerMapping" class="org.springframework.beans.factory.config.PropertiesFactoryBean">

        "properties">

           

               

                     "/fileview/**">jsFileViewContr

 

               

                "/entry.html">jsCommContr

                "/login.html">jsCommContr

                "/logout.html">jsCommContr

 

Also add following code in same file in paramResolver bean section.

 

    "paramResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">

        "mappings">

           

                "/entry.html">entry

                     "/home.html">homePage

                     "/login.html">login

 

"/entry.html">jsCommContr This will call controller servlet which is mapped as  

"jsCommContr" class="com.jaspersoft.jasperserver.war.control.JSCommonController">

 

Add following code in com.jaspersoft.jasperserver.war.control.JSCommonController.java

public ModelAndView entry(HttpServletRequest req, HttpServletResponse res)

           throws ServletException {

    setupLoginPage(req);

 

    return new ModelAndView("modules/login/entry");

    }

 

This will load entry.jsp from folder modules/login/ folder for url localhost:8080/jasperserver/entry.html

We also have to add this page entry to the filterInvocationInterceptor bean in applicationContext-security-web.xml

 

Modify applicationContext-security.xml as follows:

"filterInvocationInterceptor" class="org.springframework.security.intercept.web.FilterSecurityInterceptor">

        "authenticationManager">

            "authenticationManager"/>

       

        "accessDecisionManager">

            "httpRequestAccessDecisionManager"/>

       

       

        "objectDefinitionSource">

           

                CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON

                PATTERN_TYPE_APACHE_ANT

                /entry.html=ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR

                /login.html=ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR

               /logout.html=ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR,IS_AUTHENTICATED_FULLY

 

Build the war file again and redeploy it on server.
Now you can use http://localhost:8080/jasperserver/entry.html as login page.
To change UI of login page customize entry.jsp and pageSpecific.css.

 

Locations of files:


entry.jsp :- /jasperserver/jasperserver-war/src/main/webapp/WEB-INF/jsp/modules/login/entry.jsp

jasperserver-servlet.xml :- /jasperserver/jasperserver-war/src/main/webapp/WEB-INF/jasperserver-servlet.xml


JSCommonController.java :-
Physical path: /jasperserver/jasperserver-war-jar/src/main/java/com/jaspersoft/jasperserver/war/control/JSCommonController.java
Package Path: com.jaspersoft.jasperserver.war.control/ JSCommonController

 

applicationContext-security-web.xml :- /jasperserver/jasperserver-war/shared-config/applicationContext-security-web.xml

Link to comment
Share on other sites

  • 3 years later...

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...