On Thu, Jan 02, 2003 at 09:15:44PM +0100, Rickard �berg wrote:
> Chris Nokleberg wrote:
> >On Thu, Jan 02, 2003 at 08:00:41PM +0100, Rickard �berg wrote:
> >
> >But one of the reasons to get rid of .action is that it exposes the
> >implementation. ".jsp" does the same thing!
>
> Absolutely. But at least XWork would be hidden.
>
> >Why not allow for arbitrary
> >URLs, even when you want to use JSP as your view technology? Then it can
> >just become another templating language. Intercepting calls to ".jsp"
> >pages is not very Model 2. Maybe Model 1.5.
>
> AFAICT there's no expressive difference between what I suggested and
> using the .action way, except that the former can only map a JSP to one
> action.
>
> Can you explain how is it "not very Model 2"?
We are miscommunicating, I'm sure. From his responses I think Jason
Carreira is on the same wavelength as me, though, if it helps.
Anyway, here goes:
Model 1:
a) user requests "/foo/bar.jsp"
b) request goes to servlet container jsp handler, runs bar.jsp
c) bar.jsp uses scriptlets, beans to run business logic
Model 2 (jsp view)
a) user requests "/foo/bar"
b) request is mapped to a servlet Bar
c) servlet Bar runs business logic, sticks stuff in context
d) servlet forwards to "/some/arbitrary.jsp"
e) "/some/arbitrary.jsp" executed by container
Model 2 (velocity, etc.)
a-c) same
d) servlet spits out result of velocity template
What I hear you proposing:
a) user requests "/foo/bar.jsp" <-- Note .jsp
b) request is mapped by xwork filter controller to action Bar
c) action Bar runs business logic, returns "success" result
d) "success" result mapped to "LetItPassThrough" view-string
e) view-string looked up via view factory to return LetItPassThrough View
f) LetItPassThrough View directs controller to let the servlet
engine handle the request as normal, or something similar
g) "/foo/bar.jsp" executed by container
What I propose (jsp view)
a) user requests "/foo/bar" <-- Note NO .jsp
b) request is mapped by xwork filter controller to action Bar
c) action Bar runs business logic, returns "success" result
d) "success" result mapped to "/some/arbitrary.jsp" view-string
e) view-string looked up via view factory to return JSP View
f) JSP View uses request dispatcher to forward to "/some/arbitrary.jsp"
What I propose (velocity, etc.)
a-c) same
d) "success" result mapped to "/some/arbitrary.vel" view-string
e) view-string looked up via view factory to return Velocity view
f) Velocity View spits out result of "/some/arbitrary.vel"
What you suggest has one major thing in common with "Model 1", that is
that the original request is to a .jsp page, instead of an arbitrary
action URL. This is why I dubbed it Model 1.5. I think there are
advantages to really treating .jsp pages just as templates. It will keep
all view technologies on the same playing field and I imagine would
simplify the code too.
> >The problem is that you have to then allow requests directly to .jsp
> >files. What happens when you want to switch to velocity?
>
> If you have been using .jsp and want to switch to Velocity without
> breaking URL's then map the Velocity-servlet to .jsp and use that
> extension for the templates.
>
> Or, map JSP's to .html and use that for Velocity templates too in order
> to hide both completely.
What if you have static html pages too? It becomes to hackified this
way. Better to let what view gets used be driven *completely* by the
action mapping configuration, and not at all by web.xml servlet
mappings.
-Chris
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork