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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:33:16+00:00 2026-05-13T12:33:16+00:00

I started short time ago with JSP, JSTL, HTML and JavaScript so here is

  • 0

I started short time ago with JSP, JSTL, HTML and JavaScript so here is my problem:

I need to set the value of a var the value of an input hidden. Other option is if it possible to compare using

<c:if test="....">

the value of a variable that I sent with the request with the value of the hidden input.

Thanks.

Update

I’ve been trying but can’t make it work.

I have this field that contains the id of and object. I also have the list with the objects so what I have to do is find the object related to that ID.

<input type="text" name="id1" />

but if I do this:

<c:set var="dd" value="${param.id1}" />
<input type="text" value="${dd}" />

The input text is empty but the text related to id1 displays 850 (i.e. the value is dinamic)

Any suggestion why is not working?

Update 2

I need the “multipart/form-data” because in the form I need to upload a picture. I understand how to get the parameters from Java, but since I’m not using the server but the JSP pages, there’s any way to do it? Just need to read that input element and save it in a variable.

  • 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-13T12:33:17+00:00Added an answer on May 13, 2026 at 12:33 pm

    You can access request parameters by implicit ${param} variable.

    E.g. http://example.com/context/page.jsp?foo=bar in combination with

    <c:if test="${param.foo == 'bar'}">
       The foo's param value is bar!
    </c:if>
    <c:if test="${param.foo != 'bar'}">
       The foo's param value is not bar, it is: ${param.foo}
    </c:if>
    

    would show the first condition.

    If you actually want to retain some hidden input element in subsequent requests (which wasn’t really made clear in your question), then all you basically need to do is:

    <input type="hidden" name="foo" value="${param.foo}">
    

    Update: as per your update: you need to give the input element a name as well. Thus, e.g.

    <input type="text" name="id1" value="${param.id1}" />
    

    This way it’s available by request.getParameter("id1") and inherently also ${param.id1}. Do you see it now?

    Update 2: as per your comment here: certainly this is related to enctype="multipart/form-data". With this encoding, the request parameters aren’t in the parameter map anymore, but instead in the request body, because of the mixup with binary data (file uploads). It’s going to be a long story to explain it all, but basically you need to parse the request yourself. If you’re on Servlet 2.5 or older, then the Apache Commons FileUpload is very helpful here. Read especially “User Guide” and “Frequently Asked Questions” over there to see code examples and to learn how to use it the right way (also in MSIE!). You can even decide to abstract the FileUpload away so that you can stick using HttpServletRequest#getParameter() and ${param} the usual way, also see this article.

    If you’re already on Servlet 3.0, then you can just make use of HttpServletRequest#getParts(). You can even abstract it away so that you can stick using HttpServletRequest#getParameter() and ${param} the usual way, also see this article.

    Update 3: Oh, you really don’t want to use JSP to do all the processing. There it is not for. It’s high time to learn Servlet. Besides, when using a Filter which puts all parameters from the request body back in the request parameter map (as described in the both articles), you also don’t necessarily need a Servlet after all.

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

Sidebar

Ask A Question

Stats

  • Questions 389k
  • Answers 389k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could create a fail safe method by using both… May 15, 2026 at 12:39 am
  • Editorial Team
    Editorial Team added an answer You have a dependent name, you need to append typename… May 15, 2026 at 12:39 am
  • Editorial Team
    Editorial Team added an answer I think what you're seeing here is that the ObservableCollection… May 15, 2026 at 12:39 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.