RESTeasy and Returning to a JSP page with a model

Okay, I figured it out for anyone who is interested. It was actually fairly trivial once I found an example.

@GET
@Path("{eventid}")
@Produces("text/html")
public void getEvent(@Context HttpServletResponse response,
        @Context HttpServletRequest request,
        @PathParam("eventid") Long eventid) throws ServletException,
        IOException {

    EventDao eventdao = DaoFactory.getEventDao();
    Event event = eventdao.find(eventid);

    request.setAttribute("event", event);
    request.getRequestDispatcher("eventView.jsp").forward(request, response);

    }

Leave a Comment