velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Sponziello <andrea.sponzie...@unile.it>
Subject Re: Newb: SampleServlet Example not working
Date Tue, 02 Aug 2005 09:19:56 GMT
I think you have to do some work in web.xml file to add the servlet...

Andrea

Mike D'Ambrogia wrote:

>All,
>
>New/inexperienced in Tomcat 5.0.28 but getting there slowly, currently
>reading the tomcat tutorial.  I've searched the V-U archives on
>marc.theaimsgroup.com without luck.  Trying to get the simpleservlet
>example up and running without luck.  I've gone overboard with info here
>in the hopes that the configuration mistake I'm making will be readily
>apparent to someone.
>
>TC located in C:\apache\tomcat\ on Win2kpro system,
>JAVA_HOME=j2sdk1.4.2_04 but also have jdk1.5.0_04 on the system too
>
>Per the instructions in
>velocity-1.4\examples\servlet_example1\readme.txt I've done the
>following:
>
> - made a new directory structure as follows :
>   
>      C:\apache\tomcat\webapps\velexample
>      ./velexample/WEB-INF
>      ./velexample/WEB-INF/lib
>      ./velexample/WEB-INF/classes
>
> - put the velocity.jar into the velexample/WEB-INF/lib directory (it
>came named as velocity-1.4.jar, have not renamed)
> 
> - put the SampleServlet.class into the velexample/WEB-INF/classes
>directory
>
> - put the sample.vm template into the velexample directory.
>
> - restart tomcat and access the servlet at
>http://127.0.0.1:8080/velexample/servlet/SampleServlet
>
>I've done nothing else to TC other than stop/start it.  on restart the
>console output shows this:
>
>Aug 1, 2005 3:18:18 PM org.apache.catalina.core.StandardHostDeployer
>install
>INFO: Installing web application at context path /velexample from URL
>file:C:\Apache\Tomcat\webapps\velexample
>Aug 1, 2005 3:18:18 PM org.apache.catalina.startup.ContextConfig
>applicationConfig
>INFO: Missing application web.xml, using defaults only
>StandardEngine[Catalina].StandardHost[localhost].StandardContext[/velexa
>mple]
>Aug 1, 2005 3:18:18 PM org.apache.catalina.core.StandardHost start
>
>after restart I go to the url above and get this:
>
>HTTP Status 404 - /velexample/servlet/SampleServlet
>type Status report
>message /velexample/servlet/SampleServlet
>description The requested resource (/velexample/servlet/SampleServlet)
>is not available.
>
>If I go to  http://127.0.0.1:8080/velexample/ I get a dir listing
>
>If I click on the sample.vm file in the listing I get the actual
>contents of the .vm file without the velocity substitutions for $name,
>$list, etc displayed which is probably correct given that I'm not
>running thru the servlet.
>
>Notes towards the bottom of \velocity-1.4\docs\developer-guide.html make
>reference to changes that need to be made to the web.xml file, adding:
>
><servlet>
>  <servlet-name>MyServlet</servlet-name>
>  <servlet-class>com.foo.bar.MyServlet</servlet-class>
>  <init-param>
>      <param-name>properties</param-name>
>      <param-value>/velocity.properties</param-value>
>  </init-param>
></servlet>
>
>Is this chg to web.xml required to run this example code??  Info is abit
>thin (for me at least) on what the values for servlet-name and
>servlet-class should be, looking for some help with these.  If this chg
>is necessary can I add it to a web.xml file in
>C:\Apache\Tomcat\webapps\velexample\WEB-INF\web.xml? 
>
>All help appreciated, looking fwd to coming up to speed
>
>Mike
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>  
>


-- 
______________________________________________
Ing. Andrea Sponziello
Center for Advanced Computational Technologies
University of Lecce
s.p. Lecce Arnesano - 73100 Lecce - Italy
voice 0039.0832.298173
email andrea.sponziello@unile.it


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message