ankushchhabra Posted February 23, 2012 Share Posted February 23, 2012 Hi guys,We are using Jasper server 4.2.1 and we have intergrated Jasper with our Application .in Jasperserver-pro/web.xml , Session timeout is set to 20 minutes <session-timeout>20</session-timeout> .If user is idle for more than 20 minutes , then it sees login page of Jasper but we want to redirect it to Application Login page .Also , we dont want to set timeout time to infinity.Please suggest what code we need to change. Regards,Ankush Link to comment Share on other sites More sharing options...
ankushchhabra Posted March 16, 2012 Author Share Posted March 16, 2012 Kindly help. Link to comment Share on other sites More sharing options...
arajput Posted April 11, 2012 Share Posted April 11, 2012 If you get the solution, please update Link to comment Share on other sites More sharing options...
ankushchhabra Posted July 30, 2012 Author Share Posted July 30, 2012 1) Create a file "SessionTimeoutRedirect" which handle the logic of redirection <script type='text/javascript'> if (window.top != window.self) { window.parent.location = '<%=contextPath%>' }</script>where as contextPath is the Homepage of your application.2) Add the following code in login.jsp <%@ include file="/WEB-INF/jsp/SessionTimeoutRedirect.jsp" %> Regards,Ankush Link to comment Share on other sites More sharing options...
java_1 Posted December 20, 2012 Share Posted December 20, 2012 I am not sure if you have see this session timeout tutorial on javascript redirect Link to comment Share on other sites More sharing options...
KrisParis Posted September 23, 2013 Share Posted September 23, 2013 Hi everyone,I am joining this post because I would like also to make a redirection to an external Application when session timeout happens using the community version (version 5.2) of JasperReports Server.In my application, internal users can log in using the Jasper login page and external users can also be autheticated by sending a custom request to the Jasper server application. I have a custom filter that extends BaseAuthenticationProcessingFilter and this filter processes this two request format.When a external user log out, he is redirected to my external Application. For doing that, I have created a file which name starts with applicationContext-externalAuth and I have added externalAuthProperties (see below) to my externalUserSetupProcessor which is used by externalDataSynchronizer. <bean id="externalAuthProperties" class="com.jaspersoft.jasperserver.api.security.externalAuth.ExternalAuthProperties"> <!-- external logout url. If specified, logout will redirect to that address. --> <property name="logoutUrl" value="http://localhost:8080/myExternalApp"/> </bean>[/code]Redirection on logout works fine. But now I would like my external user to be redirected to my external app when session timeout happens.My attempts to redirect on session timeout1) I tried to add ConcurrentSessionFilter bean specifying ist expired-url property withe the URL to my external application. But this did not work.2) I also tried to assign the URL to my external application to the internalAuthenticationFailureUrl property of my Filter. Then when a session timeout happens, my Jasper application get stuck on the page jasperserver/flow.html/?flow_id = searchflow. There is a loading popup that seems to run in a infinite loop because it nevers disappeared. But If I refresh the page with the refresh button of my web browser, I get redirected to my external application.3) I have also tried to assign another Jasper page to the internalAuthenticationFailureUrl property of my Filter (/exituser.html instead of /login.html?error=1). Then I added a javax.servlet.Filter that maps on the URL /exitiuser.html and which in its doFilter() method should redirects to my external application using((HttpServletResponse) response).sendRedirect(targetUrl);[/code]But this also does not work because I have exactly the same problem as with the previous attempt described above.QuestionsI saw the following in the file jasperserver-servlet.xml <!-- basic exception resolver for jasperserver application --> <bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"> <property name="exceptionMappings"> <props> <prop key="org.springframework.security.AccessDeniedException">modules/system/AccessDeniedPage</prop> <prop key="org.springframework.webflow.execution.repository.NoSuchFlowExecutionException"> modules/system/sessionExpiredErrorPage</prop> <prop key="java.lang.Exception">modules/system/errorPage</prop> </props> </property> </bean>[/code]The modules/system/sessionExpiredErrorPage does not seem to be used. Do you know how can I use it so the JSP page sessionExpiredErrorPage could be displayed (Then I will try to make a redirection to my external application using a servlet).I did not find in which Jasper class the externalAuthProperties bean is used when the user manually logs out Jasper. I would like in which class the redirection to my external application is done when the user logs out, (so I could reuse the same code ).I would prefer solutions that implis extending Java classes or modifying configuration files rather than editing JSP files.Thanks in advance for your answers. 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