• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

welcome page not comming  RSS feed

 
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

 
Author and ninkuma
Marshal
Posts: 66806
168
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?
 
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
Posts: 66806
168
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!