I worked out the source of the issue I reported before Christmas.

I was trying to replicate the Quickstart example using guice-servlets
to wire up servlet paths.

Diving into the stack, it looks like DispatcherServlet is doing
everything which it ought to do, and reaches the line...
request.getRequestDispatcher(path).forward(request, response);
...where it is using the values of....
request.path:"/examples/quickstart/Calculator.action"
path:"/quickstart/index.jsp"
...and hands off the forward to the Guice environment.

At this point we encounter bug 522 in Guice related to its failed
forwarding behaviour, or one of the other live forwarding bugs in the
library...
http://code.google.com/p/google-guice/issues/detail?id=522
http://code.google.com/p/google-guice/issues/list?can=2&q=forward&colspec=ID+Type+Status+Priority+Milestone+Owner+Summary+Extension&cells=tiles
...the forward is botched, with the wrong path embedded in the
request, and the error misreports the attempted path (at this stage it
is no longer '/examples/quickstart/Calculator.action' which is trying
to be served).

Cefn
http://cefn.com

On 29 December 2010 17:57, Cefn Hoile <stripes-us...@cefn.com> wrote:
> Trying again - my mail did not appear on the list last attempt.
>
> I'm trying to replicate the simple Quickstart configuration in Jetty 7
> using Guice 2.9.2 and Stripes 1.5.4...
> http://www.stripesframework.org/display/stripes/Quick+Start+Guide
>
> I think I have the key code correct, (shown inline below) which wires
> up .jsp and .action, and makes sure the StripesFilter gets a look at
> everything.
>
> Although the quickstart/index.jsp page gets served fine, if I try to
> add or divide a number, the DispatcherServlet chokes on the request
> for /examples/quickstart/Calculator.action and treats it as a file
> request!
>
> The console error I get in Jetty is as follows, where /path/to/webapp
> is the resource folder in my filesystem.
>
>>>>>>>
> ERROR: PWC6117: File
> "/path/to/webapp/examples/quickstart/Calculator.action" not found
> <<<<<<
>
> The class net.sourceforge.stripes.examples.quickstart.CalculatorActionBean
> is indeed in the classpath, so I can't see what failure
> DispatcherServlet can have encountered, and why it won't do the right
> thing.
>
> Here's the code which wires filters and servlets. If I replace
> DispatcherServlet with a simple hello world servlet, the submission
> request gets routed to it perfectly fine, so I'm pretty sure
> DispatcherServlet is handling the request.
>
>>>>>>>>>
>
> //add stripes filter
> bind(StripesFilter.class).in(Singleton.class);
> Map<String,String> stripesFilterParams = new HashMap<String,String>();
> stripesFilterParams.put("ActionResolver.Packages",
> "net.sourceforge.stripes.examples");
> filter("*").through(StripesFilter.class, stripesFilterParams);
>
> //add binding for Stripes actions
> bind(DispatcherServlet.class).in(Singleton.class); //stripes
> serve("*.action").with(DispatcherServlet.class);
>
> //serve jsp template files
> bind(JspServlet.class).in(Singleton.class); //Jasper
> serve("*.jsp").with(JspServlet.class);
>
> <<<<<<<<<<
>
> See more code detail at...
>
> https://github.com/cefn/Spring-JPA-MVC-Postgres/tree/eef22d20cf8c149d2d5bae0a4f12cbed31223bdd/src/main/java/com/cefn/filesystem/servlet
>
> ...for example the code above is at...
>
> https://github.com/cefn/Spring-JPA-MVC-Postgres/blob/eef22d20cf8c149d2d5bae0a4f12cbed31223bdd/src/main/java/com/cefn/filesystem/servlet/ServletContextAdaptor.java
>
> ...and the current packages composing the app can be read here...
>
> https://github.com/cefn/Spring-JPA-MVC-Postgres/blob/eef22d20cf8c149d2d5bae0a4f12cbed31223bdd/pom.xml
>

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to