You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Sujay D'Souza <sa...@yahoo.com> on 2002/08/14 00:39:00 UTC

404 and Velocity

Hello,

Can someone please give me some insight on getting a
custom 404 error page to work with velocity tools.
When i configure a webapp, and map all *.vm files
which go through the velocity servlet, and execute a
dummy vm file such as dummy.vm (Doesn't exist/invalid)
is there anyway to forward to a custom 404 page? I
don't think it can be done at a container level since
file has already since its already been passed to the
velocity servlet. Any input or help would be welcome,
as i'm not sure what to do. 

thanks a ton.

Sujay

VelocityServlet : Error processing the template
org.apache.velocity.exception.ResourceNotFoundException:
Unable to find resource
'/dsad.vm'org.apache.velocity.exception.ResourceNotFoundException:
Unable to find resource '/dsad.vm'
	at
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:502)
	at
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:386)
	at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:812)
	at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:794)
	at
org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:337)
	at
org.apache.velocity.servlet.VelocityServlet.getTemplate(VelocityServlet.java:524)
	at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.handleRequest(VelocityViewServlet.java:282)
	at
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:356)
	at
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:317)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:126)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
	at
com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
	at
com.caucho.server.http.Invocation.service(Invocation.java:311)
	at
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
	at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:221)
	at
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163)
	at
com.caucho.server.TcpConnection.run(TcpConnection.java:137)
	at java.lang.Thread.run(Thread.java:484)



__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: 404 and Velocity

Posted by Nathan Bubna <na...@esha.com>.
Sujay said:
> Can someone please give me some insight on getting a
> custom 404 error page to work with velocity tools.
> When i configure a webapp, and map all *.vm files
> which go through the velocity servlet, and execute a
> dummy vm file such as dummy.vm (Doesn't exist/invalid)
> is there anyway to forward to a custom 404 page? I
> don't think it can be done at a container level since
> file has already since its already been passed to the
> velocity servlet. Any input or help would be welcome,
> as i'm not sure what to do.

i posted some code a while back that extended the VelocityViewServlet (see
the velocity-tools subproject for more on that) which, among other things,
provided customized error handling.  if you look at the code there, you
should be able to do something similar to redirect those
ResourceNotFoundExceptions to a default "404.vm"

check out this thread for my post
http://www.mail-archive.com/velocity-dev@jakarta.apache.org/msg06362.html

Nathan Bubna
nathan@esha.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>