Hi all

I'm trying to set up the asset encoder following the instruction of this
page :
http://jakarta.apache.org/tapestry/UsersGuide/friendly-urls.html#asset-encoder

I didn't have the asset encoder set up before, so I don't know whether I've
extra stuff to set up.

Whatever, following the instruction on the page above doesn't make my
application works. In fact it even fails with this error :
javax.servlet.ServletException: String index out of range: -2

java.lang.StringIndexOutOfBoundsException: String index out of range: -2
java.lang.String.substring(String.java:1768)
org.apache.tapestry.engine.encoders.AssetEncoder.decode(AssetEncoder.java
:69)
org.apache.tapestry.services.impl.RequestCycleFactoryImpl.decodeParameters(
RequestCycleFactoryImpl.java:133)
org.apache.tapestry.services.impl.RequestCycleFactoryImpl.newRequestCycle(
RequestCycleFactoryImpl.java:81)
javax.servlet.ServletException: String index out of range: -2

The stack trace, after these lines, is huge , and none of my images is
properly displayed.

I've just set up my hivemodule like this :
<module id="application" version="1.0.0">
   <contribution configuration-id="tapestry.url.ServiceEncoders">
         <page-service-encoder id="page" extension="html" service="page"/>
   </contribution>

   <contribution configuration-id="tapestry.url.ServiceEncoders">
         <asset-encoder id="asset" path="/assets"/>
   </contribution>
</module>

and my web.xml like this :
...
   <servlet>
       <servlet-name>myServlet</servlet-name>
       <servlet-class>org.apache.tapestry.ApplicationServlet
</servlet-class>
       <load-on-startup>1</load-on-startup>
   </servlet>
...
   <servlet-mapping>
         <servlet-name>myServlet</servlet-name>
         <url-pattern>/assets/*</url-pattern>
   </servlet-mapping>
...

When I put in my web.xml the mapping like this :
   <servlet-mapping>
         <servlet-name>myServlet</servlet-name>
         <url-pattern>/assets</url-pattern>
   </servlet-mapping>

no error is thrown but my images' url are normal (without encoding)..

Thanks in advance for your help !
ZedroS

Reply via email to