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
public final class CompileAll extends HttpServlet
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:
- Serialized Form
- Last modified
- $Date: 2015-05-12 11:27:08 +0200 (ti, 12 maj 2015) $
-
Field Summary
Fields Modifier and Type Field Description private static Comparator<String>
pathComparator
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description CompileAll()
-
Method Summary
Modifier and Type Method Description private 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:
- Constant Field Values
-
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 IOExceptionCompile all files found in dir, recursively entering subdirectories.- Parameters:
dir
- The starting directory- Throws:
IOException
-