See below...

On Wed, 28 May 2003, Jason Carreira wrote:

> See below...
>
> > -----Original Message-----
> > From: Fernando Martins [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, May 28, 2003 10:22 AM
> > To: [EMAIL PROTECTED]
> > Subject: [OS-webwork] [OS-webwork2] mapping actions without .action
> >
> >
> >
> > Assuming that I have in xwork an action named "bar" inside a
> > package with namespace "foo/" if I want to map the follow
> > request to ServletDispatcher:
> >
>
> > ServletDispatcher) will return "" (normally would return
> > "/foo/bar.action", if the mapping would be *.action).
> >
> > I tried with JETTY and ORION, and while ORION will work with
> >
> > <url-pattern>*</url-pattern>
> >
> > (work means that getServletPath returns the 'correct' path:
> > "/foo/bar")
> >
> > JETTY doesn't accept such url-pattern. So I don't know which
> > container follows more closely the SPEC.
> >
> > How can I anchieve my purpose in both JETTY & ORION?
> >
> > I checked that when using url-pattern /* getServletPath()
> > returns "", but request.getPathInfo() returns "/foo/bar"
> > which if used in the following processing (instead of using
> > what getServletPath() returns) will find the action "bar" and
> > call it, which is what I need.
>
> I believe this is correct. I think getServletPath() is supposed to
> return the part of the path that matched the mapping, and getPathInfo()
> returns the rest... Of course, it's been a while since I read through a
> servlet spec :-) This could also be 2 different interpretations of an
> ambiguous spec.
>
> Anyone know for sure?
>
> Regardless, the fact that this works differently in 2 different servlet
> containers says that you'll probably have to have a hack in your custom
> dispatcher to handle both.
>
> >
> > So would it be possible to add the following lines to
> > ServletDispatcher?
> >
> >     if (actionPath.length()==0){
> >             actionPath = request.getPathInfo();
> >             servletPath = actionPath;
> >     }
> >
> > Or is there another more elegant solution to this?
> >
>
> You're going to need a custom dispatcher to support this. The
> ServletDispatcher has been designed for mapping to an extension. That
> said, I think it might be good to provide another dispatcher for WW2
> that uses everything up to the last "/" as the namespace, and the part
> after the last "/" as the action name.

Doesn't it allready does this with the exception of extracting servletPath
according to the spec?
If this is a problem of ambiguous spec then maybe we should determine what
the majority of containers are doing, and also submit this ambiguity to
Sun.
I thought Jetty was famous for keeping strict to spec.
So if in Jetty url-pattern * doesn't work, maybe it's not in the spec.
Then if /* returns paths as described above, it's not too much work to
adapt ServletDispatcher to it (to spec?).
Should I really need a custom dispatcher? I'm not implemeting nothing new,
and it's not a question of making it work in 2 containers, but just to
make it work according to spec, which in the end means what should be in
url-pattern.

Thanks
Fernando



-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to