Search in sources :

Example 71 with RequestDispatcher

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);
}
Also used : ServletException(javax.servlet.ServletException) RequestDispatcher(javax.servlet.RequestDispatcher)

Example 72 with RequestDispatcher

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);
}
Also used : User(ru.ivmiit.models.User) RequestDispatcher(javax.servlet.RequestDispatcher)

Example 73 with RequestDispatcher

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);
    }
}
Also used : RequestDispatcher(javax.servlet.RequestDispatcher) ServletException(javax.servlet.ServletException) IOException(java.io.IOException)

Example 74 with RequestDispatcher

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);
}
Also used : RequestDispatcher(javax.servlet.RequestDispatcher)

Example 75 with RequestDispatcher

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);
}
Also used : RequestDispatcher(javax.servlet.RequestDispatcher)

Aggregations

RequestDispatcher (javax.servlet.RequestDispatcher)354 ServletException (javax.servlet.ServletException)98 HttpSession (javax.servlet.http.HttpSession)97 IOException (java.io.IOException)74 HttpServletRequest (javax.servlet.http.HttpServletRequest)56 HttpServletResponse (javax.servlet.http.HttpServletResponse)44 SQLException (java.sql.SQLException)31 User (com.zyf.bean.User)28 ServletContext (javax.servlet.ServletContext)26 Properties (java.util.Properties)14 Test (org.junit.Test)14 RelatorioDAO (br.senac.tads3.pi03b.gruposete.dao.RelatorioDAO)13 RelatorioMudancas (br.senac.tads3.pi03b.gruposete.models.RelatorioMudancas)12 PrintWriter (java.io.PrintWriter)12 RequestDispatcherOptions (org.apache.sling.api.request.RequestDispatcherOptions)11 Resource (org.apache.sling.api.resource.Resource)11 ArrayList (java.util.ArrayList)9 Map (java.util.Map)9 GenericValue (org.apache.ofbiz.entity.GenericValue)9 WebUser (org.compiere.util.WebUser)9