Oops, sorry, I am new to the list :

server.xml 
starts------------------------------------------------------------------------------------

<Server port="8029" shutdown="SHUTDOWN">

  <GlobalNamingResources>
    <!-- Used by Manager webapp -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
       description="User database that can be updated and saved"
           factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
          pathname="conf/tomcat-users.xml" />
        <Environment name="serverURLPrefix" override="false" 
type="java.lang.String" value="1"/>
  </GlobalNamingResources>

  <Service name="Catalina">
    <!--<Connector port="8081" />-->

    <!-- This is here for compatibility only, not required 
    <Connector port="8009" protocol="AJP/1.3" />-->

    <!-- Define an AJP 1.3 Connector on port 8040 
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"-->
    <Connector port="8090" 
               enableLookups="true" redirectPort="8543" protocol="AJP/1.3" 
tomcatAuthentication="false" />
        <!-- 
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" -->
    <Engine name="Catalina" defaultHost="localhost">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase" />

         <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

         <!--<Valve className="org.apache.catalina.valves.AccessLogValve" 
directory="logs"
                prefix="tomcat_access." suffix=".log" pattern="common" 
resolveHosts="false"/>-->
 


      </Host>

 

    </Engine>

  </Service> 
</Server>

server.xml 
ends------------------------------------------------------------------------------------


META-INF/context.xml 
starts------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/" reloadable="true" debug="0" override="true">
        <ResourceLink global="serverURLPrefix" name="serverURLPrefix" 
type="java.lang.String"/>
</Context>

META-INF/context.xml 
ends------------------------------------------------------------------------------------

WEB-INF/web.xml 
starts------------------------------------------------------------------------------------

<?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>asw</display-name>
        <!--
          - Key of the system property that should specify the root 
directory of this
          - web app. Applied by WebAppRootListener or Log4jConfigListener.
          -->
        <context-param>
                <param-name>webAppRootKey</param-name>
                <param-value>ROOT</param-value>
        </context-param>

        <!--
          - Location of the Log4J config file, for initialization and 
refresh checks.
          - Applied by Log4jConfigListener.
          -->
        <context-param>
                <param-name>log4jConfigLocation</param-name>
                <param-value>/WEB-INF/log4j.properties</param-value>
        </context-param>
        <context-param>
                <param-name>log4jRefreshInterval</param-name>
                <param-value>60000</param-value>
        </context-param>
        <context-param>
                <param-name>log4jExposeWebAppRoot</param-name>
                <param-value>false</param-value>
        </context-param>


        <!--
          - Configures Log4J for this web app.
          - As this context specifies a context-param 
"log4jConfigLocation", its file path
          - is used to load the Log4J configuration, including periodic 
refresh checks.
          -
          - Would fall back to default Log4J initialization 
(non-refreshing) if no special
          - context-params are given.
          -
          - Exports a "web app root key", i.e. a system property that 
specifies the root
          - directory of this web app, for usage in log file paths.
          - This web app specifies "countries.root" (see log4j.properties 
file).
          -->
        <listener>
 <listener-class>com.pack.spring.MyLog4jConfigListener</listener-class>
        </listener>

        <!--
          - Loads the root application context of this web app at startup,
          - by default from "/WEB-INF/applicationContext.xml".
                - Note that you need to fall back to Spring's 
ContextLoaderServlet for
                - J2EE servers that do not follow the Servlet 2.4 
initialization order.
                -
          - Use 
WebApplicationContextUtils.getWebApplicationContext(servletContext)
          - to access it anywhere in the web application, outside of the 
framework.
          -
          - The root context is the parent of all servlet-specific 
contexts.
          - This means that its beans are automatically available in these 
child contexts,
          - both for getBean(name) calls and (external) bean references.
          -->
        <listener>
 
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <filter>
            <filter-name>logging-filter</filter-name>
 
<filter-class>org.springframework.web.filter.Log4jNestedDiagnosticContextFilter</filter-class>
        </filter>
        <filter>
                <description></description>
                <display-name>XSS</display-name>
                <filter-name>XSSFilter</filter-name>
                <filter-class>
                        com.pack.security.CrossScriptingFilter
                </filter-class>
        </filter>
        <filter>
            <filter-name>encoding-filter</filter-name>
 
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
            <init-param>
                <param-name>encoding</param-name>
                <param-value>UTF-8</param-value>
            </init-param>
        </filter>
 
        <filter>
                <filter-name>springSecurityFilterChain</filter-name>
 
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        </filter> 
 
        <filter-mapping>
                <filter-name>logging-filter</filter-name>
                <url-pattern>*.jspx</url-pattern>
        </filter-mapping>
        <filter-mapping>
                <filter-name>logging-filter</filter-name>
                <url-pattern>*.htm</url-pattern>
        </filter-mapping>
        <filter-mapping>
                <filter-name>logging-filter</filter-name>
                <url-pattern>*.do</url-pattern>
        </filter-mapping>
        <filter-mapping>
                <filter-name>logging-filter</filter-name>
                <url-pattern>*.jsp</url-pattern>
        </filter-mapping>
<!-- 
        <filter-mapping>
                <filter-name>logging-filter</filter-name>
                <url-pattern>*.html</url-pattern>
        </filter-mapping>
-->
    <filter-mapping>
                <filter-name>XSSFilter</filter-name>
                <url-pattern>/*</url-pattern>
        </filter-mapping>
        <filter-mapping>
            <filter-name>encoding-filter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping> 

        <filter-mapping>
                <filter-name>springSecurityFilterChain</filter-name>
                <url-pattern>/*</url-pattern>
        </filter-mapping>
 
        <!--
          - Servlet that dispatches request to registered handlers 
(Controller implementations).
          - Has its own application context, by default defined in 
"{servlet-name}-servlet.xml",
          - i.e. "countries-servlet.xml".
          -
          - A web app can contain any number of such servlets.
          - Note that this web app has a shared root application context, 
serving as parent
          - of all DispatcherServlet contexts.
          -->
        <servlet>
                <servlet-name>main</servlet-name>
 <servlet-class>com.pack.spring.SpringStartupServlet</servlet-class>
                <init-param>
                        <param-name>envBeanName</param-name>
                        <param-value>site.environment</param-value>
                </init-param>
                <load-on-startup>2</load-on-startup>
        </servlet>
 
        <servlet>
                <servlet-name>dwr</servlet-name>
                <servlet-class>
                        org.directwebremoting.spring.DwrSpringServlet
                </servlet-class>
                <init-param>
                        <param-name>debug</param-name>
                        <param-value>false</param-value>
                </init-param>
                <init-param>
 <param-name>crossDomainSessionSecurity</param-name>
                        <param-value>false</param-value>
                </init-param>
        </servlet>

        <servlet-mapping>
                <servlet-name>main</servlet-name>
                <url-pattern>*.htm</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
                <servlet-name>main</servlet-name>
                <url-pattern>*.jspx</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
                <servlet-name>main</servlet-name>
                <url-pattern>*.do</url-pattern>
        </servlet-mapping>
 
        <servlet-mapping>
                <servlet-name>dwr</servlet-name>
                <url-pattern>/dwr/*</url-pattern>
        </servlet-mapping>

        <session-config>
                <session-timeout>60</session-timeout>
        </session-config>

        <!--
          - Redirects to "home.htm" for dispatcher handling
          -->
        <welcome-file-list>
                <welcome-file>index.jspx</welcome-file>
                <welcome-file>index.htm</welcome-file>
                <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>

        <!--
          - Error page
        -->
        <error-page>
                <error-code>404</error-code>
                <location>/notfound.do</location>
        </error-page>

        <!--
                - Reference to Countries database.
                - Only needed if not using a local DataSource but a JNDI 
one instead.
                -->
        <resource-ref>
                <res-ref-name>jdbc/test</res-ref-name>
                <res-type>javax.sql.DataSource</res-type>
                <res-auth>Container</res-auth>
        </resource-ref>
        <!-- Remove comments if require mail functionality -->
<!-- <resource-ref>
                <res-ref-name>mail/test</res-ref-name>
                <res-type>javax.mail.Session</res-type>
                <res-auth>Container</res-auth>
        </resource-ref>-->
        <env-entry>
                <env-entry-name>serverURLPrefix</env-entry-name>
                <env-entry-type>java.lang.String</env-entry-type>
        </env-entry>
        <env-entry>
                <env-entry-name>mediaServerUrlPrefix</env-entry-name>
                <env-entry-type>java.lang.String</env-entry-type>
        </env-entry>
        <env-entry>
                <env-entry-name>logLocation</env-entry-name>
                <env-entry-type>java.lang.String</env-entry-type>
        </env-entry>
        <jsp-config>
                <taglib>
                        <taglib-uri>http://java.sun.com/jstl/core
</taglib-uri>
 <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
                </taglib>
                <taglib>
                        <taglib-uri>http://java.sun.com/jstl/fn
</taglib-uri>
 <taglib-location>/WEB-INF/tld/fn.tld</taglib-location>
                </taglib>
                <taglib>
                        <taglib-uri>http://java.sun.com/jstl/fmt
</taglib-uri>
 <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
                </taglib>
                <taglib>
                  <taglib-uri>http://jsptags.com/tags/navigation/pager
</taglib-uri>
 <taglib-location>/WEB-INF/tld/pager-taglib.tld</taglib-location>
                </taglib>
                <taglib>
                  <taglib-uri>http://framework.company.com/framework
</taglib-uri>
 <taglib-location>/WEB-INF/tld/framework.tld</taglib-location>
                </taglib>
        </jsp-config>

        <!-- Admin section authentication handled via Tomcat -->
        <!-- START - Admin Authentication -->
<!-- <security-constraint>
                <web-resource-collection>
                        <web-resource-name>Admin 
Application</web-resource-name>
                        <url-pattern>/admin/*</url-pattern>
                </web-resource-collection>
                <auth-constraint>
                        <role-name>project-admin</role-name>
                </auth-constraint>
        </security-constraint>
 
        <login-config>
                <auth-method>BASIC</auth-method>
                <realm-name>Administration</realm-name>
        </login-config>
 
        <security-role>
                <description>The role that is required to log in to the 
Manager Application</description>
                <role-name>project-admin</role-name>
        </security-role>
 -->
        <!-- END - Admin Authentication -->

</web-app>

WEB-INF/web.xml 
ends------------------------------------------------------------------------------------



From:
André Warnier <a...@ice-sa.com>
To:
Tomcat Users List <users@tomcat.apache.org>
Date:
10/28/2011 03:28 PM
Subject:
Re: Static files not being displayed



Rajkumar Singh wrote:
> Hi Andre
> 
> Please find the files as an attachment.

You have to paste the content in the text of your message. The list strips 
most attachments.


> 
> 
> 
> Thanks
> Raj
> 
> 
> 
> From:
> André Warnier <a...@ice-sa.com>
> To:
> Tomcat Users List <users@tomcat.apache.org>
> Date:
> 10/28/2011 03:10 PM
> Subject:
> Re: Static files not being displayed
> 
> 
> 
> Rajkumar Singh wrote:
>> Hello guys,
>>
>> I am using tomcat version 6.0.29. The tomcat is deployed on the OS 
> Linux.
>> I created a war file named ROOT.war and dropped it under the tomcat 
>> "webapps" folder. The WAR consists of JSP, JAR, XML and static files 
> like 
>> images, javascript and CSS.
>>
>> The tomcat expanded the WAR file properly and I was able to get to the 
>> dynamic files of my application through the URL. However what I noticed 

>> was that all the static files are not fetched from the server. I get 
404 
> 
>> error in my firebug (Using firefox as my browser).
>>
>> And the dynamic files are shown correctly, no problem with that. Even 
my 
> 
>> application is making the database call and making right transaction 
> with 
>> it
>>
>> Can someone please help me in resolving the issue? Is there any 
>> configuration that needs to be done on the tomcat server. To let you 
all 
> 
>> know, this is the first time I am working on the tomcat 6 version.
>>
> 
> To my knowledge, there is nothing "special" in terms of configuration 
> required to allow 
> Tomcat to serve static files, if they are in the right place.
> (Of course, this applies to a "standard" Tomcat downloaded from 
> tomcat.apache.org; things 
> may be different for pre-packaged Tomcat's from other sources).
> 
> To get more help, you will need to provide some additional information.
> Since you are using firebug, you should be able to see which exact URL 
the 
> browser 
> requests for one of these static elements.
> Give us an example, and also tell us the path of this same element on 
> disk.
> What may also help is the content of the ./WEB-INF/web.xml file of your 
> application, and 
> the ./META-INF/context.xml if there is one (all comments and passwords 
> removed).
> 
> And also tell us where you got your Tomcat from, and where you find 
> Tomcat's "server.xml" 
> file.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 
> ------------------------------------------------------------------------
> Disclaimer 
> The information in this email and any attachments may contain 
proprietary and confidential information that is intended for the 
addressee(s) only. If you are not the intended recipient, you are hereby 
notified that any disclosure, copying, distribution, retention or use of 
the contents of this information is prohibited.  When addressed to our 
clients or vendors, any information contained in this e-mail or any 
attachments is subject to the terms and conditions in any governing 
contract. If you have received this e-mail in error, please immediately 
contact the sender and delete the e-mail.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



------------------------------------------------------------------------
Disclaimer 
The information in this email and any attachments may contain proprietary and 
confidential information that is intended for the addressee(s) only. If you are 
not the intended recipient, you are hereby notified that any disclosure, 
copying, distribution, retention or use of the contents of this information is 
prohibited.  When addressed to our clients or vendors, any information 
contained in this e-mail or any attachments is subject to the terms and 
conditions in any governing contract. If you have received this e-mail in 
error, please immediately contact the sender and delete the e-mail.

Reply via email to