You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Antonio Petrelli (JIRA)" <de...@velocity.apache.org> on 2009/02/27 16:21:12 UTC

[jira] Created: (VELTOOLS-115) Improve exception and HTTP error management

Improve exception and HTTP error management
-------------------------------------------

                 Key: VELTOOLS-115
                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
             Project: Velocity Tools
          Issue Type: Improvement
          Components: VelocityView
    Affects Versions: 2.0
         Environment: Servlet container
            Reporter: Antonio Petrelli


Currently the exception management and missing resources are not satisfactory.
In particular:
1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.

It should be:
1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
2. HTTP 404 with error page.
In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Claude Brisson (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677392#action_12677392 ] 

Claude Brisson commented on VELTOOLS-115:
-----------------------------------------

This would rather target the VelocityLayoutServlet (which for now sends back a standard error template).

Since by default the VelocityViewServlet will stream out directly the response without any buffering, the HTTP headers have already been sent at the moment the exception is thrown in the template.

Anyway, this feature can only exists if you bufferize the response.


> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Byron Foster (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677738#action_12677738 ] 

Byron Foster commented on VELTOOLS-115:
---------------------------------------

Thanks for the links.  If you don't catch the exceptions as you describe in (3), then the exceptions will propagate up into Tomcat, which will give you behavior (2).  I agree that if possible, the response is not commited,  then the HTTP 200 OK status should not be returned if errors occur.

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Antonio Petrelli (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677390#action_12677390 ] 

Antonio Petrelli commented on VELTOOLS-115:
-------------------------------------------

FreeMarker servlet works this way, I suppose that I could grab a bit of code (it's BSD-licensed after all).

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Byron Foster (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677908#action_12677908 ] 

Byron Foster commented on VELTOOLS-115:
---------------------------------------

Looking at this some more.  I don't like what I originally said about buffering.  The response buffer size can be set manually to control how much data is written before the servlet container commits.  The point being is why perform any local buffering at all? Is the VelocityWriter even necessary in a servlet container?  A servlet container like Tomcat should provide any buffer functionality necessary, and probably does it better (memory management, etc...), sorry this is a little off topic, but related :)

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Antonio Petrelli (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677922#action_12677922 ] 

Antonio Petrelli commented on VELTOOLS-115:
-------------------------------------------

Byron, can you open a new issue about buffering, or write to the Velocity Developers mailing list?
I think that we should discuss it further.

Thanks

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Antonio Petrelli (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli updated VELTOOLS-115:
--------------------------------------

    Attachment: veltools-exception.diff

Attached patch to fix exception management.
If the response is not committed, let the exception pass.
Otherwise, the exception is logged the usual way, but does not go ahead rendering the page.

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>         Attachments: veltools-exception.diff
>
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Antonio Petrelli (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682030#action_12682030 ] 

Antonio Petrelli commented on VELTOOLS-115:
-------------------------------------------

Just another comment: notice that this patch does not fix the 404 problem, but only the 500 one.

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>         Attachments: veltools-exception.diff
>
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Antonio Petrelli (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli updated VELTOOLS-115:
--------------------------------------

    Attachment: veltools-exception.diff

A new version of the patch, in which HTTP 404 messages are managed.

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>         Attachments: veltools-exception.diff, veltools-exception.diff
>
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Byron Foster (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677541#action_12677541 ] 

Byron Foster commented on VELTOOLS-115:
---------------------------------------

It seems like the default behavior should be to buffer the entire merge before you write it to the response.  I'm not sure how else you correctly handle errors if you don't do this.  I don't use Velocity servlets, but in my own usage this is what I do.

What do you mean include a page error?



> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Antonio Petrelli (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677671#action_12677671 ] 

Antonio Petrelli commented on VELTOOLS-115:
-------------------------------------------

1. You are right that we cannot send an HTTP 500 when the response is committed. The response is committed when you flush the PrintWriter of the response (or the PrintWriter is auto-flushed):
http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletResponse.html#getWriter()
And since the VelocityWriter is used to wrap the response's writer (or better, the writer that is configured through the "bufferOutput" parameter, that could be a StringWriter or the response's writer), that buffer the output itself, then there may be various cases in which the response may be uncommitted.

2. By "including a page error" I mean something like how PageContextImpl of Tomcat does it:
http://svn.eu.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
See the "doHandlePageException": it tries to forward to the error page, if it fails it includes the error page.

3. I have a suspect though: if the exception is left "popping up" at servlet level, without catching, what happens? Does it handle the exceptions like I depicted here?

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722631#action_12722631 ] 

Nathan Bubna commented on VELTOOLS-115:
---------------------------------------

Sorry, Antonio, this somehow missed getting on my todo list.  Added now...

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>         Attachments: veltools-exception.diff, veltools-exception.diff
>
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Antonio Petrelli (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722611#action_12722611 ] 

Antonio Petrelli commented on VELTOOLS-115:
-------------------------------------------

Don't you like the patch? Please tell me what's wrong, so I can fix it.

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>         Attachments: veltools-exception.diff, veltools-exception.diff
>
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Antonio Petrelli (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677393#action_12677393 ] 

Antonio Petrelli commented on VELTOOLS-115:
-------------------------------------------

Agreed. Miracles are possible, but not in Java :-D
Anyway I think that template syntax errors can be catched. Moreover, doing it "in a standard way" (like JSP and FreeMarker do, for example), i.e. including a page error in case the response has been committed, should be feasible.

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677759#action_12677759 ] 

Nathan Bubna commented on VELTOOLS-115:
---------------------------------------

And for the record, i don't particularly care anymore whether the output is buffered by default or not.  So, if you guys thing we should change that default, i've got no problem with that.

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (VELTOOLS-115) Improve exception and HTTP error management

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELTOOLS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna resolved VELTOOLS-115.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0

Thanks, Antonio!

> Improve exception and HTTP error management
> -------------------------------------------
>
>                 Key: VELTOOLS-115
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-115
>             Project: Velocity Tools
>          Issue Type: Improvement
>          Components: VelocityView
>    Affects Versions: 2.0
>         Environment: Servlet container
>            Reporter: Antonio Petrelli
>             Fix For: 2.0
>
>         Attachments: veltools-exception.diff, veltools-exception.diff
>
>
> Currently the exception management and missing resources are not satisfactory.
> In particular:
> 1. if an exception happen during rendering a template, an exception stack trace is put inside the result, with an HTTP 200 code;
> 2. if a resource is missing, but it is intercepted by the VelocityViewServlet, it renders with a page with HTTP 200.
> It should be:
> 1. HTTP 500 with error page. If it is not possible (if the response is committed), the error page should be included.
> 2. HTTP 404 with error page.
> In both cases the configuration of the webapp should be considered.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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