Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
17.6 An Applet That Sends POST Data
457
Listing 17.7 SendPost.java (continued)
// LabeledTextField is really a Panel with a Label and
// TextField inside it. This extracts the TextField part,
// gets the text inside it, URL encodes it, and
// returns the result.
private String encodedValue(LabeledTextField field) {
String rawValue = field.getTextField().getText();
return(URLEncoder.encode(rawValue));
}
}
Figure 17 4 Result of using SendPost to send POST data to the ShowParameters
servlet, which is presented in Section 3.4 (Example: Reading All Parameters).
Home page for this book: www.coreservlets.com; Home page for sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved