} }
Files Prepare Run Troubleshooting Related Topics
This example illustrates some new JSP 2.0 features. You can create a customized tag using a tag file that contains JSP and JSTL (JSP Standard Library Tag) code. JSTL allows Web designers to produce scriptless JSP pages that do not contain Java code. The tag file also uses one of three new directives <%@attribute%> to demonstrate dynamic attributes.
This example demonstrates an Address Label Creator written in JSP. The client enters a customer's address information into the input fields. The client also enters the number of rows to be produced. After submission, the input field values are passed to the customized tag, <mail:tagHandler>, for processing.
Output: The client should see the customer's address printed in three separate columns. The number of rows is dynamically generated based on the value entered on the form field labeled "Number of Rows".
Directory Location:
MW_HOME/wlserver_10.3/samples/server/examples/webapp/jsp/tags/taghandler/
(where MW_HOME is the directory containing your Oracle WebLogic Server installation)
File Click source files to view code. |
Description |
---|---|
application.xml | Java EE standard enterprise application deployment descriptor. |
build.xml | Ant build file that contains targets for building and running the example. |
ExamplesFooter.jsp | Java Server Page containing the Example Footer. |
ExamplesHeader.jsp | Java Server Page containing the Example Header. |
TagHandler.jsp | Java Server Page containing the Tag Handler. |
tagHandler.tag | Tag Handler tag. |
web.xml | Java EE standard Web application deployment descriptor. |
weblogic.xml | Oracle WebLogic Server-specific Web application deployment descriptor. |
weblogic-application.xml | Oracle WebLogic Server-specific enterprise application deployment descriptor. |
wls_examples.css | Oracle WebLogic Server samples cascade style sheet. |
Before working with this example:
No special configuration is required for this example
To build the example, follow these steps:
The Ant command uses the build.xml file, located in the SAMPLES_HOME\server\examples\src\examples\webapp\jsp\tags\taghandler directory, to build the example.
Running the build script builds the EJB in split development directory format where compiled and generated classes are placed in SAMPLES_HOME\server\examples\build\jspTagHandlerEar and non-compiled files remain within the source directory of the example. For more information on split development directory, see Developing Applications for Oracle WebLogic Server.
To run the example, follow these steps:
prompt> ant run
This command executes the build.xml run target, which opens your default browser to the following URL:
http://localhost:port/jsp_tagHandler/TagHandler.jsp
Where:
Note: To execute a Web-based example, you can manually open the browser to the appropriate URL or you can use the build.xml run target by entering ant run at the command prompt. The latter is the Oracle suggested method for running this example.
Full Name
Street
City, State/Province
Zip Code
Country
Row of Labels
(Internet connection required.)