| Author |
welcome page not comming
|
devarapalem kumar
Greenhorn
Joined: Feb 21, 2012
Posts: 3
|
|
hi all
i am trying to add a welcome page to my sample application and it is not working below is my web.xml code
when i try to enter http://localhost:8080/Balance/ ----it is trowing 404 exception(list of jsp files are also not comming )
when i try using http://localhost:8080/balance/LoginServlet ---then it is working and going to that servlet as expected.
can some one help me over this as i am struck up
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56529
|
|
|
You want the welcome file to be a JSP? Should it not be going to the page controller for that page rather than the JSP itself?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Koen Aerts
Ranch Hand
Joined: Feb 07, 2012
Posts: 344
|
|
In "http://localhost:8080/Balance/" you use uppercase "B" in "Balance", but you don't in the next URL: "http://localhost:8080/balance/LoginServlet"
I assume you want to add "<welcome-file>LoginServlet</welcome-file>" in the welcome-file-list?
|
 |
devarapalem kumar
Greenhorn
Joined: Feb 21, 2012
Posts: 3
|
|
Thanks for adding that to my code i am new to java ranch so i couldnt add that.
"You want the welcome file to be a JSP? Should it not be going to the page controller for that page rather than the JSP itself? "
yeah i want it to be a jsp file.
i have place my <welcome-file> tag inside <welcome-file-list>
it is trowing 404 error for http://localhost:8080/Balance and for http://localhost:8080/Balance/LoginServlet it is working fine.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56529
|
|
Hmmm, going to a JSP file is not a good pattern to follow, but I suspect (assuming that the JSP is in the context root) that you need a leading slash.
And watch your casing. I'd advise to name all JSP files and url patterns with all lowercase as is the convention.
|
 |
devarapalem kumar
Greenhorn
Joined: Feb 21, 2012
Posts: 3
|
|
The jsp is not in the servletcontext path so it was not comming.
i was just trying to learn servlets so i have kept jsp as a welcome page.
Thanks everyone for replying.
|
 |
 |
|
|
subject: welcome page not comming
|
|
|