Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6852187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:20:27+00:00 2026-05-27T01:20:27+00:00

I was wondering if it was possible to redirect users if a certain c:if

  • 0

I was wondering if it was possible to redirect users if a certain c:if clausule is true?

<c:if test="#{loginController.authenticated}">
 //redirect to index page
</c:if>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:20:28+00:00Added an answer on May 27, 2026 at 1:20 am

    Yes it is possible.

    But, I would suggest you to apply filter for /login.jsp and in the filter forward to the other page if the user has already logged in.

    Here is the example which tells how to do this using filter:

    public class LoginPageFilter implements Filter
    {
       public void init(FilterConfig filterConfig) throws ServletException
       {
    
       }
    
       public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,   FilterChain filterChain) throws IOException, ServletException
       {
           HttpServletRequest request = (HttpServletRequest) servletRequest;
           HttpServletResponse response = (HttpServletResponse) servletResponse;
    
           if(request.getUserPrincipal() != null){ //If user is already authenticated
               response.sendRedirect("/index.jsp");// or, forward using RequestDispatcher
           } else{
               filterChain.doFilter(servletRequest, servletResponse);
           }
       }
    
       public void destroy()
       {
    
       }
    }
    

    Add this filter enty in the web.xml

    <filter>
        <filter-name>LoginPageFilter</filter-name>
        <filter-class>
            com.sample.LoginPageFilter
        </filter-class>
        <init-param>
           <param-name>test-param</param-name>
           <param-value>This parameter is for testing.</param-value>
        </init-param>
    </filter>
    
    <filter-mapping>
        <filter-name>LoginPageFilter</filter-name>
        <url-pattern>/login.jsp</url-pattern>
    </filter-mapping>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if its possible to redirect a user to a web page
I'm wondering if it's possible to redirect to a URL like: \\central\public\blah\test.html in PHP?
I am wondering if it's possible to redirect a user to another page from
I'm wondering if it's possible to redirect N domains to subfolders with a single
Inside my app, I was wondering if it was possible to make a certain
I am trying to redirect users to a page, only from a specific page.
Just wondering if its possible to 301 redirect an existing Rewriterule? For example if
I was wondering wether it is possible to redirect someone to a different tab
I was wondering ( if possible ) if there was a program/tool/utility that when
Just toying with the SDK and I was wondering if possible a UITouch event

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.