Thanks for replying,I answered after you questions.

At 2014-09-30 17:25:53, "Konstantin Kolinko" <knst.koli...@gmail.com> wrote:
>2014-09-30 11:53 GMT+04:00 罗茂林 <a8156...@126.com>:
>> Here is my env:
>> Server version: Apache Tomcat/7.0.47
>> Server built:   Oct 18 2013 01:07:38
>> Server number:  7.0.47.0
>> OS Name:        Linux
>> OS Version:     2.6.32-358.el6.x86_64
>> Architecture:   amd64
>> JVM Version:    1.6.0_20-b02
>> JVM Vendor:     Sun Microsystems Inc.
>>
>>
>> The problem:
>> my application layout:
>> root
>>   |-/WEB-INF/web.xml
>

>What is in your web.xml file?


Below is the content in my web.xml :


<?xml version="1.0" encoding="UTF-8"?>
<web-app 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>test</display-name>
        <servlet>
                <servlet-name>ss</servlet-name>
                <servlet-class>com.Test</servlet-class>
        </servlet>
        <servlet-mapping>
                <servlet-name>ss</servlet-name>
                <url-pattern>/foo/*</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
                <servlet-name>default</servlet-name>
                <url-pattern>/healthcheck.html</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
                <servlet-name>jsp</servlet-name>
                <url-pattern>/WEB-INF/jsp/*</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
                <servlet-name>jsp</servlet-name>
                <url-pattern>/config/qmonitor.jsp</url-pattern>
        </servlet-mapping>
</web-app>


>
>>   |-/WEB-INF/classes
>>   |-/bar/index.jsp
>>   |-/META-INF
>>   |-/index.jsp
>>
>(...)
>
>> But when I further make a request to the http://127.0.0.1:8080/bar/ . A 404 
>> was responsed, like
>> #curl 127.0.0.1:8080/bar/ -v
>> * About to connect() to 127.0.0.1 port 8080 (#0)
>> *   Trying 127.0.0.1... connected
>> * Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
>>> GET /bar/ HTTP/1.1
>>> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 
>>> NSS/3.13.6.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
>>> Host: 127.0.0.1:8080
>>> Accept: */*
>>>
>> < HTTP/1.1 404 Not Found
>> < Server: Apache-Coyote/1.1
>> < Content-Type: text/html;charset=utf-8
>> < Content-Language: en
>> < Content-Length: 949
>> < Date: Tue, 30 Sep 2014 07:27:22 GMT
>> <
>> * Connection #0 to host 127.0.0.1 left intact
>> * Closing connection #0
>>
>>
>> I suggest that the /bar/index.jsp should be responsed for the welcome file 
>> mechanism.
>> But why i get a 404?
>
>What do you get if you invoke the file explicitly, without relying on

>welcome files feature?
>
>http://127.0.0.1:8080/bar/index.jsp

call  http://127.0.0.1:8080/bar/index.jsp directly still got 404.


#curl 127.0.0.1:8080/bar/index.jsp -v
* About to connect() to 127.0.0.1 port 8080 (#0)
*   Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /bar/index.jsp HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.6.0 
> zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: 127.0.0.1:8080
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Server: Apache-Coyote/1.1
< Content-Type: text/html;charset=utf-8
< Content-Language: en
< Content-Length: 949
< Date: Tue, 30 Sep 2014 11:36:52 GMT
< 
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0




>Best regards,
>Konstantin Kolinko
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>For additional commands, e-mail: users-h...@tomcat.apache.org
>

Reply via email to