Login Box on the front page when using Tomcat

B

Ben Jessel

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.getContextPath()
+ "/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 );
%>
-----------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top