Class CompileAll
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
net.sf.basedb.clients.web.servlet.CompileAll
- All Implemented Interfaces:
Serializable
,Servlet
,ServletConfig
This servlet will scan for all files ending with .jsp and issue
a request for them with the parameter
jsp_precompile=true
therby compiling all JSP files into servlets.
This code is based on code written by RĂ©al Gagnon: http://www.rgagnon.com/javadetails/java-0414.html
- Version:
- 2.0
- Author:
- nicklas
- See Also:
- Last modified
- $Date: 2015-05-12 11:27:08 +0200 (ti, 12 maj 2015) $
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final Comparator<String>
private static final long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
compile
(String dir, HttpServletRequest request, HttpServletResponse response) Compile all files found in dir, recursively entering subdirectories.void
doGet
(HttpServletRequest request, HttpServletResponse response) void
doPost
(HttpServletRequest request, HttpServletResponse response) Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
pathComparator
-
-
Constructor Details
-
CompileAll
public CompileAll()
-
-
Method Details
-
doGet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException - Overrides:
doGet
in classHttpServlet
- Throws:
IOException
ServletException
-
doPost
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException - Overrides:
doPost
in classHttpServlet
- Throws:
IOException
ServletException
-
compile
private boolean compile(String dir, HttpServletRequest request, HttpServletResponse response) throws IOException Compile all files found in dir, recursively entering subdirectories.- Parameters:
dir
- The starting directory- Throws:
IOException
-