Spring, Css mapping error, appending index.html.

49 views
Skip to first unread message

paulm

unread,
Apr 10, 2009, 11:32:25 AM4/10/09
to Google App Engine
I am using a css file in my jsp file like this:

<link href="css/corp.css" rel="stylesheet" type="text/css" />

I am getting:

- No mapping for [/css/corp.css/index.html] in DispatcherServlet with
name xxx

I do not know why App Eng appends index.html. Is it because I am using
Spring Framework for my app eng application? How can I fix the
problem?

Same for all images, it is also appending index.html after image file
names.

Thanks,

Jeff S

unread,
Apr 10, 2009, 4:29:09 PM4/10/09
to google-a...@googlegroups.com
Hi paulm,

Would you mind posting your web.xml file and your appengine-web.xml file? The static files should be mapped in appengine-web.xml (though you can map them to a default serlet in web.xml). For specific details, see:

http://code.google.com/appengine/docs/java/config/appconfig.html#Static_Files_and_Resource_Files

Thank you,

Jeff

Jun

unread,
Apr 12, 2009, 9:33:14 AM4/12/09
to Google App Engine
Hi Jeff,

Here is our appengine-web.xml file:

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application></application>
<version>1</version>

<sessions-enabled>true</sessions-enabled>

<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/
logging.properties"/>
</system-properties>

<static-files>
<include path="/**.css" />
<include path="/**.jpg" />
</static-files>

</appengine-web-app>


And web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
<web-app>

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

<listener>
<listener-class>com.strongtech.iii.web.IIIWatch</listener-class>
</listener>

<servlet>
<servlet-name>AxisServlet</servlet-name>
<display-name>Apache-Axis Servlet</display-name>
<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-
class>
</servlet>

<servlet>
<servlet-name>AdminServlet</servlet-name>
<display-name>Axis Admin Servlet</display-name>
<servlet-class>org.apache.axis.transport.http.AdminServlet</servlet-
class>
<load-on-startup>100</load-on-startup>
</servlet>

<servlet>
<servlet-name>SOAPMonitorService</servlet-name>
<display-name>SOAPMonitorService</display-name>
<servlet-class>org.apache.axis.monitor.SOAPMonitorService</servlet-
class>
<init-param>
<param-name>SOAPMonitorPort</param-name>
<param-value>5001</param-value>
</init-param>
<load-on-startup>100</load-on-startup>
</servlet>

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

<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>*.jws</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>SOAPMonitorService</servlet-name>
<url-pattern>/SOAPMonitor</url-pattern>
</servlet-mapping>

<mime-mapping>
<extension>wsdl</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>

<!-- spring framework -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</context-param>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
/WEB-INF/applicationContext-hibernate.xml
</param-value>
</context-param>

<listener>
<listener-
class>org.springframework.web.context.ContextLoaderListener</listener-
class>
</listener>

<servlet>
<servlet-name>iii</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</
servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>iii</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>export</servlet-name>
<servlet-class>com.strongtech.iii.web.ExportReport</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>export</servlet-name>
<url-pattern>/export.xml</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>export</servlet-name>
<url-pattern>/export.csv</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>jasperhtml</servlet-name>
<servlet-class>com.strongtech.iii.web.JasperHtmlServlet</servlet-
class>
</servlet>

<servlet-mapping>
<servlet-name>jasperhtml</servlet-name>
<url-pattern>/jasper.html</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>ccbillapproval</servlet-name>
<servlet-class>com.strongtech.iii.web.CCBillApproval</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>ccbillapproval</servlet-name>
<url-pattern>/ccbillapproval.srv</url-pattern>
</servlet-mapping>
</web-app>


Thanks Jeff,

Jun






On Apr 10, 4:29 pm, Jeff S <j...@google.com> wrote:
> Hi paulm,
>
> Would you mind posting your web.xml file and your appengine-web.xml file?
> The static files should be mapped in appengine-web.xml (though you can map
> them to a default serlet in web.xml). For specific details, see:
>
> http://code.google.com/appengine/docs/java/config/appconfig.html#Stat...
>
> Thank you,
>
> Jeff
>
>
>
> On Fri, Apr 10, 2009 at 8:32 AM, paulm <paulmarso...@gmail.com> wrote:
>
> > I am using a css file in my jsp file like this:
>
> > <link href="css/corp.css" rel="stylesheet" type="text/css" />
>
> > I am getting:
>
> > - No mapping for [/css/corp.css/index.html] in DispatcherServlet with
> > name xxx
>
> > I do not know why App Eng appends index.html. Is it because I am using
> > Spring Framework for my app eng application? How can I fix the
> > problem?
>
> > Same for all images, it is also appending index.html after image file
> > names.
>
> > Thanks,- Hide quoted text -
>
> - Show quoted text -

Jeff S

unread,
Apr 14, 2009, 3:12:41 PM4/14/09
to Google App Engine
Hi Jun,

Thanks for sharing, I'm wondering if the issue could also be in the
war directory structure. I tried to reproduce but haven't been able to
so far. To test I created a new project with the following war layout
war
|-- WEB-INF
| |-- appengine-web.xml
| |-- classes
| `...
| |-- lib
| | |...
| `-- web.xml
|-- css
| `-- corp.css
`-- index.html

It doesn't look like there is a mapping that would match things like /
css/*.css, so it seems that the default servlet should serve the CSS
file if it is in the expected location under war. In my simple example
I was able to view the CSS file with and without an explicit <static-
files> element in my appengine-web.xml

Thank you,

Jeff

Puran

unread,
Apr 16, 2009, 1:41:43 PM4/16/09
to Google App Engine
Did anyone solved this problem i am having a same problem it attaches
index.html at the end.

On Apr 14, 12:12 pm, Jeff S <j...@google.com> wrote:
> Hi Jun,
>
> Thanks for sharing, I'm wondering if the issue could also be in the
> war directory structure. I tried to reproduce but haven't been able to
> so far. To test I created a new project with the following war layout
> war
>   |-- WEB-INF
>   |   |-- appengine-web.xml
>   |   |-- classes
>   |   `...
>   |   |-- lib
>   |   |   |...
>   |   `-- web.xml
>   |--css
>   |   `-- corp.css
>   `--index.html
>
> It doesn't look like there is amappingthat would match things like /css/*.css, so it seems that the default servlet should serve theCSS
> file if it is in the expected location under war. In my simple example
> I was able to view theCSSfile with and without an explicit <static-
> >         <!--springframework -->
> > > > I am using acssfile in my jsp file like this:
>
> > > > <link href="css/corp.css" rel="stylesheet" type="text/css" />
>
> > > > I am getting:
>
> > > > - Nomappingfor [/css/corp.css/index.html] in DispatcherServlet with
> > > > name xxx
>
> > > > I do not know why App Eng appendsindex.html. Is it because I am using
> > > >SpringFramework for my app eng application? How can I fix the
> > > > problem?
>
> > > > Same for all images, it is alsoappendingindex.htmlafter image file

Jun

unread,
Apr 16, 2009, 5:13:01 PM4/16/09
to Google App Engine
The problem is caused by the following settings in web.xml file.

<servlet-mapping>
<servlet-name>iii</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>

I changed *.html to *.do, the problem was solved.

Thanks,

Jun
> > > > - Show quoted text -- Hide quoted text -

Puran

unread,
Apr 16, 2009, 5:28:09 PM4/16/09
to Google App Engine
Thanks, When i do that not sure why it tries to look in the location /
iii/css/home.css instead and complains .. i thought it should be just
inside war/css/home.css . do i need to create that folder name same as
servlet name??

Giri Nandigam

unread,
Apr 20, 2009, 12:36:58 PM4/20/09
to Google App Engine
Any progress on this issue?

I have the same problem.
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages