Download View - ITtestpapers.com
Transcript
THE EXAMPLE JSP PAGES
• Instead of accessing the bookstore database directly, the helper object goes
through a data access object database.BookDAO.
The implementation of the database helper object follows. The bean has two
instance variables: the current book and a reference to the database enterprise
bean.
public class BookDB {
private String bookId = "0";
private BookDBEJB database = null;
public BookDB () throws Exception {
}
public void setBookId(String bookId) {
this.bookId = bookId;
}
public void setDatabase(BookDBEJB database) {
this.database = database;
}
public BookDetails getBookDetails()
throws Exception {
try {
return (BookDetails)database.
getBookDetails(bookId);
} catch (BookNotFoundException ex) {
throw ex;
}
}
...
}
Finally, this version of the example contains an applet to generate a dynamic digital clock in the banner. See Including an Applet (page 100) for a description of
the JSP element that generates HTML for downloading the applet.
The source for the Duke’s Bookstore application is located in the
<INSTALL>/j2eetutorial/examples/web/bookstore2 directory.
To deploy and run the example:
1. In the IDE, mount the filesystem
<INSTALL>/j2eetutorial/examples/web/bookstore2.
2. Expand the bookstore2 node.
3. Right-click the DigitalClock class and choose Compile.
4. Right-click the WEB-INF directory and choose Deploy.
87
Related documents
The Java™ Web Services Tutorial
The J2EE™ 1.4 Tutorial
The Java™ Web Services Tutorial
THE J2EE™ 1.4 Tutorial in NetBeans
WebLogic Web Service
The J2EE™ Tutorial
Remote Lectures - Final Report
MANUEL D`UTILISATION SOUS WINDOWS
Siemens S75 User's Manual
Wiley Java 2 Enterprise Edition 1.4 (J2EE 1.4) Bible