Created
September 30, 2010 19:49
-
-
Save andreacfm/605202 to your computer and use it in GitHub Desktop.
Servlet that load and use the Railo AfmlEngineFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
*/ | |
public class CFMLServlet extends HttpServlet implements EngineChangeListener { | |
private CFMLEngine engine; | |
/** | |
* @see javax.servlet.Servlet#init(javax.servlet.ServletConfig) | |
*/ | |
public void init(ServletConfig sg) throws ServletException { | |
super.init(sg); | |
engine=CFMLEngineFactory.getInstance(sg,this); | |
} | |
/** | |
* @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) | |
*/ | |
protected void service(HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException { | |
engine.serviceCFML(this,req,rsp); | |
} | |
/** | |
* @see railo.loader.engine.EngineChangeListener#onUpdate(railo.loader.engine.CFMLEngine) | |
*/ | |
public void onUpdate(CFMLEngine newEngine) { | |
try { | |
engine=CFMLEngineFactory.getInstance(getServletConfig(),this); | |
} catch (ServletException e) { | |
engine=newEngine; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment