File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android 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
How to put jsp files in a folder in a web project?
Struts JSP J2EE Security
URL... but not specific
Tomcat
My Page instead of Welcome Page of Tomcat