|
WebLogic Server 6.0.0 Code Examples, BEA Systems, Inc. |
See:
Description
JSP Examples Summary | |
EasyTableDataDisplay | This example shows how to create an HTML table from a dbKona TableDataSet. The example uses an htmlKona feature that automatically creates an HTML table from a JDBC DataSet. |
EJBeanManagedClient | This example demonstrates using JSP to call a WebLogic EJBean, how to use an EJBean from within a scriplet page. It uses a beanManaged entity EJBean included with the WebLogic Distribution. Before you try to run this example, you'll need to compile, configure, and deploy the EJBean that this example depends upon; please see the beanManaged persistence example and the WebLogic EJBean examples for instructions. |
ErrorPage | Demonstrates how to set up an error page for a JSP page. Do not load this JSP directly in your browser. This file is instead called by the ThrowException.jsp example. |
HelloWorld | This simple example demonstrates how to embed Java in a JSP page. |
InteractiveQuery | Connects to a database, and displays it's contents in a table. You can click on an entry in the table, which makes another query to this JSP page. The page interprets the request differently since there are HTTP query parameters present, and displays the name of the entry you selected. |
JdbcTable | Shows how to use a form to set options for retrieving database data from a table with JDBC. This example uses the demoPool JDBC connection pool. |
SessionServlet | Shows how to store and retrieve user data in a session. The example allows you to add or delete name/value attributes to and from an HTTP session, much the same as a shopping cart would work. The same session containing the user values is retrieved each time the browser revisits the web page, and is displayed in a list. This is achieved using session cookies. For more details, see the section on sessions in Programming WebLogic HTTP Servlets. |
ShowDate | Demonstrates importing a package (java.util.Date) into a JSP page, setting a response header attribute, and using a JSP expression tag. |
SimpleDBLogin | Illustrates how to make a connection to a database with JDBC, including exception handling to help you debug your servlet. This example uses the "demoPool" JDBC connection pool. |
SimpleSession | This example shows simple principles of session management by incrementing a counter each time a user accesses a page. |
SnoopServlet | This example lets you examine HTTP data about the servlet itself. |
ThrowException | Demonstrates how to set up an error page for a JSP page. Here, ErrorPage.jsp is returned when an uncaught exception is thrown in the ThrowException.jsp page. |
URLEncode | Demonstrates using URL rewriting to pass session information to the server from browsers that do not support cookies. |
Using JSP Custom Tag Libraries | A set of examples that demonstrate using custom JSP tags and how to create the Java classes for the tags. |
These examples show how to use JSP to generate dynamic content in web pages. JSP allows you to concentrate on the design of HTML pages, but still use Java to provide the dynamic content and logic. These examples demonstrate:
In addition to the preceding examples, JSP tag library extension examples are provided in the tagext subdirectory.
Perform the following steps to build and run the examples:
$ java weblogic.jspc -d %EX_WEBAPP_CLASSES% *.jsp
$ copy *.jsp %APPLICATIONS%\examplesWebApp
Many of the examples use JDBC to access an example Cloudscape database called "demoPool." The Cloudscape DBMS is a Java database management system (DBMS) that is included with WebLogic Server, with a limited evaluation license. For more details on how to configure Cloudscape and the example "demoPool" database, see the tech-support document Using the Cloudscape database with WebLogic.
http://WebLogicURL:WebLogicPort/examplesWebApp/jspExample.jspFor example, here's how you load the HelloWorld in a browser running on the same NT host as your WebLogic Server, on port 7001:
http://localhost:7001/examplesWebApp/HelloWorld.jsp
|
Documentation is available at http://e-docs.bea.com/wls/docs60/ |