Adding Multiple Login Pages in Jasperserver -
i want add multiple login pages single jasperserver. have customize code , added login1.jsp , login2.jsp in moudles/login/ folder. have added following code in \jasperserver-war\src\main\webapp\web-inf\jasperserver-servlet.xml
bean id="urlhandlermapping" class="org.springframework.beans.factory.config.propertiesfactorybean">
<property name="properties"> <props> <prop key="/fileview/**">jsfileviewcontr</prop> <!-- anonymous pages --> <prop key="/login1.html">jscommcontr</prop> <prop key="/login.html">jscommcontr</prop> <prop key="/logout.html">jscommcontr</prop>
and
<!-- js mac method name resolver --> <bean id="paramresolver" class="org.springframework.web.servlet.mvc.multiaction.propertiesmethodnameresolver"> <property name="mappings"> <props> <prop key="/login1.html">entry</prop> <prop key="/home.html">homepage</prop> <prop key="/login.html">login</prop>
i have added following code 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. when enter
localhost:8080/jasperserver/login1.html
it takes me
localhost:8080/jasperserver/login.html
and after login on page takes me
localhost:8080/jasperserver/login1.html
but when try login on page login event occures succesfully keeps me on same page.
anybody know how add multiple login pages in jasper server?? please me out.
thanks.
i found way :) , answer follows:
procedure add new login page: create new login jsp page. example entry.jsp keep 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 follows:
<bean id="urlhandlermapping" class="org.springframework.beans.factory.config.propertiesfactorybean"> <property name="properties"> <props> <prop key="/fileview/**">jsfileviewcontr</prop> <!-- anonymous pages --> <prop key="/entry.html">jscommcontr</prop> <prop key="/login.html">jscommcontr</prop> <prop key="/logout.html">jscommcontr</prop>
also add following code in same file in paramresolver bean section.
<bean id="paramresolver" class="org.springframework.web.servlet.mvc.multiaction.propertiesmethodnameresolver"> <property name="mappings"> <props> <prop key="/entry.html">entry</prop> <prop key="/home.html">homepage</prop> <prop key="/login.html">login</prop>
<prop key="/entry.html">jscommcontr</prop>
this call controller servlet mapped as
<bean id="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 load entry.jsp folder modules/login/ folder url
localhost:8080/jasperserver/entry.html
we have add page entry filterinvocationinterceptor bean in applicationcontext-security-web.xml
modify applicationcontext-security.xml follows:
<bean id="filterinvocationinterceptor" class="org.springframework.security.intercept.web.filtersecurityinterceptor"> <property name="authenticationmanager"> <ref bean="authenticationmanager"/> </property> <property name="accessdecisionmanager"> <ref bean="httprequestaccessdecisionmanager"/> </property> <!-- <property name="runasmanager"><ref bean="runasmanager"/></property> --> <property name="objectdefinitionsource"> <value> 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 war file again , redeploy on server. can use
localhost:8080/jasperserver/entry.html
as login page. change ui of login page customize entry.jsp , 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
Comments
Post a Comment