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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:28:51+00:00 2026-05-17T19:28:51+00:00

Currently I am using java servlets to set up Hashmaps, lists, and range of

  • 0

Currently I am using java servlets to set up Hashmaps, lists, and range of business objects and then pass them to a jsp page via request.setAttribute("myMap", myMap);

How can I directly access this data in javascript/jquery? What is the syntax ?

At the moment I am using jstl and EL expressions to loop through data and set the values of dom elements.

<c:forEach var="entry" items="${myMap}">
<input type="hidden" class="myClass" value='<c:out value="${entry.value}" />' />
</c:forEach>

I then use javascript/jquery to access these DOM elements.

$(".myClass").eq(1).val()
$(".myClass").eq(2).val()

Is their a way I can directly access, using javascript/jQuery, the page attributes that are set in servlet without first creating dom elements ?

  • 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-17T19:28:52+00:00Added an answer on May 17, 2026 at 7:28 pm

    I’d rather dump it in a javascript associative array:

    <script type="text/javascript">
        var map = new Array();
        <c:forEach ... >
           map['${entry.key}'] = '${entry.value}';
        </c:forEach>
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently trying to learn HTML and Java EE Servlet programming. I have an
I am trying to upload a file in GAE using the Blobstore API. I
Let's say I have a running Java-based web application with 0 or more valid
We sell packaged Java web applications to some of our customers. It's basically a
once again I've got a question. Since I am using Google Web Toolkit (GWT)
I am currently working on Twitter4j for connecting to Twitter API. As with any
I am creating a login page for my web application. I want to create
I need to run an .sh file and get its output. I need to
I encountered the problem of having the same .jar (for my case, el-api.jar v2.1)twice
Again, I am new to JPA & Hibernation. I am trying to use JPA

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.