views:

45

answers:

2

I would like to load a jsp file from a servlet-class I got in my App Engine project. I has been able to load jsp files by adding them to the web.xml file but is there any way to load them directly from a servlet class?

Edit: I have tried this without success (no error msg or anything) req.getRequestDispatcher("file.jsp").forward(req, resp);

+1  A: 

I was able to solve it myself. Had to add ./ before the filename...

req.getRequestDispatcher("./file.jsp").forward(req, resp);
Irro
A: 

If you want to include a JSP in the generated response, use

 request.getRequestDispatcher("/file.jsp").include(request, response);

If you want to forward to that jsp, use

 request.getRequestDispatcher("/file.jsp").forward(request, response);
Bozho