Hi Tomasz,

It's a dispatcher mapping issue you have if I'm right... You can't
have your actions used at the context root ("/") until you add the
mapping for them in the Stripes dispatcher servlet.

Try the following :
1/ keep the default mapping for dispatcher servlet (e.g. "/action/*"
and "*.action")
2/ Use an UrlBinding like this :
  - @UrlBinding("/action/@found/:name)
  - @UrlBinding("/@found.action/:name)

This way, the Stripes dispatcher will be invoked, and then the Clean
URLs extension will handle the rest of the process transparently. The
drawback of this option is that you need a "delimiter" (either a
prefix - http://.../myApp/action/doIt... or a suffix -
http://.../myApp/doIt.action/...) for your actions.

Otherwise, if you absolutely want your URLs to look like this :
http://.../myApp/found/blah (not using any delimiter)  then :
1/ @UrlBinding("/@found/:name)
2/ add a mapping to your web.xml :

    <servlet-mapping>
        <servlet-name>StripesDispatcher</servlet-name>
        <url-pattern>/found/*</url-pattern>
    </servlet-mapping>

Of course, the disadvantage of that second option is that you
"hardcode" each action name in web.xml, as Stripes has to handle the
request for it... It can be a pain if you have lots of actions, but if
you have only a few it's ok...

HTH

Remi

On 3/28/07, Tomasz Korzeniowski <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have problem with friendly URL support in Stripes.
>
> I receive StackOverflowException (see at the bottom of the message)
> just after updating mapping of StripesDispatcher.
>
> <servlet-mapping>
>          <servlet-name>StripesDispatcher</servlet-name>
>          <url-pattern>/*</url-pattern>
> </servlet-mapping>
>
> Action is found and correct method executed but it fails on forward
> to jsp :-(
>
> Can you please guide me where is the problem?
>
> --- Action class
>
> @UrlBinding("/@found/:name/")
> public class FaceListActionBean extends AbstractActionBean {
>
>      private String name;
>
>      @DefaultHandler
>      public Resolution view() {
>          return new ForwardResolution("/WEB-INF/jsp/site/list.jsp");
>      }
>
>
>      public String getName() {
>          return name;
>      }
>
>      public void setName(String name) {
>          this.name = name;
>      }
>
> }
>
> --- web xml
> <?xml version="1.0" encoding="UTF-8"?>
>
> <web-app 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"
>           version="2.4">
>
>      <!-- Stripes Configuration -->
>      <filter>
>          <display-name>Stripes Filter</display-name>
>          <filter-name>StripesFilter</filter-name>
>          <filter-
> class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
>          <init-param>
>              <param-name>ActionResolver.PackageFilters</param-name>
>              <param-value>com.plugin.action.*</param-value>
>          </init-param>
>          <init-param>
>              <param-name>Configuration.Class</param-name>
>              <param-
> value>net.sourceforge.stripes.config.RuntimeConfiguration</param-value>
>          </init-param>
>          <init-param>
>              <param-name>ActionResolver.Class</param-name>
>              <param-
> value>net.sourceforge.stripes.cleanurls.CleanUrlActionResolver</param-
> value>
>          </init-param>
>          <init-param>
>              <param-name>Interceptor.Classes</param-name>
>              <param-value>
>                  net.sourceforge.stripes.cleanurls.CleanUrlInterceptor,
>
> net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor,
>
> net.sourceforge.stripes.integration.spring.SpringInterceptor
>              </param-value>
>          </init-param>
>      </filter>
>
>      <filter-mapping>
>          <filter-name>StripesFilter</filter-name>
>          <url-pattern>/*.jsp</url-pattern>
>          <dispatcher>REQUEST</dispatcher>
>      </filter-mapping>
>
>      <filter-mapping>
>          <filter-name>StripesFilter</filter-name>
>          <servlet-name>StripesDispatcher</servlet-name>
>          <dispatcher>REQUEST</dispatcher>
>      </filter-mapping>
>
>      <servlet>
>          <servlet-name>StripesDispatcher</servlet-name>
>          <servlet-
> class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-
> class>
>          <load-on-startup>1</load-on-startup>
>      </servlet>
>
>      <servlet-mapping>
>          <servlet-name>StripesDispatcher</servlet-name>
>          <url-pattern>/*</url-pattern>
>      </servlet-mapping>
>
>      <!-- Log4j Configuration -->
>
>      <context-param>
>          <param-name>webAppRootKey</param-name>
>          <param-value>pluginservice.root</param-value>
>      </context-param>
>
>      <context-param>
>          <param-name>log4jConfigLocation</param-name>
>          <param-value>/WEB-INF/log4j.properties</param-value>
>      </context-param>
>
>      <listener>
>          <listener-
> class>org.springframework.web.util.Log4jConfigListener</listener-class>
>      </listener>
>
>      <!-- Spring Configuration -->
>
>      <listener>
>          <listener-
> class>org.springframework.web.context.ContextLoaderListener</listener-
> class>
>      </listener>
>
> </web-app>
>
> ---- Exception
> 2007-03-28 15:21:08.446::INFO:  Started SelectChannelConnector @
> 0.0.0.0:8080
> 2007-03-28 15:23:19.897::WARN:  EXCEPTION
> net.sourceforge.stripes.exception.StripesServletException: Unhandled
> exception caught by the default exception handler.
>         at net.sourceforge.stripes.exception.DefaultExceptionHandler.handle
> (DefaultExceptionHandler.java:40)
>         at net.sourceforge.stripes.controller.StripesFilter.doFilter
> (StripesFilter.java:184)
>         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
> (ServletHandler.java:1065)
>         at org.mortbay.jetty.servlet.ServletHandler.handle
> (ServletHandler.java:365)
>         at org.mortbay.jetty.security.SecurityHandler.handle
> (SecurityHandler.java:185)
>         at org.mortbay.jetty.servlet.SessionHandler.handle
> (SessionHandler.java:181)
>         at org.mortbay.jetty.handler.ContextHandler.handle
> (ContextHandler.java:689)
>         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> 391)
>         at org.mortbay.jetty.handler.ContextHandlerCollection.handle
> (ContextHandlerCollection.java:146)
>         at org.mortbay.jetty.handler.HandlerCollection.handle
> (HandlerCollection.java:114)
>         at org.mortbay.jetty.handler.HandlerWrapper.handle
> (HandlerWrapper.java:139)
>         at org.mortbay.jetty.Server.handle(Server.java:285)
>         at org.mortbay.jetty.HttpConnection.handleRequest
> (HttpConnection.java:457)
>         at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
> (HttpConnection.java:751)
>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
>         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
>         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
>         at org.mortbay.io.nio.SelectChannelEndPoint.run
> (SelectChannelEndPoint.java:329)
>         at org.mortbay.thread.BoundedThreadPool$PoolThread.run
> (BoundedThreadPool.java:475)
> 2007-03-28 15:23:19.905::WARN:  Nested in
> net.sourceforge.stripes.exception.StripesServletException: Unhandled
> exception caught by the default exception handler.:
> java.lang.StackOverflowError
>         at java.util.HashMap.hash(HashMap.java:264)
>         at java.util.HashMap.removeEntryForKey(HashMap.java:541)
>         at java.util.HashMap.remove(HashMap.java:530)
>         at org.mortbay.util.AttributesMap.removeAttribute(AttributesMap.java:
> 50)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.removeAttribute(Dispatcher.java:402)
>         at org.mortbay.jetty.servlet.Dispatcher
> $ForwardAttributes.setAttribute(Dispatcher.java:382)
>
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Stripes-development mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-development
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to