Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

welcome file in web.xml

 
Ranch Hand
Posts: 160
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Here i have only one servlet in my project and i want to set it as home page. Is is possible ?? I tried all the options in <welcome-file> tag. It simply not working...

please help...
 
Marshal
Posts: 67275
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless

What is happening?
 
Bear Bibeault
Marshal
Posts: 67275
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And, sigh, what's with the .do? It's completely unnecessary and extraneous.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should work,but when it works,it'll go to /Index.do,then invoke the servlet basics.Index.....
You can change the /Index.to to any normal page...
 
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@OP
Remove the .do and try use the jsp/html page. I dont know what a .do is doing there.
If you want to redirect it to your servlet, then write a page redirect in index.html and use that as welcome file. Simple!
 
Ranch Hand
Posts: 153
Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In welcome file list you can have any thing either static html or Jsp/Servlet. Post exactly what is happening. Is your complete servelt path url is working fine ?
 
ankur trapasiya
Ranch Hand
Posts: 160
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works if i use full path ... e.g. http://localhost:8080/ServletsBasics/Index/
but i want it as my welcome page.... by default the page that is opened is http://localhost:8080/ServletsBasics/

And i am not using any HTML or JSP pages. I just want to know if it is possible to make servlet as a start page ot not....

 
Bear Bibeault
Marshal
Posts: 67275
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is, as of Servlets 2.4.
 
ankur trapasiya
Ranch Hand
Posts: 160
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then what changes do i have to made in web.xml ??

i tried

1) <welcome-file>/Index</welcome-file>
</welcome-file-list>

2) <welcome-file>basics.Index</welcome-file>
</welcome-file-list>

Both of this settings are not changing my homepage to Index servlet...
 
ankur trapasiya
Ranch Hand
Posts: 160
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

ankur trapasiya wrote:Then what changes do i have to made in web.xml ??

i tried

1) <welcome-file>/Index</welcome-file>
</welcome-file-list>

2) <welcome-file>basics.Index</welcome-file>
</welcome-file-list>

Both of this settings are not changing my homepage to Index servlet...



tried third one
<welcome-file>Index</welcome-file>
</welcome-file-list>

it works perfectly...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!