Login Box on the front page when using Tomcat

Discussion in 'Java' started by Ben Jessel, Jul 25, 2003.

  1. Ben Jessel

    Ben Jessel Guest

    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 );
    %>
    -----------------------
    Ben Jessel, Jul 25, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Martinoff
    Replies:
    4
    Views:
    5,700
    Alex Martinoff
    Sep 6, 2003
  2. Alex Martinoff
    Replies:
    2
    Views:
    4,166
    Alex Martinoff
    Sep 7, 2003
  3. Aaron Isotton
    Replies:
    3
    Views:
    1,095
    John C. Bollinger
    Jun 6, 2005
  4. Gnarlodious
    Replies:
    4
    Views:
    17,528
    elizas
    May 5, 2010
  5. Shannon

    login page stays on login page

    Shannon, Jan 9, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    511
    Shannon
    Jan 9, 2008
Loading...

Share This Page