From: <sen...@ne...> - 2005-09-20 21:17:15
|
I am using the following code in a custom Threaded class that I wrote that uses a Jetty HttpServer object. *********************code below // Create a servlet container to handle jsp's ServletHandler shandler = new ServletHandler(); // Map a servlet onto the container shandler.addServlet ("Dump","/Dump", "org.mortbay.servlet.Dump"); //context.addServlet("Default","/","org.mortbay.jetty.servlet.Default"); shandler.addServlet ("JSP", "*.jsp", "org.apache.jasper.servlet.JspServlet"); shandler.addServlet ("JSP", "*.jSp", "org.apache.jasper.servlet.JspServlet"); shandler.addServlet ("JSP", "*.jSP", "org.apache.jasper.servlet.JspServlet"); shandler.addServlet ("JSP", "*.JSP", "org.apache.jasper.servlet.JspServlet"); shandler.addServlet ("JSP", "*.Jsp", "org.apache.jasper.servlet.JspServlet"); shandler.addServlet ("JSP", "*.JsP", "org.apache.jasper.servlet.JspServlet"); shandler.addServlet ("JSP", "*.JSp", "org.apache.jasper.servlet.JspServlet"); shandler.addServlet ("JSP", "*.jsP", "org.apache.jasper.servlet.JspServlet"); context.addHandler(shandler); //doesn't work in 4.2.8 context.addHttpHandler (shandler); //Set the resource base. context.setResourceBase(resourcepath); **********************code above This works perfectly for the contexts that I define afterward allowing them all to serve static and dynamic resources. However, I'd like to only serve dynamic resources for specific contexts, I wanted to add a conditional attribute to the code above that would toggle in or out the code needed to do this per context. What is the line or lines that are needed to allow static only(no execute on jsp) serving of resources? I tried commenting out the jsp referencing lines above but for some reason the context is still execute a test jsp file placed in the directory. Thanks in advance for any assistance anyone can provide. Regards, David ______________________________________________________________________ NetZero Is Giving Away $3,000 A Day! Sign up for NetZero HiSpeed 3G with Instant On! Visit http://www.netzero.com/3Gsweeps TODAY for your chance to win! |