Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Login Box on the front page when using Tomcat (http://www.velocityreviews.com/forums/t124813-login-box-on-the-front-page-when-using-tomcat.html)

Ben Jessel 07-25-2003 10:44 AM

Login Box on the front page when using Tomcat
 
This is a kind of workaround - have a link that sends you to the login
page;
On the front page:


Already a member? Click <a
href="<%=request.getContextPath()%>"/protected_redirector.jsp?j_forward=<%=request.getC ontextPath()
+ "/index.jsp"%>">here</a> to login.


protected_redirector.jsp - this page should be in the protected realm
via web.xml.

<web-resource-name>Members Area</web-resource-name>
<!-- Define the context-relative URL(s) to be protected -->
<url-pattern>/login.jsp</url-pattern>
<url-pattern>/protected_redirector.jsp</url-pattern>
</web-resource-collection>
-------------------


<%
String j_forward = request.getParameter("j_forward");

if ( ( j_forward==null ) || ( j_forward.trim().length()==0 ) )
j_forward = request.getContextPath() + "/index.jsp";

response.sendRedirect( j_forward );
%>
-----------------------


All times are GMT. The time now is 12:31 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.