I assume you are not using any opensource framework at this moment (ie
you have your own servlet to put objects into the proper context and
perform forwarding). You probably need to look at the velocity-tools
project and use the struts-integration code since it has hooks to look
into the various "application context", "session" and "request" for java
objects. You don't necessary have to use Struts, as long as the
velocity-struts code is there to search for objects stored within
various contexts.

Also you have to think about HTML special characters that might be
stored in your java objects and you have to use a velocity tool to
escape them properly before displaying.

To answer your questions:
1) The velocity tools projects has the hooks to find objects in various
contexts (request, session, and application context).
2) No need to import anything within the .vm since vm are not enforcing
strong typing.
3) See 1 in the above.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
Ed Yu, Senior Solutions Architect (IBM Certified AIX Administrator), 
Advanced Solutions Group, Physics Dept., University of South Carolina,
Columbia, SC 29208 
Office (803)777-8831, FAX (803)777-8833, Email [EMAIL PROTECTED]


> -----Original Message-----
> From: Monosij Dutta-Roy [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 13, 2003 5:42 PM
> To: [EMAIL PROTECTED]
> Subject: moving from jsp to velocity
> 
> 
> 
> Hi -
> very new to Velocity...
> 
> I have an extensive jsp project running under Tomcat
> that i would like to convert to Velocity.
> 
> Would I be naive to assume that the following steps
> will allow me to start using .vm files instead of .jsp
> files:
> 1. extend myServlet (currently extended from
> HttpServelt) from VelocityServlet.
> 2. Redefine my commands.xml to forward from the
> command objects to the .vm files (in the Velocity
> subdir.) - as opposed to the .jsp files (in the JSP
> subdir.).
> 3. change the java syntax in the .jsp files to
> velocity syntax in .vm files.
> 4. include the velocity.jar in the lib dir.
> 
> That leads me to 2 questions:
> 1. how do I access the session objects?
> 2. does there need to be any import stmts in the .vm
> files?
> 3. are beans in the request scope automatically
> available?
> 
> Thanks and apologies for any underestimations...
> 
> monosij
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - establish your business online 
http://webhosting.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to