rohit.shinde9690 Posted May 14, 2013 Share Posted May 14, 2013 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..............................and 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.htmlbut 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 More sharing options...
rohit.shinde9690 Posted May 15, 2013 Author Share Posted May 15, 2013 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 More sharing options...
rohit.shinde9690 Posted May 15, 2013 Author Share Posted May 15, 2013 Due to Bad formatting of answer by Text Box answer is not clear in post. please find well formated answer in attachment . Link to comment Share on other sites More sharing options...
gururagavan2008 Posted July 18, 2016 Share Posted July 18, 2016 Thanks, very helpful!! :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now