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

The Archive Base Latest Questions

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

The answer to my question is partially here but, not working for me Sending

  • 0

The answer to my question is partially here but, not working for me
Sending multiple parameters to servlets from either JSP or HTML

My JSP is the following

<table cellpadding = "10" border = "1">
<tr valign = "bottom">
<th align = "left" > Catalog No </th>
<th align = "left" > Chemical Name </th>
<th align = "left" > Unit </th>
<th align = "left" > Price </th>
<th align = "left" > Vendor </th>
<th align = "left" > Category </th>
<th align = "left" > Account No</th>
</tr>

<%
try
{
ArrayList<CartProduct> cp3 = (ArrayList<CartProduct>) session.getAttribute("cp");
for(CartProduct pp: cp3)
{
%>
<tr>
<td><%=pp.getCatNo()%></td>
<td><%=pp.getChemName()%></td>
<td><%=pp.getChemUnit()%></td>
<td><%=pp.getPrice()%></td>
<td><%=pp.getVendor()%></td>
<td><%=pp.getCategory()%></td>
<td><select name = "accno"><option value="--Select--">--Select--</option>
<%ArrayList<String> str=pp.getAccList();
for(String s:str)
{
%> <option value="<%=s%>"><%=s%></option>
<%  
 }
%>
</select></td><td>
<a href="DisplayCartServlet?catNo=<%=pp.getCatNo()%>&;accountNo=accno">Add To Cart
</a></td>
</tr>
<%
}
}
finally{
}
%>
</table>

How do I send the value of the list box to the servlet? Currently only catNo is being passed, but accountNo is null at the servlet.

  • 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-24T19:25:53+00:00Added an answer on May 24, 2026 at 7:25 pm

    The easiest way to accomplish what you are attempting is to post using a form.

    <form method="post" action="DisplayCartServlet">
    <input type="hidden" name="catNo" value="<%=pp.getCatNo()%>">
    <select name = "accno"><option value="--Select--">--Select--</option>
    <%ArrayList<String> str=pp.getAccList();
    for(String s:str)
    {
    %> <option value="<%=s%>"><%=s%></option>
    <%  
     }
    %>
    </select>
    <input type="submit" value="Add To Cart">
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is spawned from the partial answer to JSF2: why does empty test
Referring second answer to question: How to convert from ASCII to Hex and vice
I was trying to answer the question mentioned here by passing the reference to
The manual does not answer this question : it says the name of the
This question is similar to what I need to do, but the voted answer
I'm using nested model form technique from Railscast 197 (ASCIIcast here ). But I'm
Hopefully have a simple question here but I cannot for the life of me
This question was asked here for thousands times. But really, none of your examples
In a question answer I find the following coding tip:- 2) simple lambdas with
While trying to answer a question in the vicinity ' Unit Testing WPF Bindings

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.