/** * Handles all requests * @param req HttpServletRequest object containing client request * @param res HttpServletResponse object for the response * @throws ServletException * @throws IOException */ protected void doRequest(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { JellyContext context = createContext(req, res); try { URL script = getScript(req); runScript(script, context, req, res); } catch (Exception e) { error(req, res, e); } }
protected void doGet( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doRequest(request, response); }
/** * <p> * Either use the query parameter "script", or the URI itself * to denote the script to run. * </p> * <p> * Example: script=index.jelly or http://localhost:8080/foo/index.jelly. * </p> * * @see org.apache.velocity.servlet.VelocityServlet#getTemplate * @param req * @return * @throws MalformedURLException */ protected URL getScript(HttpServletRequest req) throws MalformedURLException { String scriptUrl = req.getParameter("script"); if (scriptUrl == null) { scriptUrl = req.getPathInfo(); } URL url = getServletContext().getResource(scriptUrl); if (url == null) { throw new IllegalArgumentException("Invalid script url:" + scriptUrl); } return url; }
/** * <p> * Either use the query parameter "script", or the URI itself * to denote the script to run. * </p> * <p> * Example: script=index.jelly or http://localhost:8080/foo/index.jelly. * </p> * * @see org.apache.velocity.servlet.VelocityServlet#getTemplate * @param req * @return * @throws MalformedURLException */ protected URL getScript(HttpServletRequest req) throws MalformedURLException { String scriptUrl = req.getParameter("script"); if (scriptUrl == null) { scriptUrl = req.getPathInfo(); } if (scriptUrl == null) { scriptUrl = req.getServletPath(); } URL url = getServletContext().getResource(scriptUrl); if (url == null) { throw new IllegalArgumentException("Invalid script url:" + scriptUrl); } return url; }
/** * Handles all requests * @param req HttpServletRequest object containing client request * @param res HttpServletResponse object for the response * @throws ServletException * @throws IOException */ protected void doRequest(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { JellyContext context = createContext(req, res); try { URL script = getScript(req); runScript(script, context, req, res); } catch (Exception e) { error(req, res, e); } }
protected void doPost( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doRequest(request, response); }
/** * <p> * Either use the query parameter "script", or the URI itself * to denote the script to run. * </p> * <p> * Example: script=index.jelly or http://localhost:8080/foo/index.jelly. * </p> * * @see org.apache.velocity.servlet.VelocityServlet#getTemplate * @param req * @return * @throws MalformedURLException */ protected URL getScript(HttpServletRequest req) throws MalformedURLException { String scriptUrl = req.getParameter("script"); if (scriptUrl == null) { scriptUrl = req.getPathInfo(); } if (scriptUrl == null) { scriptUrl = req.getServletPath(); } URL url = getServletContext().getResource(scriptUrl); if (url == null) { throw new IllegalArgumentException("Invalid script url:" + scriptUrl); } return url; }
/** * Handles all requests * @param req HttpServletRequest object containing client request * @param res HttpServletResponse object for the response * @throws ServletException * @throws IOException */ protected void doRequest(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { JellyContext context = createContext(req, res); try { URL script = getScript(req); runScript(script, context, req, res); } catch (Exception e) { error(req, res, e); } }
protected void doGet( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doRequest(request, response); }
/** * <p> * Either use the query parameter "script", or the URI itself * to denote the script to run. * </p> * <p> * Example: script=index.jelly or http://localhost:8080/foo/index.jelly. * </p> * * @see org.apache.velocity.servlet.VelocityServlet#getTemplate * @param req * @return * @throws MalformedURLException */ protected URL getScript(HttpServletRequest req) throws MalformedURLException { String scriptUrl = req.getParameter("script"); if (scriptUrl == null) { scriptUrl = req.getPathInfo(); } if (scriptUrl == null) { scriptUrl = req.getServletPath(); } URL url = getServletContext().getResource(scriptUrl); if (url == null) { throw new IllegalArgumentException("Invalid script url:" + scriptUrl); } return url; }
/** * Handles all requests * @param req HttpServletRequest object containing client request * @param res HttpServletResponse object for the response * @throws ServletException * @throws IOException */ protected void doRequest(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { JellyContext context = createContext(req, res); try { URL script = getScript(req); runScript(script, context, req, res); } catch (Exception e) { error(req, res, e); } }
protected void doGet( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doRequest(request, response); }
/** * @see org.apache.velocity.servlet.VelocityServlet#createContext * @param req * @param res * @return */ protected JellyContext createContext( HttpServletRequest req, HttpServletResponse res) { JellyContext ctx = new JellyServletContext(getServletContext()); ctx.setVariable(REQUEST, req); ctx.setVariable(RESPONSE, res); return ctx; }
protected void doPost( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doRequest(request, response); }
/** * @see org.apache.velocity.servlet.VelocityServlet#createContext * @param req * @param res * @return */ protected JellyContext createContext( HttpServletRequest req, HttpServletResponse res) { JellyContext ctx = new JellyServletContext(getServletContext()); ctx.setVariable(REQUEST, req); ctx.setVariable(RESPONSE, res); return ctx; }
protected void doGet( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doRequest(request, response); }
/** * @see org.apache.velocity.servlet.VelocityServlet#createContext * @param req * @param res * @return */ protected JellyContext createContext( HttpServletRequest req, HttpServletResponse res) { JellyContext ctx = new JellyServletContext(getServletContext()); ctx.setVariable(REQUEST, req); ctx.setVariable(RESPONSE, res); return ctx; }
protected void doPost( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doRequest(request, response); }
/** * @see org.apache.velocity.servlet.VelocityServlet#createContext * @param req * @param res * @return */ protected JellyContext createContext( HttpServletRequest req, HttpServletResponse res) { JellyContext ctx = new JellyServletContext(getServletContext()); ctx.setVariable(REQUEST, req); ctx.setVariable(RESPONSE, res); return ctx; }
protected void doPost( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doRequest(request, response); }