Project

General

Profile

Defect #504

errorPage setting is not honored

Added by Robert Ivens about 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
velocity
Target version:
Start date:
04/27/2012
Due date:
% Done:

0%

Estimated time:
Browser (if web client):

Description

It seems that the errorPage vr_config setting is not used/honored. When you request a page that doesn't exists then you get the following Tomcat error instead.

HTTP Status 400 - java.lang.RuntimeException: No template and no response returned from globals.vr_getContext at net.stuff.servoy.plugin.velocityreport.server.VelocityWebServlet.vrService(VelocityWebServlet.java:435) at net.stuff.servoy.plugin.velocityreport.server.VelocityWebServlet.doGet(VelocityWebServlet.java:164) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at com.servoy.j2db.server.servlets.WebServicesServlet.service(WebServicesServlet.java:15) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:554) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:680)

History

#1

Updated by Patrick Talbot about 12 years ago

  • Status changed from New to In Progress

The errorPage vr_config setting honored when you return a response of type Error, using plugins.Velocity.createErrorResponse()
In case of template not found + and form/global vr_getContext() not found, I wasn't make use of it, but I think that I can do it.

#2

Updated by Patrick Talbot about 12 years ago

  • Status changed from In Progress to Resolved

I've done so that in case of template not found (and context not found), I use the errorPage, initializing it with a 404 status and the exception you saw above.
Just beware that in case of a 500 error (server error), this will not be possible though, because in most case an error would have occured in the servlet itself.

#3

Updated by Patrick Talbot about 12 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF