Default Application
WAS's default configuration includes...
appserver server1 enterprise application Default Application Web module DefaultWebApplication enterprise bean JAR Increment Additional code examples are provided as part of the Samples Gallery.
Snoop servlet
Retrieves information about a servlet request.
URL: http://localhost:9082/snoop/
Snoop returns:
- Servlet initialization parameters
- Servlet context initialization parameters
- URL invocation request parameters
- Preferred client locale
- Context path
- User principal
- Request headers and their values
- Request parameter names and their values
- HTTPS protocol information
- Servlet request attributes and their values
- HTTP session information
- Session attributes and their values
HelloHTML servlet
URL: http://localhost:9082/HelloHTML.jsp
The HelloHTML pervasive servlet uses PageList to extend PageListServlet, which enables servlets to call other Web resources by name or, when using the Client Type detection support, by type.
We can invoke the Hello servlet from...
- HTML browser
- speech client
- WAP enabled browsers
Note that the PageList Servlet custom extension is deprecated in WAS V7.0 and will be removed in a future release. Re-architect the legacy applications to use javax.servlet.filter classes instead of com.ibm.servlet classes.
Starting from the Servlet 2.3 specification, javax.servlet.filter classes we can intercept requests and examine responses. We can also use javax.servlet.filter classes to achieve chaining functionality, as well as embellishing or truncating responses.trns
HitCount application
The HitCount app increments a counter using...
- Servlet instance variable
- HTTP session
- Enterprise bean (EJB)
These methods occur with transaction that you can commit or roll back. If the transaction is committed, the counter is incremented. If the transaction is rolled back, the counter is not incremented.
The EJB method uses a CMP enterprise bean that persists the counter value to an Apache Derby database using Default Datasource and DefaultDB database. We can instruct the servlet to look up the enterprise bean, either in the WebSphere global namespace, or in the namespace local to the application.
URL: http://localhost:9082/HitCount.jsp
Related concepts
Web apps
Web modules
Class loaders
Related tasks
Task overview: Deploy Web apps
Related
Web apps: Links 
Related information
Servlets