use of javax.servlet.RequestDispatcher in project sonar-java by SonarSource.
the class UrlController method perform.
/**
* Method associated to a tile and called immediately before the tile
* is included. This implementation calls an <code>Action</code>.
* No servlet is set by this method.
*
* @param tileContext Current tile context.
* @param request Current request.
* @param response Current response.
* @param servletContext Current servlet context.
*/
public void perform(ComponentContext tileContext, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) throws ServletException, IOException {
RequestDispatcher rd = servletContext.getRequestDispatcher(url);
if (rd == null) {
throw new ServletException("Controller can't find url '" + url + "'.");
}
rd.include(request, response);
}
use of javax.servlet.RequestDispatcher in project JAVA_FIX by MarselSidikov.
the class SignUpServlet method doGet.
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
List<User> users = usersRepository.findAll();
req.setAttribute("usersFromServer", users);
RequestDispatcher dispatcher = req.getServletContext().getRequestDispatcher("/jsp/signUp.jsp");
dispatcher.forward(req, resp);
}
use of javax.servlet.RequestDispatcher in project joynr by bmwcarit.
the class DefaultServletWrapper method doGet.
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
try {
RequestDispatcher requestDispatcher = getServletContext().getNamedDispatcher("default");
requestDispatcher.forward(req, resp);
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
}
use of javax.servlet.RequestDispatcher in project jspwiki by apache.
the class WikiServlet method doGet.
/**
* {@inheritDoc}
*/
@Override
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
String pageName = DefaultURLConstructor.parsePageFromURL(req, m_engine.getContentEncoding());
log.info("Request for page: " + pageName);
if (pageName == null) {
// FIXME: Add special pages as well
pageName = m_engine.getFrontPage();
}
String jspPage = m_engine.getURLConstructor().getForwardPage(req);
RequestDispatcher dispatcher = req.getRequestDispatcher("/" + jspPage + "?page=" + m_engine.encodeName(pageName) + "&" + req.getQueryString());
dispatcher.forward(req, res);
}
use of javax.servlet.RequestDispatcher in project tutorials by eugenp.
the class HelloServlet method doGet.
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
RequestDispatcher dispatcher = req.getRequestDispatcher("/forwarded");
dispatcher.forward(req, resp);
}
Aggregations