Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

welcome page not comming

 
devarapalem kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic