1 2 package test.web;3 4 import javax.servlet.ServletException ;5 import javax.servlet.http.HttpServletRequest ;6 import javax.servlet.http.HttpServletResponse ;7 import java.io.IOException ;8 9 import org.apache.velocity.servlet.VelocityServlet;10 11 /**12 * Simple Servlet. This servlet illustrates that your servlet can be any13 * subclass of HttpServlet, as long as all the classes14 * in the hierarchy (and any classes they depend on) are on the classpath.15 *16 * @web.servlet17 * display-name="Simple Servlet"18 * load-on-startup="1"19 * name="SimpleServlet"20 *21 * @web.servlet-init-param22 * name="param1"23 * value="value1"24 *25 * @web.servlet-init-param26 * name="param2"27 * value="value2"28 *29 * @web.servlet-mapping30 * url-pattern="/simple/*"31 *32 * @web.resource-ref33 * name="Queue"34 * auth="Container"35 * description="Test resource reference"36 * type="javax.jms.Queue"37 *38 * @web.ejb-ref39 * name="Account"40 * description="A test reference to the Account EJB"41 * home="test.interfaces.AccountHome"42 * link="Account"43 * remote="test.interfaces.Account"44 * type="Entity"45 *46 * @jboss.resource-ref47 * jndi-name="queue/A"48 * res-ref-name="Queue"49 *50 * @jboss.ejb-ref-jndi51 * jndi-name="ejb/bank/Account"52 * ref-name="Account"53 * 54 * @jboss.depends name="domain:service=myFoo"55 *56 * @author <a HREF="mailto:youremail@yourdomain.com">youremail@yourdomain.com</a>57 */58 public class SimpleServlet extends VelocityServlet {59 /**60 * Called by the server (via the service method) to allow a servlet to handle a POST request.61 * The HTTP POST method allows the client to send data of unlimited length to the Web server62 * a single time and is useful when posting information such as credit card numbers.63 */64 public void doPost(HttpServletRequest request, HttpServletResponse response)65 throws IOException , ServletException {66 // just print Hi!67 response.getWriter().println("Hi!");68 }69 }