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

  • Home
  • SEARCH
  • 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 8337217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:14:18+00:00 2026-06-09T04:14:18+00:00

I have a simple user application. I have a MainController Servlet that will be

  • 0

I have a simple user application. I have a MainController Servlet that will be in charge of general interaction in the application. This servlet will be “listening” for url-patterns: /, /index, etc (any other form of index). I also have an UserController Servlet that is in charge of login among other things, this one “listens” from /CheckLogin url-pattern.

I have form in a jsp, in the url /, that when I submit it, it points to the servlet at /CheckLogin. Then UserController servlet process it and either the login is ok or wrong it redirect to / (the MainController will be in charge of determining the page to show depending if the user logged in or not).

All work flawlessly except that after submitting the first time, then the form page has url /CheckLogin. I would like to remove it and show only / (even if logged or not). How do I do this (plain Java EE, not Spring or any other framework)?

  • 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-06-09T04:14:20+00:00Added an answer on June 9, 2026 at 4:14 am

    I’m not sure if this is what you’re looking for, but if you do a forward instead of a redirect, the URL on the client browser will not be updated: RequestDispatcher#forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse; an explanation can be found at Forward vs Redirect.

    In addition, it might be a better idea to implement authentication as a Filter instead of a Servlet; that way, the Filter can be used to intercept any URL you deem needs to be secured.

    Is there a specific reason you’re not using a web framework? They’re meant to take care of things security and routing for you, generally.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Desktop Facebook application that allows the user to retrieve some
I have a simple web browser embedded in an application that allows a user
I have a simple java GUI application, which will prompt a user for a
I have a simple application that shows the user an image (in a UIImageView)
Say that I have simple command line application, that looks something like this #
I have simple application, that shows list of many items, where user can display
I have a simple application that has richTextBox and button. User enters numbers(integers) into
I have a simple web application which lets the user upload local user data
I have a simple application in which I need to let the user select
I have a simple rails application were book belongs_to user and user has_many book.

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.