(Also available here:
http://jira.opensymphony.com/secure/ViewIssue.jspa?key=WW-111)

I have looked at changing the view tags over to velocity, and it is looking very promising. I have attached the text.vm & text.jsp files for a comparison, and it cleans the code up quite a bit.

As a first step, all the views can be duplicated in velocity, and then use the VelocityServlet to include them. This will not reduce the overhead of the rd.include() but will reduce the time for the included page to be parsed.

I have completed (&committed) this & added a corresponding '.vm' file for most ui tags. You need to change 'webwork.ui.templateSuffix' to 'vm' and you need to map the WebWorkVelocityServlet to '*.vm'. I have tested the examples, but nothing further.

However, when working through this, I came to a few problems:

- Getting the value from the top of the valueStack.
This is usually obtained with a "." or a "null" value passed to stack.findValue(). However, in velocity, all values must start with a character. Are their any other synonyms for the current value that I don't know about? Can we add one?

- Getting the templates (using servletPath).
Some servlet containers have problems with getRealPath(). We can always bundle default templates in the jar (a plus), but how do we access the templates? Rickard seems to do it with his WebWorkVelocityServlet - but I'm not sure how.

- Runtime dependencies
If we choose to short-circuit the rd.include(), then how do we prevent a runtime dependency with velocity? Do we use reflection & classloading to prevent it? Any nicer alternatives?

Todo:

- If anyone is up for changing ComponentTag.doEndTag() to not do a rd.include() if we are serving velocity? Rickard?

- Updating the remaining templates. Some of the templates I don't use (does anyone use selectcascading?), and so any help translating these would be appreciated.

- A standard set of macros/directives that deal with pushing & popping values onto the valueStack, and all other tags (i18n, subset etc).

I'm sure that there's more todo - yell if you know anything.

Cheers,
Scott


--

ATLASSIAN - http://www.atlassian.com
Expert J2EE Software, Services and Support
-------------------------------------------------------
Need a simple, powerful way to track and manage issues?
Try JIRA - http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to