From 274cc082f20df2f980841591743d12d30123494c Mon Sep 17 00:00:00 2001 From: pbarros Date: Wed, 7 Dec 2011 10:26:15 -0200 Subject: [PATCH] --- nbproject/build-impl.xml | 10 ++-- nbproject/genfiles.properties | 4 +- nbproject/project.properties | 2 +- src/java/newpackage/NewServlet.java | 91 +++++++++++++++++++++++++++++++++++ web/WEB-INF/web.xml | 8 +++ 5 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 src/java/newpackage/NewServlet.java mode change 100755 => 100644 web/WEB-INF/web.xml diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index 11df13d..984c257 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -647,28 +647,28 @@ exists or setup the property manually. For example like this: - + - + - + - + @@ -723,7 +723,7 @@ exists or setup the property manually. For example like this: - + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index ed3d7f9..193e69b 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=651128d4@1.33.1.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=e3f82181 -nbproject/build-impl.xml.script.CRC32=93e81836 -nbproject/build-impl.xml.stylesheet.CRC32=0cbf5bb7@1.33.1.1 +nbproject/build-impl.xml.script.CRC32=54bc9623 +nbproject/build-impl.xml.stylesheet.CRC32=b7883b1f@1.36.1.1 diff --git a/nbproject/project.properties b/nbproject/project.properties index f62ee35..a6f1d34 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -47,7 +47,7 @@ includes=** j2ee.compile.on.save=true j2ee.deploy.on.save=true j2ee.platform=1.5 -j2ee.platform.classpath=${j2ee.server.home}/modules/endorsed/javax.annotation.jar:${j2ee.server.home}/modules/jersey-core.jar:${j2ee.server.home}/modules/jsf-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar:${j2ee.server.home}/modules/javax.security.jacc.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.resource.jar:${j2ee.server.home}/modules/javax.ejb.jar:${j2ee.server.home}/modules/javax.enterprise.deploy.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/jaxr-api-osgi.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.transaction.jar:${j2ee.server.home}/modules/jaxrpc-api-osgi.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/jsf-impl.jar:${j2ee.server.home}/modules/jstl-impl.jar:${j2ee.server.home}/modules/javax.security.auth.message.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.management.j2ee.jar:${j2ee.server.home}/modules/javax.jms.jar:${j2ee.server.home}/modules/javax.servlet.jar +j2ee.platform.classpath=${j2ee.server.home}/modules/jsf-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.enterprise.deploy.jar:${j2ee.server.home}/modules/javax.ejb.jar:${j2ee.server.home}/modules/javax.transaction.jar:${j2ee.server.home}/modules/jstl-impl.jar:${j2ee.server.home}/modules/jsf-impl.jar:${j2ee.server.home}/modules/javax.management.j2ee.jar:${j2ee.server.home}/modules/javax.jms.jar:${j2ee.server.home}/modules/endorsed/javax.annotation.jar:${j2ee.server.home}/modules/jersey-core.jar:${j2ee.server.home}/modules/javax.security.jacc.jar:${j2ee.server.home}/modules/javax.resource.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar:${j2ee.server.home}/modules/javax.security.auth.message.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.servlet.jar j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar:${j2ee.server.home}/modules/javax.ejb.jar diff --git a/src/java/newpackage/NewServlet.java b/src/java/newpackage/NewServlet.java new file mode 100644 index 0000000..aadb756 --- /dev/null +++ b/src/java/newpackage/NewServlet.java @@ -0,0 +1,91 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package newpackage; + +import java.io.IOException; +import java.io.PrintWriter; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * + * @author pbarros + */ +public class NewServlet extends HttpServlet { + + /** + * Processes requests for both HTTP + * GET and + * POST methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + try { + /* + * TODO output your page here. You may use following sample code. + */ + out.println(""); + out.println(""); + out.println("Servlet NewServlet"); + out.println(""); + out.println(""); + out.println("

Servlet NewServlet at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } finally { + out.close(); + } + } + + // + /** + * Handles the HTTP + * GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Handles the HTTP + * POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// +} diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml old mode 100755 new mode 100644 index e2c86a7..a1167fb --- a/web/WEB-INF/web.xml +++ b/web/WEB-INF/web.xml @@ -9,10 +9,18 @@ javax.faces.webapp.FacesServlet 1 + + NewServlet + newpackage.NewServlet + Faces Servlet *.jsf + + NewServlet + /NewServlet + 30 -- 1.7.6.4