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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:26:22+00:00 2026-05-18T01:26:22+00:00

I am required to do some small tasks with JSP; being very new to

  • 0

I am required to do some small tasks with JSP; being very new to JSP I was wondering if there was any possibility to get only GET or only POST parameters from the HTTP request.

I have seen ServletRequest.getParameter (and alikes) but it seems that those methods get both GET and POST parameters. Is there a way to get only one of them, without parsing the URL or the request body myself? And if not, is there any precedence rule which values overwrite which (like POST parameters always overwriting GET parameters)?

  • 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-18T01:26:23+00:00Added an answer on May 18, 2026 at 1:26 am

    Generally, requests should better be handled in servlets. They have doGet(request, response) and doPost(request, response) methods, to differentiate the two.

    If you really insist on doing it in a JSP, you can differentiate the methods using request.getMethod(). It would return GET or POST.

    Since this is homework, I guess the point is to learn how to use servlets and their doX methods, so do it that way.

    Update: You can get the query string (request.getQueryString()), which is only the get parameters, and parse it, but I wouldn’t say that’s a common and good practice.

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

Sidebar

Related Questions

Is there a possibility to launch two different applications from the same jar? I've
I had written a small thread program when i compiled cc filename.c, i got
I'm writing a small Scala app that does the following: 1) Read XML/XHTML files
I have been troubled with this small piece of activity to be completed. I
I have a small program that which is confusing me. I am trying using
I recently started reading Evans' Domain-Driven design book and started a small sample project
I'm looking for a really really small linux distribution or process of making my
parseFloat(1.51e-6); // returns 0.00000151 parseFloat(1.23e-7); // returns 1.23e-7 // required 0.000000123 I am sorting
I am writing application (.NET 4.0) that should do post-request to SalesForce to submit
tldr: Why does ('placeholder' in inputElemnt) equal true in IE8 despite no native support

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.