html « Form « JSP-Servlet Q&A

1. How to POST multiple "record sets" from an HTML Form to JSP or a Java Servlet?

Does JSP or any related lightweight technology like JSTL perform HTTP POST "data grouping", or support form element "indexing" in the way PHP does? For example, you can create an HTML form ...

2. Problem with detecting the value of the drop down list on the server (servlet) side

Client code is pretty simple:

<form action="DDServlet" method="post">
       <input type="text" name="customerText">
       <select id="customer">

3. Handling multiple forms on a single JSP

I have a JSP page with several forms on it. Some of these forms are generated dynamically, and each of them submits some information to a database. Handling one form is easy, as I ...

4. Does form with enctype="multipart/form-data" cause problems accessing a hidden field

I have created a hidden form element

<form name="UploadImage" enctype="multipart/form-data" method="post" action="UploadImage">
    <input name="imgUploadObjId" id="imgUploadObjId" value="52" type="hidden">


5. reload a form with the same parameter of the previous

I have really a problem that I don't know how to deal with it. I am using JSP and Servlet with the Eclipse IDE. First of all, the user fill an ...

6. Are empty fields in form of JSP null or ""?

When a form is passed in to a servlet are empty fields "" or null? So for example in a form where you have First name as a field and ...

7. Problem in displaying dropdown box

<title>ADD URL Sources</title>

<form action="Test1.jsp" method="post">

<br><br><select name="source" onchange="">
<option value="rss">RSS LINK</option>
<option value="other">OTHER LINK</option>

<br><br> Enter URL to be added 

 <input type="text" name="url" size=50>

<br/><br>Enter the Source Name ...

8. How to display the contents of an arraylist in a drop down box

I have a sql statement that pulls infomration about tagnum's for individual pidm's. Every pidm can have multiple tagnum's so I am dropping the information into an arraylist. I want to ...

9. Using AJAX When Processing JSP Form?

I am just learning how to use JSP and am stack on a small issue. I am creating a basic form where the user inputs some text and then when they ...

10. Usage of Web Template in JSP Form

I have designed few JSP forms and I am in need of integrating any web template in that JSP form. I am a beginner in JSP and I am completely unaware of ...

11. JSP and HTML - Naming check boxes with different names from a loop

I have something like this in my code

<% while (i.hasNext()) {
     Object obj =;

12. How to get two values using a checkbox in HTML?

I am wondering if it is possible to get two values from a checkbox in HTML form. My code in HTML is something like this:

<input type="checkbox" name="order" value="20" > Sundae $20
<input type="checkbox" ...

13. html form processing in java servlet

I'm building a java servlet to respond to some HTML form. Here is the simple test form:

 <FORM action="" method="post">
    <LABEL for="firstname">First name: </LABEL>

14. jSP form Query Parameters

While using an HTML form on a jsp page, the data/values automatically get picked up on submit and a url gets generated: Is there a way to change the generated url ...

15. JSP html form generation based on JDBC meta data

could anybody give me a good idea or hint (not a tool) how I could implement a JDBC meta data based automatic generation of html forms? I have solved this before in ...

16. How to get a multiple value parameter using O'Reilly's multipart form servlet library?

I'm using O'Reilly's multipart form library for Servlets to be able to process file uploading. I found it useful and realiable, but I'm facing an issue I can't solve. ...

17. Nesting of forms - JSP, HTML

So I have been reading for the last few days on JSP and HTML. I read that it is not possible to have nested forms in HTML. Does anyone have any indication ...

18. Hidden fields are missing while doing 'view source'

I have two hidden fields in my jsp form. When i get the page in browser and do 'view source', I could see only the first hidden field, not the second ...

19. Multi line output in TextArea with JSP

How can I display my list in a TestArea line after line with no additional spaces. i.e:

Here is my attempt:
<div class="text">
    <label for="output_string">Output:</label> `
    <textarea ...

20. Pulling a form name as a parameter

Let's say I have the following HTML form:

<form name="createnewuser" action="verifyInfo.jsp">
    ... Contents of form here ...
In verifyInfo.jsp, is there a way to call the form's name (ideally as ...

21. Node.js Connect.bodyParser like form data parser for JSP/Servlets

I'm looking for a very lightweight form data parser that would work in JSP or Servlets. What I basically want to do is parse something like this:

<input type="text" name="person[1][name]"/>
<input type="text" name="person[1][food]"/>
To ...

22. HTML textarea curson indented for some reason

I need the cursor justified to the left. For some reason its indented when rendering on the page:


23. get value from iframe hidden field to parent hidden field

I have a iframe which is inside a webpage. I have one hidden fields in iframe and another in parent window. When i click a button on the parent window i ...

24. What is the right way to create a reusable yet flexible form component in JSP/Servlet?

I'm making my first steps with JSP and servlets, and am building some toy project. I couldn't figure out the right approach to solve the following problem - In the user management ...

25. Retaining previous form data

I have a form that I could put on to one page, but for aesthetic reasons, I want to split into two. The original form, on submission, would go to a ...

26. Sending multiple parameter values from a JSP to a servlet

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 ...

27. how to extract the list of values from a specific drop down box in a web form, using java/jsp

I want to extract all the values for a specific drop down list box in a web form. In the source code of this web form, the relevant code for this particular ...

28. Radiobutton listeners in html

I have two radio buttons like this,

 <table name="">
     <tr><input type="radio" name="passwordissues" value="forgetpassword"/>Forget Password</tr>
     <tr><input type="radio" name="passwordissues" value="resetpassword"/>Change Password</tr>
I may can ...

29. Prepopulate AND redisplay an HTML Form

What is the best non-framework (JSP/Servlet only) way to create a form such that it can:

  1. Prepopulate with default values / data loaded from a database
  2. Redisplay submitted values which fail validation
It seems ...

30. Publishing form data saved in Servlet Context into Radio Button on another form

I have a JSP/HTML form with text box and radio buttons. I am saving the data entered in the form in servlet context. I am then jumping over to a new ...

31. how JSP page set member of class

I am beginner at using JSP and am following a tutorial. I have a basic question. There is a simple class named NameHandler that has only one String field called name. ...

32. java servlet query with parameters from html form

I am trying to create a servlet which can obtain the parameter of the drop down box in html and use this parameter to query a database. my html:

<form action="servlet/currencyservlet">
<option name="usd">United States ...

33. get values from databse to html textarea

The reason it didn't work is that unlike INPUT, the TEXTAREA tag has no "value" attribute. The correct form is However, you must be careful NOT to have anything that looks like HTML (particularly broken HTML) in the value you substitute, because the user's browser will get confused unless you escape it. Example: <% String ...

34. HTML form data

Hi. I'm sending a text from an HTML form to a JSP, the text is written in arabic, when i access it in th JSP using request.getParameter() and print it using the out object, a garbage is printed out, and i need to change the browser encoding by myself to view the data correctly,i used

36. JSP Parameters and HTML Form Values

i liked Vlad's solution to the problem but one should know, - if query param is having NO value then we will have "" as a value when we do getParameter(). - if query param is NOT there(doesn't exists) in the request then we will have null as return of getParameter() -else we will have some value. hth, maulin.

37. create UI without using html in forms

38. Returning a result set in an html form

I currently have an html form where I can enter data(Add_Product.jsp), which in turn populates a database and then shows another screen(Product_List.jsp) displaying just the Product_ID, title, desc and price of the item. What I want to do is have a radio button that can be selected next to each Product_ID within that table, which when selected will display the original ...

39. taglib encapsulate html elements - combobox - dropdown list

Hello, I would like to do a simple basic tag that can encapsulate the behavior of a html combobox. I though about something like a simple Java class that would have 2 fields: a list and a selecteditem. When we give a reference to an instance of such a class in the jsp, the taglib would render this html element.

40. Controlling the browser appearance using a JSP-html form

There isn't a web developer alive who hasn't, at one time, wanted to disable the back, forward, and refesh buttons. The specs and all browser implementations have, rightly, refused to take this control from the end user. The best thing to do is code around the fact they will always be there.

41. securing password in html form

47. How to remember HTML Form fields with Servlets

I have a servlet that reads in the values from a HTML page and populates a database. The database has certain properties such as unique fields, etc. Normal procedure involves entering data into the various fields in the HTML page and then pressing the Submit button. The servlet reads in the values from the page and then tries to update the ...

48. servlets and html forms.....

Hi, I have a html form which is processed by a servlet which accesses a database and returns a set of relevant results. However, what I really want is when the form is submitted a web page with frames to be generated (2 columns) and one of the frames to contain the results. At the moment I have a servlet that ...

49. html forms servlet and jdbc

51. HTML Form/Servlet Problem

53. Fill out a html-form using a servlet ?

Hello, as we all now its pretty easy to process data sent by an html form to a servlet. But how to do it the other way round ? I want to fill out a html form by a servlet. Instead of me typing all the data into a html form and pressing the send button (e.g. login into to a ...

54. generate html form using servlet

55. how to connect the HTML form with my servlet

hi im new in this forum i want help regarding connecting the form to the servlet i made im making a website using dreamweaver in the contact us page i'ave made a form. This form is supposed to submitt the data about clients to the company. i'ave made a servlet,compiled,deployed and tested it my servlet looks like this import javax.servlet.*; import ...

56. use EJB in

58. how in JSP I translate an html checkbox to true/false in java

I tried // shopping cart bean with sub beans line items session.setAttribute("AddChoosePlant", null); if (session.getAttribute("AddChoosePlant")==null){ run what is here... but seems sub objects not get to null....? may use a function to bean makes all subobjects(sub beans) nulls? Is any way this achived via the jsp or servlet (above code is in jsp)...?

59. calling jsp directl from HTML form

60. How To call .html form from JSP

62. HTML Java Form to JSP page.. HELP PLEASE ASAP!

hey all, first post, im a real n00b at this.. its just part of my first yr at uni and dont even need it for the 2nd yr and never done it before.. anyway, if u could please just get me through this il be FOREVER greatfull... basically iv done the following. 1. Create a registration form to be used to ...

65. HTML form data processing by servlet