Even the genius asks questions.
2Pac
Even the genius asks questions.
2Pac
manu lix wrote:The category.jsp firs it was in WebContent/WEB-INF/Views.
Now to try I placed in WebContent
Even the genius asks questions.
2Pac
Bear Bibeault wrote:Files in WEB-INF are not served via URL, but they can be referenced by forwards. That's why it's a good place for JSPs.
What is your new forward call? Are you specifying the content-relative path?
Even the genius asks questions.
2Pac
Bear Bibeault wrote:You didn't fix the path. The method can't find the file if you don't tell it where it is!
Hint: the context root is the folder that the WEB-INF is in. What's the path to get to the JSP from there?
Even the genius asks questions.
2Pac
Even the genius asks questions.
2Pac
Even the genius asks questions.
2Pac
Stefan Evans wrote:Given what you have said so far, I would expect to see:
is right?
Even the genius asks questions.
2Pac
is right?
"<a href="category">"
Even the genius asks questions.
2Pac
Bear Bibeault wrote:Please read the JspFaq on formatting resource URLs. Your in-page URLs (like links) should start with the context path.
<a href="category">
Even the genius asks questions.
2Pac
manu lix wrote:And it's fine.
1. On the other hand, trying with context-relative path: /WEB-INF/Views/category See the blank page.
2. To do this, I put the forward in the service() method, since in the doGet() it does not work. Why?
Because the path of a JSP has nothing at all to do with your servlet. The path to the servlet should be the context path follow by the servlet path. Please see the JspFaq I mentioned.
You should not be defining a service method. If there's something wrong wit the get() you need to fix that.
Even the genius asks questions.
2Pac
Even the genius asks questions.
2Pac
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|