Java Reference
In-Depth Information
Wow, there sure is a lot going on at the server!
We will create a simple servlet with a doGet method that processes a Get request. Then we'll expand your Web
page knowledge and create a form. Lastly, we'll tie the form to a servlet and code the servlet's doPost method to
process the form information.
Tutorial: Creating a Simple Servlet
Let's have a go at a servlet.
1.
In the Enterprise Explorer pane, click on the TutorialsWeb project to select it (if necessary).
2.
Click File , New , Other , expand the Web folder, select Servlet then click the Next button.
3.
Specify MyServlet as the class name.
Notice that RAD has specified the folder to hold the Java source code (src) and defined the class as a subclass of
HttpServlet (see Figure 8-17 ). (If the Next and Finish buttons aren't active, click the Java package's Browse button and
select the default package.)
Figure 8-17.
4.
Click the Finish button.
 
Search WWH ::




Custom Search