D
Dundonald
I've just started using Netbeans 5.5 packaged with the sun java
application server 9. I run a web app with a context root of for the
sake of example "test", the default page set in web.xml to run at
startup is index.jsp, that is served fine in that index.jsp simply
redirects to a servlet call. The servlet executes fine, but any
resultant request for a jsp seems to be requested outside of the
context root instead of using the context root and a 404 is returned.
So it's obvious that the server is looking in the wrong place for the
JSP.
The flow of my application except for startup is when a link is
clicked always a servlet does some execution and then responds with a
redirect to a jsp for screen display.
To demonstrate:
Startup ->
http://localhost:8080/test/index.jsp (served ok) -> redirects to
http://localhost:8080/test/someservlet -> executes ok redirects to
http://localhost:8080/nextjsp.jsp
So questions are:
1. why does the first jsp (index.jsp) serve fine using the context
root and then
2. with any subsequent request the request for the jsp does not use
the context root?
Note that if I manually type in http://localhost:8080/test/nextjsp.jsp
it works.
Also note that in the web xml all the servlets have mappings and only
index.jsp is listed as the welcome jsp. Surely not every JSP has to
be listed in the web xml. I've had web apps in WSAD that didn't
require this.
And final note is that if I change the context root to / (well
actually netbeans doesn't let just / to be entered as context root so
the field has to be left as blank) a similar problem happens, because
for some reason, the server decides to use a context root after all of
"web". I don't understand that one either.
application server 9. I run a web app with a context root of for the
sake of example "test", the default page set in web.xml to run at
startup is index.jsp, that is served fine in that index.jsp simply
redirects to a servlet call. The servlet executes fine, but any
resultant request for a jsp seems to be requested outside of the
context root instead of using the context root and a 404 is returned.
So it's obvious that the server is looking in the wrong place for the
JSP.
The flow of my application except for startup is when a link is
clicked always a servlet does some execution and then responds with a
redirect to a jsp for screen display.
To demonstrate:
Startup ->
http://localhost:8080/test/index.jsp (served ok) -> redirects to
http://localhost:8080/test/someservlet -> executes ok redirects to
http://localhost:8080/nextjsp.jsp
So questions are:
1. why does the first jsp (index.jsp) serve fine using the context
root and then
2. with any subsequent request the request for the jsp does not use
the context root?
Note that if I manually type in http://localhost:8080/test/nextjsp.jsp
it works.
Also note that in the web xml all the servlets have mappings and only
index.jsp is listed as the welcome jsp. Surely not every JSP has to
be listed in the web xml. I've had web apps in WSAD that didn't
require this.
And final note is that if I change the context root to / (well
actually netbeans doesn't let just / to be entered as context root so
the field has to be left as blank) a similar problem happens, because
for some reason, the server decides to use a context root after all of
"web". I don't understand that one either.