} }
Files Prepare Run Troubleshooting Related Topics
This example demonstrates how to use metadata annotations in a Web application. The Servlet 2.5 specification requires Servlets, Servlet Filters, Servlet event listeners, JavaServer Pages tag handlers and a few other class types to support serveral common annotations.
This example demonstrates the following features:
Directory Location:
MW_HOME/wlserver_10.3/samples/server/examples/webapp/servlets/annotations/standard
(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. |
CalculatorServlet.java | Servlet annotated with an @EJB metadata annotation. |
Calculator.java | Business Interface for CalculatorEJB. |
CalculatorEJB.java | Simple EJB which is referenced by the CalculatorServlet. |
ContextInitializer.java | ServletContext Listener injected with a persistent unit. |
ExamplesFooter.jsp | Java Server Page containing the Example Footer. |
ExamplesHeader.jsp | Java Server Page containing the Example Header. |
LoginFilter.java | Filter that authenticates requests for CalculatorServlet. |
loginForm.jsp | Login form page for the standard annotations example Web Application. |
persistence.xml | Descriptor for the Persistence Provider Runtime. |
Visitor.java | Simple enity class. |
web.xml | Standard Web application deployment descriptor. |
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\servlets\annotations\standard directory, to build the example.
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/servlet_annotations/
(Internet connection required.)