6.14 A JSP EXAMPLE

There are various ways to fetch and set information through JSP. Let us consider an example which highlights various ways to retrieve information.

 

UserBee - Index.jsp—Form to accept user name

 

 

Fig. 6.10 UserBee - Index.jsp—Form to accept user name

 

It accepts a user name for which to snoop into. The control passes on to LoginServlet (line-12). Let's take a look into that Servlet.

Only the doPost method is included in the code listing shown in Figure 6.11, since other methods are not used. Nothing unusual about the code listing except that there is a reference to a Java Class (line 6), which is a Java Bean class. A Java Bean is a plain java class conforming to some ...

Get Web Technology: Theory and Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.