Sharing the Point

Office 365, SharePoint, Project Server – Blog

Posts Tagged ‘Tomcat’

How to Display Custom Error Page on Tomcat 6

Posted by Ashraf on December 3, 2010

If you are Unhappy with the default error pages that come with Tomcat then You can define your own custom error pages in your web.xml file after the following tag:

<welcome-file-list>

<welcome-file>index.html</welcome-file>

</welcome-file-list>

In the example shown below, i define 2 html pages — web_server_error_500.html and file_not_found_404.html which will be displayed when the server encounters an error 500 or an error 404 respectively. Put your html files on tomcat6.0/webapps/Root folder.  And add this code on web.xml file.

<error-page>

<error-code>500</error-code>

<location>/web_server_error_500.html</location>

</error-page>

<error-page>

<error-code>404</error-code>

<location>/file_not_found_404.html</location>

</error-page>

Please be aware that the order of the tags for the web.xml file is very important. If the order in your web.xml file is incorrect, Tomcat will output errors on startup.

And for Internet Explorer users be sure you have enabled “Show custom error pages” from Internet Options>Advanced tab.

Posted in System Administration | Tagged: , , , | Leave a Comment »

How to Configure Tomcat 6 – Custom Default Pages

Posted by Ashraf on December 1, 2010

Tomcat uses the same convention as the Apache Web Server in that index.html is

the default or home page of any directory. Sometimes you may want to change that

to homepage.html or maybe a JSP page, like home.jsp.

To do that, simply open the web.xml of your web application, and add the

following lines without commenting :

<welcome-file-list>

<welcome-file>home.jsp</welcome-file>

<welcome-file>homepage.html</welcome-file>

<welcome-file>index.html</welcome-file>

</welcome-file-list>

To change it system-wide, edit the global web.xml in $CATALINA_HOME/conf, and

change the to point to the file of your choice.

Posted in System Administration, Windows Server | Tagged: , , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 59 other followers