examples.servlets
Class SnoopServletjava.lang.Object | +--javax.servlet.GenericServlet | +--javax.servlet.http.HttpServlet | +--examples.servlets.SnoopServletAll Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
public class SnoopServlet
extends javax.servlet.http.HttpServlet
Demonstrates getting and using the request information, headers, and parameters sent by the browser.
Build the Example
- Open a new command shell.
- Set up the development shell.
- Move to the sample directory:
cd $WL_HOME/samples/server/examples/src/examples/servlets
- Build the servlet:
ant SnoopServlet
- Start WebLogic Server with the examples configuration.
- Make sure that the examplesWebApp is deployed on your server.
- To run, go to:
www.setgetweb.com:7001/examplesWebApp/SnoopServlet- If you add some request parameters to the URL the servlet will read those parameters form the request and display them in the output. For example:
www.setgetweb.com:7001/examplesWebApp/SnoopServlet?testParam=refererFor more information on servlets, see Programming WebLogic HTTP Servlets.
See Also: SnoopServlet.java
build.xml
Serialized Form
Constructor Summary
HttpServlet
Method Summary
void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
GenericServlet
Methods inherited from class javax.servlet.http.HttpServlet doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
Methods inherited from class javax.servlet.GenericServlet destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail
SnoopServlet
public SnoopServlet()Method Detail
javax.servlet.http.HttpServletResponse)">service
public void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, java.io.IOException
Overrides: service in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException