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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:06:47+00:00 2026-06-09T19:06:47+00:00

I have jsp which has method action=POST. Initially this jsp is called thru a

  • 0

I have jsp which has method action=”POST”.
Initially this jsp is called thru a Controller (Spring) with query string param1=paramValue1 in URL. (e.g /thisJsp.jsp?param1=paramValue1). Spring used GET method here so the query parameter is read.

Later I would do submit() thru javascript setting an hidden form input field $(‘#param1’).val(paramValue2).

My problem is going back to Controller, it registers that the method action is POST, but
when I do request.getParameter(“param1”), it always returns paramValue1.

Using Fiddler, I see that param1=paramValue2 is registered meaning it is set on submit().

What am I missing?

I am using Tomcat server and Spring 2.0.7

  • 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-09T19:06:48+00:00Added an answer on June 9, 2026 at 7:06 pm

    Can you see the URL that the POST is going to? Your form may or may not have its “action” property set. If it’s not set, then it will POST to the same URL that the page is currently on. This could lead to a situation where you POST to a URL with ?param1=paramValue1 in the query string, but then also has param1=paramValue2 in the post body. You could change the form so that its action is set to just “/thisJsp.jsp” without the query string, and that might solve your problem.

    In general, it is valid for the same named parameter to be included more than once in a request, either a GET or a POST. You could also try calling request.getParameterValues(“param1”) in your controller, which will return an array of Strings. This will be a good test to see if you are indeed passing both values of param1.

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

Sidebar

Related Questions

I have a JSP which has jQuery and wanted to change the action message
Hi I have something like this in struts.xml <action name=LoginAction class=controller.LoginAction> <result name=error>/Error.jsp</result> <result
I have a jsp tag which takes a javax.el.MethodExpression as attribute: <%@ attribute name="action"
I have a jsp page which needs a java code. This java code inside
I have a jsp page, which imports another jsp. This import is wrapped into
Folks, I have just joined this company which has a huge source tree based
In my Spring application, I have a jsp that has a form where I
I have created a child.jsp file which has a button named Continue. I have
I have a controller which has a few actions, which are triggered by hitting
I have a JSP page (home page) in a Web App, which has different

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.