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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:22:40+00:00 2026-06-18T11:22:40+00:00

I have an application which passes a map from a servlet to a jsp.

  • 0

I have an application which passes a map from a servlet to a jsp. In the jsp,i displays the map and provides an option to delete or edit the values pf the map.But, after changing the values, how to send the the map back to another servlet,where it recieves the map.

Suppose, i have a servet “servletA” which passes a map to a jsp as follows:

public int Id=11111;
Map<String,String> configParamsMap=new HashMap<String,String>(size);
    configParamsMap.put("1", "arg1");
    configParamsMap.put("2", "arg2");
    configParamsMap.put("3", "arg3");
    configParamsMap.put("4", "arg4");
    //
    System.out.println("parameters passing to the jsp:: appId"+appId+"::configId"+configId);
    request.setAttribute("configParamsMap", configParamsMap);
    request.setAttribute("Id", Id);


    RequestDispatcher rd = request.getRequestDispatcher("/JSP/display.jsp");
    rd.forward(request, response);

in the jsp, i can do delete or edit the values. i am doing delete as follows and passing the parameters

<c:forEach var="configParams" items="${configParamsMap}">
    <!--  KEY: ${configParams.key}  - VALUE: ${configParams.value} -->

    <tr>
        <td>
        <c:out value="${configParams.key}" />
        </td>
        <td><input type="text" name="" value="${configParams.value}" /></td>

    </tr>
</c:forEach>
</table>
<form action="sevletB?action=Delete" method="post"><input
type="submit" value="Delete"></input>
<input type="hidden" name="Id" value="${Id}"></input>   
</form>

My problem is that how to pass the map back to another servlet “servletB” as i have done to parameter “id” . This map should be the one, where a user has either edited some values i.e. the present status of the map in the jsp.

  • 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-18T11:22:41+00:00Added an answer on June 18, 2026 at 11:22 am

    Write all your code inside form tag.

    Use this code :

    <c:forEach var="configParams" items="${configParamsMap}" varStatus="itemsRow">
       <tr>
            <td>
            <c:out value="${configParams.key}" />
            </td>
            <td><input type="text" name="" value="${configParams.value}" /></td>
      </tr>
    </c:forEach>
    

    Use a hidden field that will contain ${configParams.key} value. Use loop iterator ${itemsRow.index} to make distinguished parameter names like

    <input type="text"name="configParam.${itemsRow.index}"value="${configParams.value}" />

    When form will be submitted then you can access all these values from request by giving names in getParameter('') method.

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

Sidebar

Related Questions

I have a web application which uses the globalization values being passed from sql
I have a application which handles picture chosen from gallery. But there is a
I have an application which parses strings and passes them via jQuery to a
I have a web application which passes long-running requests to a Windows Service on
I have a WCF client which passes Self-Tracking Entities to a WPF application built
I have an application which displays modal views. In the last modal view, I
I have an application in which some sides i am using Filter conditions,,But i
I have a web application which passes an authentication key to web services for
I have application which uses Sherlock ActionBar package. The application uses platform-specific behavior for
I have application which needs to use a dll (also written by me) which

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.