• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

welcome file in web.xml

 
Ranch Hand
Posts: 160
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless

What is happening?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic