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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:31:28+00:00 2026-05-13T05:31:28+00:00

In JSP how do I get parameters from the URL? For example I have

  • 0

In JSP how do I get parameters from the URL?

For example I have a URL www.somesite.com/Transaction_List.jsp?accountID=5

I want to get the 5.

Is there a request.getAttribute( “accountID” ) like there is for sessions or something similar?

  • 1 1 Answer
  • 1 View
  • 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-13T05:31:28+00:00Added an answer on May 13, 2026 at 5:31 am

    In a GET request, the request parameters are taken from the query string (the data following the question mark on the URL). For example, the URL http://hostname.com?p1=v1&p2=v2 contains two request parameters – – p1 and p2. In a POST request, the request parameters are taken from both query string and the posted data which is encoded in the body of the request.

    This example demonstrates how to include the value of a request parameter in the generated output:

    Hello <b><%= request.getParameter("name") %></b>!
    

    If the page was accessed with the URL:

    http://hostname.com/mywebapp/mypage.jsp?name=John+Smith
    

    the resulting output would be:

    Hello <b>John Smith</b>!
    

    If name is not specified on the query string, the output would be:

    Hello <b>null</b>!
    

    This example uses the value of a query parameter in a scriptlet:

    <%
        if (request.getParameter("name") == null) {
            out.println("Please enter your name.");
        } else {
            out.println("Hello <b>"+request. getParameter("name")+"</b>!");
        }
    %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a URL www.test.com/myshort/myapp/mypage.jsp, where myshort is a column value in my database.
I want get parameters from json, so I have a code: @RenderMode(name = VIEW)
I have index.jsp from which I get the parameters to servlet LoginServlet.java The servlet
https://apps.facebook.com/atri-apps/next.jsp#access_token=AAADDZAgrM9vcBAA I want to access the access_token parameter from url but I am not
From my JSP, I am sending a GET request with a parameter called jobDetails
I have 4 arraylist in jsp and I want to get elements of lists
i have put fckeditor in jsp page. I want to get the value whatever
I want to call a JSP with GET parameters within the GET parameter of
I want to have a JSP like this: <form id=form1> Name is: <%=request.getParameter(name) %>
M sending the parameters from the jsp page, the code is <s:url id=url action=searchAction>

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.