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 8250611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:57:05+00:00 2026-06-07T23:57:05+00:00

I have a JSP page which passes the HttpServletRequest and HttpServletResponse to a Java

  • 0

I have a JSP page which passes the HttpServletRequest and HttpServletResponse to a Java class which dispatches the request and response to an action class based upon a parameter named “action”. The action class performs some action and sometimes forwards to another JSP where the same procedure is repeated. If your thinking I should use a servlet, your right, but that is a long story and basically I don’t have the authority too.

In one of my action classes, I validate the data and if valid, forward the request to another JSP, using the RequestDispatcher. I also tried to set the “action” attribute so that I could tell the other JSP what action to perform, however I learned that attributes are not forwarded with the request. In fact, my code started infinitely looping because I was performing the same action due to the action parameter not changing, which resulted in the request looping between action and jsp.

I found out I could override the action parameter by passing the parameter in the url of the new page. Like so:

RequestDispatcher dispatcher = request.getRequestDispatcher("someUrl.jsp?action=SOME_OTHER_ACTION");
dispatcher.forward(request, response");

This solution smells fishy to me. Can anyone provide any insight into whether this is a good idea?

  • 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-07T23:57:07+00:00Added an answer on June 7, 2026 at 11:57 pm

    I think it is one of the valid way to pass the parameters.

    Other way may be, you have access to request object, you can set it as request attributes. forward is on server and you should be able to access the same request attribute on other end.

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

Sidebar

Related Questions

Hi I have a page in my java/jsp based web application which shows list
I have a jsp page which needs a java code. This java code inside
I have a JSP page which accepts SQL queries, performs them then returns the
I have a jsp page, which imports another jsp. This import is wrapped into
I have a JSP page, which accepts user strings in more than 23 languages.
There is a JSP page in which i have an ArrayList variable. I need
I have one jsp which accepts avlue from textbox and passes it to another
I have a jsp page which contains the code which prints all files in
I have a JSP page on which I have a div tag in which
I have an AJAX call which loads an Dialog page, now depending upon the

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.