Handling Client Request Form Data

1,244
-1

Published on

Published in: Technology, Design
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,244
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Handling Client Request Form Data

  1. 1. Handling Client Request Form Data
  2. 2. <ul><li>The Role of Form Data </li></ul><ul><li>If you have ever used the search engine visited an online books store tracked stocks on the Web or asked a Web- based websites for quotes on the tickets, you have probably seen funny looking. URLs like http://host/path?user=Marty+Hal&origin=bwi&dest=sfo . The part after the ? Is known as form data (or query data) and is most common way to get the information from the web page to a server side program. Form data can be attached to the end of URL after the question mark for GET request, form data can be sent to the server on different line for PoST request. Here are the basics: </li></ul><ul><li>1) Use the Form element to create the HTML form . Use the ACTION attribute to designate the address of the servlet that will process the results; you can use abosulate or relative URL For: </li></ul><ul><li><FORM ACTION=“……”></FORM> </li></ul><ul><li>Use input element to collect user data.Place the elements between the start and end tags of the form element given each input element a name .Textboxes are most common input parameter created with the following: </li></ul><ul><li>< INPUT TYPE =‘TEXT’ NAME=“….”/> </li></ul><ul><li>Place the submit button near the bottom of the form: For example, </li></ul><ul><li><input type=“SUBMIT”/> </li></ul><ul><li>When the button is pressed the URL designated by the form’s ACTION is invoked . With GET request a question mark and the name value paurs are attached to the end of the URL where the name comes from nmae attribute in the HTML input elements and the values come from the end user. </li></ul>
  3. 3. <ul><li>Reading Form Data From The Servlet </li></ul><ul><li>One of the nice feature of the servlet that all of the form parsing handled automatically.You call the request.getParameter to get the value of Form parameter. </li></ul><ul><li>You can call request.getParametValues() if the parameter appears more than once. </li></ul>
  4. 4. <ul><li>Hierchy Of Your Project </li></ul>

×