Wednesday, 7 August 2013

requestdispatcher forward to subdirectory

requestdispatcher forward to subdirectory

hEllo I have an Email form that is contained in a subdirectory like (In
netbeans) Web pages -> View -> Complements -> EmailForm.jsp
which action goes to a servlet:
...
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String recipient = request.getParameter("recipient");
String subject = request.getParameter("subject");
String content = request.getParameter("content");
String msm = "";
try {
EmailDAO.sendEmail(host, port, user, pass, recipient, subject,
content);
msm = "Successful";
} catch (Exception ex) {
ex.printStackTrace();
msm = "There is an error: " + ex.getMessage();
} finally {
request.setAttribute("message", msm);
RequestDispatcher rd =
request.getRequestDispatcher("View/Complements/EmailForm.jsp");
rd.forward(request, response);
}
}
The servelt works BUT:
when "forward" display back the jsp page, the CSS won't display, I mean
the paramenter message is showed but all the stylesheet properties is not.

No comments:

Post a Comment