Download jsp file from servlet (App Engine)

I would like to download the jsp file from the servlet class that I received in my App Engine project. I managed to load jsp files by adding them to the web.xml file, but is there any way to load them directly from the servlet class?

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

+5
source share
2 answers

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

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

If you want to forward this jsp use

 request.getRequestDispatcher("/file.jsp").forward(request, response);
+13
source

I was able to solve it myself. I had to add ./before the file name ...

req.getRequestDispatcher("./file.jsp").forward(req, resp);
+2

All Articles