tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gadi Sastiel <gadi.sast...@gmail.com>
Subject Re: Tomcat returns Jsp source code as text/plain to the browser
Date Wed, 01 Oct 2014 09:10:12 GMT
In the web.xml under /tomcat/conf/

<!-- ==============================================
Default Servlet
=================================================== -->
 <servlet>
        <servlet-name>default</servlet-name>

<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <init-param>
            <param-name>listings</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>default</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

-----------------------------
<servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>

   <!-- The mappings for the JSP servlet -->
    <servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.jsp</url-pattern>
        <url-pattern>*.jspx</url-pattern>
    </servlet-mapping>



in the web.xml under the webapp:


<!-- ==============================================
Request Charset Encoding
=================================================== -->
<filter>
     <filter-name>requestCharsetEncoding</filter-name>

<filter-class>.........filters.SetRequestCharsetEncodingFilter</filter-class>
     <init-param>
     <param-name>encoding</param-name>
     <param-value>utf-8</param-value>
     </init-param>
</filter>

<filter-mapping>
<filter-name>requestCharsetEncoding</filter-name>
<url-pattern>*.jsf</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>

<filter>
     <filter-name>VerifyUserExistsFilter</filter-name>

<filter-class>.............filters.login.VerifyUserExistsFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>VerifyUserExistsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!-- ==============================================
The JSF Core Servlet
=================================================== -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>

<!-- ==============================================
Default Servlet
=================================================== -->
<servlet>
<servlet-name>default-local</servlet-name>
<servlet-class>
org.apache.catalina.servlets.DefaultServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>default-local</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>



Thanks

On Wed, Oct 1, 2014 at 11:06 AM, Mark Thomas <markt@apache.org> wrote:

> On 01/10/2014 08:14, Gadi Sastiel wrote:
> > Hi, the request is seen on the tomcat access log ( i've changed the
> > path deliberately)
> >
> > [01/Oct/2014:10:01:27 +0300] "GET /xxxxx/yyyyyy/zzzzz/aaaaPage.jsp%22
> > HTTP/1.1" 200 30223
>
> OK.
>
> Given that this doesn't happen on a clean Tomcat install it is likely
> that a servlet or filter in the web application is incorrectly
> responding to this request.
>
> What servlets and/or filters do you have mapped to "/" or "/*" ?
>
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message