If the
returns a null string, the error and an explanation is
then printed to the client browser using
. The error keyword is
then removed from the session information.
In general, all the information that is passed to our JSP files from the servlet
has been implemented using the HttpSession object. Figure 79 illustrates
how this was achieved in our home page.
<% if (session.getValue("as400")!=null) {%>
<% }%>
Figure 79. Retrieving information from the session object
In Figure 79, we used the information contained in the HttpSession to
dynamically generate a link to a new servlet. If the  value  returned by
contains a null string, the link to
would not be displayed in the home page.
3.7 Accessing data through a Java bean
Java beans are Java components designed to be used on client systems. They
are Java classes that conform to certain coding standards. They can be
described in terms of their properties, methods, and events. Java beans may be
packaged with a special descriptor class called a BeanInfo class and special
property editor classes in a JAR file. Java beans may or may not be visual
components. For more information, see the Java bean documentation at:
A bean was chosen for one instance where the database was queried for
information pertaining to previous orders. We create the following coding
construct to access a bean for the list of orders:
  A bean is called from within a JSP by using the
The JSP can then access the values contained within the bean using the
request object. Figure 80 on page 104 illustrates how we accomplished
Chapter 3. Building the Web server



About Services Network Support FAQ Order Contact

Linux Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting 

Lunarwebhost.net  Business web hosting division of Vision Web Hosting Inc. All rights reserved