This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Glassfish and the fly likes Index page not getting loaded by default Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Glassfish
Bookmark "Index page not getting loaded by default" Watch "Index page not getting loaded by default" New topic
Author

Index page not getting loaded by default

Ramesh Kumar Swarnkar
Ranch Hand

Joined: Sep 15, 2003
Posts: 84
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

Joined: Sep 15, 2003
Posts: 84
Hi Friends,
Please give your suggestion to go head here.....!
Ramesh Kumar Swarnkar
Ranch Hand

Joined: Sep 15, 2003
Posts: 84
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

Joined: Jan 22, 2011
Posts: 73

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"


| B.E IT | SCJP 6.0 98 % |
Ramesh Kumar Swarnkar
Ranch Hand

Joined: Sep 15, 2003
Posts: 84
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Index page not getting loaded by default
 
Similar Threads
URL... but not specific
My Page instead of Welcome Page of Tomcat
Struts JSP J2EE Security
Tomcat
How to put jsp files in a folder in a web project?