:D to a beginner used to Apache HTTPD, PHP etc, Java and servlets _can_ be confusing.
I have actually made a very simple war file which I distribute to designers/non-Java people here along with Tomcat and a set of quick instructions. It has a bit of centred around what we do here at NPG, but is very useful for people who just want to be able to write simple Velocity templates using default Velocity tools and have no need of any application/database back-end stuff. Most people are surprised by how easy this makes it all seem. Maybe I should tweak this to be a bit more generic and stick it on the wiki (i.e. just the war and instructions)? Chris > -----Original Message----- > From: Claude Brisson [mailto:[EMAIL PROTECTED] > Sent: 22 September 2006 05:24 > To: Velocity Users List > Cc: Brenton Strine > Subject: Re: Beginner trying to install velocity to apache server > > Peter, recommending Struts and Hibernate to a newcomer isn't very > pedagogic neither pertinent. I'm telling people to avoid > them... Telling > him that he needs to know java isn't either. Do you need to > know c++ to > use apache/php ? > > Brenton, as said before, Velocity itself is just a template > engine that > will take a template file plus a context (a set of keys that > map to data > or objects) and output the formatted file. > > To "connect" it to the web, you will need two things: a java servlet > container (tomcat or resin or jboss or jetty or...), and a webapp (a > simple servlet or a set of servlets that compose a framework > like Struts > or Click). > > Here is what I would do: > > 1) Install the java servlet container. If you easily manage to install > Tomcat with Apache, then ok. Elsewhere, you can also try Resin > (caucho.com), which is an all-in-one web server (like Apache) plus > servlet container (like Tomcat). > > 2) Once installed, figure out in your servlet container where are the > webapps stored to plug-in your own one. I suggest you start with the > "simple" webapp example from the velocity-tools subproject (otherwise > Click is pretty cool also but needs java coding). > > 3) Populate your context (for instance, add a date formatting > tool under > the $date key). The velocity-tools subproject allows you to do so by > means of a single toolbox.xml file, located under the WEB-INF > subdirectory of the webapp(*). Check for the generic tools > and the view > tools in the docs of the velocity-tools subproject. > > 4) Play around with the template files... > > (*) The WEB-INF directory of a webapp is the directory where > the webapp > stores all its administrative files. Under it there are some other > directories of interest: > - the /WEB-INF/lib directory is the place to put any needed java > library to be used by the webapp. > Be sure to restart the webapp when you add libraries or change the > toolbox.xml. > - the /WEB-INF/log directory, especially the /WEB-INF/log/error.log > file, that you should check everytimes something doesn't work as > expected. > > And don't hesitate to ask... > > Regards, > > Claude > > Le vendredi 22 septembre 2006 à 13:52 +1200, Peter Harrison a écrit : > > On Thu, 2006-09-21 at 18:05 -0700, Brenton Strine wrote: > > > Hi, > > > > > > I've set up apache with PHP before, but only with > > > extensive help from howto guides. Now I want to be able > > > to test velocity (index.vm) pages on my home computer. I > > > tried to set it all up, but it doesn't seem to be > > > working. > > > > > > Here is what I've done so far on my Windows XP computer: > > > > <snip> > > > > Apache doesn't serve VM files. Velocity is a Java template > engine that > > many Java web applications use to render pages. Unlike PHP and Perl > > there is no module you can plug into Apache to render > Velocity. You can > > have Apache connect to Tomcat, but thats quite complex if > you are just > > learning. > > > > One easy way to get started is to download Tomcat > > (jakarta.apache.org/tomcat) and run it. You will need to > know Java and > > probably learn to use Struts if your application will be of > any size. > > > > As for books on the subjects, there are quite a few. One released in > > 2002 called "Mastering Tomcat Development" might give you a broad > > understanding of Tomcat, and I recommend it because.... I > wrote it :) > > > > Seriously though, there are many good books on Tomcat now, > although you > > should look for something that also covers Struts and > Hibernate - Struts > > being a system of wiring your applications together, and > Hibernate which > > provides a object data persistence framework. Together with Velocity > > they provide a very mature technology stack that has been > well tested. > > > > Finally; there is no reason to front Tomcat with Apache > anymore. It is > > still an option, but I have run application servers for > years serving a > > large company with no separate static content provider. > When learning to > > write java web applications its easier to do away with the extra > > complexity of Apache. > > > > > > > > > --------------------------------------------------------------------- > > 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] > ******************************************************************************** DISCLAIMER: This e-mail is confidential and should not be used by anyone who is not the original intended recipient. If you have received this e-mail in error please inform the sender and delete it from your mailbox or any other storage mechanism. Neither Macmillan Publishers Limited nor any of its agents accept liability for any statements made which are clearly the sender's own and not expressly made on behalf of Macmillan Publishers Limited or one of its agents. Please note that neither Macmillan Publishers Limited nor any of its agents accept any responsibility for viruses that may be contained in this e-mail or its attachments and it is your responsibility to scan the e-mail and attachments (if any). No contracts may be concluded on behalf of Macmillan Publishers Limited or its agents by means of e-mail communication. Macmillan Publishers Limited Registered in England and Wales with registered number 785998 Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS ******************************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
