Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Index page not getting loaded by default

 
Ramesh Kumar Swarnkar
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have developed an application in Eclipse and Tomcat. This project has 'welcome.jsp' file which is outside WEB-INF folder and has been declared as index page in web.xml file :-


While running this project from eclipse using Tomcat server, the welcome.jsp page gets displayed as the default index page.
But when I making a war file and deploying on glassfish, the welcome.jsp page doest get displayed by default.
How should I fix this one.
please suggest.
 
Ramesh Kumar Swarnkar
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
Please give your suggestion to go head here.....!
 
Ramesh Kumar Swarnkar
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have added the Galssfish specific (i.e. container-specific) deployment file, sun-web.xml inside WEB-INF folder with the following contents:-

<?xml version="1.0" encoding="UTF-8"?>
<sun-web-app>
<context-root>/ContactManagement</context-root>
<welcome-file-list>
<welcome-file>welcome.jsp</welcome-file>
</welcome-file-list>
</sun-web-app>


Still it is not able to display the welcome.jsp file at context path call , like: http://localhost:8080/ContactManagement
It gives 404 Error.

Any input please ?
 
Ashish Agre
Ranch Hand
Posts: 73
Java Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you able to view the file when opened directly by typing the address in address bar example :


this was the code related to glassfish specific as you said...
can you give the contents of only "web.xml"
 
Ramesh Kumar Swarnkar
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ashish,
of course it is accessible by typing jsp name directly like:- http://serverip:port/ContactManagement/welcome.jsp .
But, then the purpose of defining <welcome-file> is not met.

Here is the code of web.xml :


please suggest.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic