Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web.xml file deployed in tomcat not loading/reading

 
Sujithkumar mp
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have deployed a wep application war in hosted server. But when I hit the domain url the welcome file specified in web.xml is not getting loaded.
When I hit the complete url I am getting the page but css files in the page are not getting loaded.

The same war when deployed in my local server working fine. I am using tomcat 5.5. Anyone can help on this? Thanks in advance


Please find my web.xml file

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>
Fig</display-name>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>home.jsp</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>


 
Sujithkumar mp
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

can anyone help/suggest on this...?

Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting the HTML but not the CSS suggests the specification of the CSS location is incorrect.

Working locally but not remotely suggests you used a CSS path based on the real file location, not the web app relative location.

Bill
 
Sujithkumar mp
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Bill for the suggestion.
But can you please tell why the welcome file specified in web xml is not getting loaded.

Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What actually happens when you address the web app without specifying the page? Do you get an error report?

If you can get the HTML by directly specifying the page, that suggests that Tomcat recognizes the web app path which implies that the web.xml is being read.
 
Sujithkumar mp
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am getting the below error when requested url without specifying page.
"The requested url was not found on this server.
Additionally, a 404 not found error was encountered".

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic