You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Tim Lei <ti...@yahoo.com> on 2004/12/30 07:57:12 UTC

Problem on using Velocity with Servlet

I am just a beginner of Servlet & Velocity stuff.
 
Platform:
Redhat 9.3
JDK: jdk1.5.0_01
Tomcat: jakarta-tomcat-5.5.4
Ant: 1.6.2
Velocity: 1.4
 
I have tomcat installed sucessfully up and running. All servlet examples could be run under http://myhost:8080/. I am trying to build a new project with Velocity on this server also. I followed the instruction in README.txt and want to run the example "servlet_example1". It showed "HTTP Status 404 - /velexample/servlet/ServletSample" everytime.
 
I have no problem running "app_example1" in the shell. Did I missed anything important on the servlet side? I have no idea about that. Please help!
 
Many thanks.

		
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - 250MB free storage. Do more. Manage less.

Re: Problem on using Velocity with Servlet

Posted by Nathan Bubna <nb...@gmail.com>.
i highly recommend you try out the VelocityTools project.
http://jakarta.apache.org/velocity/tools/index.html

the distribution comes with several examples apps that are packaged as
WARs.  all you need to do is drop them into Tomcat's webapps directory
and they're ready to run.

they're easier to get started with, and they're examples of a
better/easier way to build Velocity webapps.

On Wed, 29 Dec 2004 22:57:12 -0800 (PST), Tim Lei <ti...@yahoo.com> wrote:
> I am just a beginner of Servlet & Velocity stuff.
> 
> Platform:
> Redhat 9.3
> JDK: jdk1.5.0_01
> Tomcat: jakarta-tomcat-5.5.4
> Ant: 1.6.2
> Velocity: 1.4
> 
> I have tomcat installed sucessfully up and running. All servlet examples could be run under http://myhost:8080/. I am trying to build a new project with Velocity on this server also. I followed the instruction in README.txt and want to run the example "servlet_example1". It showed "HTTP Status 404 - /velexample/servlet/ServletSample" everytime.
> 
> I have no problem running "app_example1" in the shell. Did I missed anything important on the servlet side? I have no idea about that. Please help!
> 
> Many thanks.
> 
> 
> ---------------------------------
> Do you Yahoo!?
>  Yahoo! Mail - 250MB free storage. Do more. Manage less.
>

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


Re: Velocity based Pushlets

Posted by William Fuller <wi...@sbcglobal.net>.
Hello Seshu,
It would be real interesting to see the entire Pushlet set of demos
converted to Velocity.  The timeline for the initial release is tight,
mid-February.  So I likely will attempt only the most remedial HTML Pushlet
APIs (http://www.pushlets.com/).  In my case, I am new to servlets and so I
don't want to be overly ambitious, so much to learn.  I also have to write 2
device drivers during that time and so I am already pegged out.

>From what I have been able to deduce Servlets that implement the Velocity
class should not be any different with respect to connections left open than
any others.  It would be good to know this is a valid assumption before I
get too far along the path.

My app will read a database and then render a template for the original view
and push it to the browser.  Next, it will read from the database and
periodically render a different template and push that to the browser.
There could be one or two additional templates as well.  All done, of
course, without refreshing the browser.

The server and the browser are running on the same XP Embedded PC so I don't
need Turbine in my case.

Cheers

----- Original Message ----- 
From: "Seshu Sri P" <se...@cmcltd.com>
To: "'Velocity Users List'" <ve...@jakarta.apache.org>
Sent: Thursday, December 30, 2004 10:41 PM
Subject: RE: Velocity based Pushlets


> Felt like it is good feature. We have such a requirement in our
> application right now. We have used Turbine framework with Velocity for
> our application.
>
> Let us know time frame for the implementation of same.
>
> -----Original Message-----
> From: William Fuller [mailto:williamfuller@sbcglobal.net]
> Sent: Friday, December 31, 2004 9:45 AM
> To: Velocity Users List
> Subject: Velocity based Pushlets
>
> I would appreciate any early advice as a sanity check that anyone on the
> list might be able to give me on my plans.  I intend to impliment a
> version
> of the Pushlet API using Velocity.  For those who are not familiar with
> pushlets the basic concept is that the connection to the browser remains
> open and HTML or script is periodically pushed to the browser to refresh
> parts of the screen.  I would like to ask the experts if you know of any
> reason why Velocity might preclude such a thing?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


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


RE: Velocity based Pushlets

Posted by Seshu Sri P <se...@cmcltd.com>.
Felt like it is good feature. We have such a requirement in our
application right now. We have used Turbine framework with Velocity for
our application.

Let us know time frame for the implementation of same.

-----Original Message-----
From: William Fuller [mailto:williamfuller@sbcglobal.net] 
Sent: Friday, December 31, 2004 9:45 AM
To: Velocity Users List
Subject: Velocity based Pushlets

I would appreciate any early advice as a sanity check that anyone on the
list might be able to give me on my plans.  I intend to impliment a
version
of the Pushlet API using Velocity.  For those who are not familiar with
pushlets the basic concept is that the connection to the browser remains
open and HTML or script is periodically pushed to the browser to refresh
parts of the screen.  I would like to ask the experts if you know of any
reason why Velocity might preclude such a thing?


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



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


Velocity based Pushlets

Posted by William Fuller <wi...@sbcglobal.net>.
I would appreciate any early advice as a sanity check that anyone on the
list might be able to give me on my plans.  I intend to impliment a version
of the Pushlet API using Velocity.  For those who are not familiar with
pushlets the basic concept is that the connection to the browser remains
open and HTML or script is periodically pushed to the browser to refresh
parts of the screen.  I would like to ask the experts if you know of any
reason why Velocity might preclude such a thing?


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


Re: Problem on using Velocity with Servlet

Posted by William Fuller <wi...@sbcglobal.net>.
Hello Shinabu.
Domo arigato for the advice and link.  From doing a few googles the fact
that the velocity trivial examples appear not to work when run against the
latest versions of Tomcat seems to be a source of consternation for many.
In my case, I am new to webapps, velocity, tomcat, and even Java - so you
can imagine how little confidence I would have that I was doing anything
right!  I think it would be most helpful if your good advice were
incorporated into the Velocity readme.txt files for the examples for the
benefit of unseasoned developers such as myself.

----- Original Message ----- 
From: "Shinobu Kawai" <sh...@gmail.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Thursday, December 30, 2004 5:35 PM
Subject: Re: Problem on using Velocity with Servlet


> Hi William,
>
> > I have Win2K/XP Embedded -
> > I spun my wheels for a few days trying to get Velocity/1.4 to run under
> > Tomcat/5.5.4.  The invoker servlet and servlet-mappings are both
commented
> > out in Tomcat/5.5.4 web.xml file but uncommenting these didn't make any
> > difference.  I tried falling back to Tomcat/5.0.28 but that didn't help.
I
> > had to drop all the way back to Tomcat/4.1.31 which only had the
> > servlet-mapping for invoker commented out.  So, apparently there is a
> > problem with the Tomcat/5.x.x series with respect to the invoker that is
> > more profound than simply uncommenting the servlet and servlet-mapping
tags
> > for the invoker.  I'd rather be using Tomcat/5.5.4 if anyone knows how
to
> > fix the invocation...
>
> You do not want to use the invoker servlet to render Velocity
> templates.  Use the VelocityViewServlet.  Documentation for web.xml
> settings (and much, much more :)) can be found here:
>   http://jakarta.apache.org/velocity/tools/view/
>
> Best regards,
> -- Shinobu
>
> --
> Shinobu "Kawai" Yoshida <sh...@gmail.com>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


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


Re: Problem on using Velocity with Servlet

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi William,

> I have Win2K/XP Embedded -
> I spun my wheels for a few days trying to get Velocity/1.4 to run under
> Tomcat/5.5.4.  The invoker servlet and servlet-mappings are both commented
> out in Tomcat/5.5.4 web.xml file but uncommenting these didn't make any
> difference.  I tried falling back to Tomcat/5.0.28 but that didn't help.  I
> had to drop all the way back to Tomcat/4.1.31 which only had the
> servlet-mapping for invoker commented out.  So, apparently there is a
> problem with the Tomcat/5.x.x series with respect to the invoker that is
> more profound than simply uncommenting the servlet and servlet-mapping tags
> for the invoker.  I'd rather be using Tomcat/5.5.4 if anyone knows how to
> fix the invocation...

You do not want to use the invoker servlet to render Velocity
templates.  Use the VelocityViewServlet.  Documentation for web.xml
settings (and much, much more :)) can be found here:
  http://jakarta.apache.org/velocity/tools/view/

Best regards,
-- Shinobu

--
Shinobu "Kawai" Yoshida <sh...@gmail.com>

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


Re: Problem on using Velocity with Servlet

Posted by William Fuller <wi...@sbcglobal.net>.
I have Win2K/XP Embedded -
I spun my wheels for a few days trying to get Velocity/1.4 to run under
Tomcat/5.5.4.  The invoker servlet and servlet-mappings are both commented
out in Tomcat/5.5.4 web.xml file but uncommenting these didn't make any
difference.  I tried falling back to Tomcat/5.0.28 but that didn't help.  I
had to drop all the way back to Tomcat/4.1.31 which only had the
servlet-mapping for invoker commented out.  So, apparently there is a
problem with the Tomcat/5.x.x series with respect to the invoker that is
more profound than simply uncommenting the servlet and servlet-mapping tags
for the invoker.  I'd rather be using Tomcat/5.5.4 if anyone knows how to
fix the invocation...




----- Original Message ----- 
From: "Tim Lei" <ti...@yahoo.com>
To: <ve...@jakarta.apache.org>
Sent: Thursday, December 30, 2004 12:57 AM
Subject: Problem on using Velocity with Servlet


> I am just a beginner of Servlet & Velocity stuff.
>
> Platform:
> Redhat 9.3
> JDK: jdk1.5.0_01
> Tomcat: jakarta-tomcat-5.5.4
> Ant: 1.6.2
> Velocity: 1.4
>
> I have tomcat installed sucessfully up and running. All servlet examples
could be run under http://myhost:8080/. I am trying to build a new project
with Velocity on this server also. I followed the instruction in README.txt
and want to run the example "servlet_example1". It showed "HTTP Status 404 -
/velexample/servlet/ServletSample" everytime.
>
> I have no problem running "app_example1" in the shell. Did I missed
anything important on the servlet side? I have no idea about that. Please
help!
>
> Many thanks.
>
>
> ---------------------------------
> Do you Yahoo!?
>  Yahoo! Mail - 250MB free storage. Do more. Manage less.


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