You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Tobias Bocanegra (JIRA)" <ji...@apache.org> on 2008/02/22 20:11:19 UTC

[jira] Created: (SLING-273) ujax post servlet aborts processing if item names are invalid

ujax post servlet aborts processing if item names are invalid
-------------------------------------------------------------

                 Key: SLING-273
                 URL: https://issues.apache.org/jira/browse/SLING-273
             Project: Sling
          Issue Type: Bug
          Components: microsling
            Reporter: Tobias Bocanegra


example:
POST /content/test
ujax:delete = "foo:test"

returns:
  javax.jcr.NamespaceException: foo: is not a registered namespace prefix.

of course the value of the param is wrong. but imo it should ignore it (or log an error in the changelog) and continue processing.

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


Re: [jira] Commented: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by Tobias Bocanegra <to...@day.com>.
>  >  ...well i agree in general. but in case of the delete, there is no error thrown if the element does not exist.
>
> >  so imo a namespace exception of a missing prefix is comparable to the item not found.
>  >
>  >  eg: deleting /foo/bar/not_exsiting
>
> >  vs: deleting /foo/bar/my:not_existing  (if 'my' namespace not defined)...
>
>  Ok about being consistent, but maybe deleting something that does not
>  exist should be an error as well?
no, i think not. the ujax post servlet is mainly used in a scripting
env. and if you want to delete something you just care that it is
removed afterwards. if it existed or not beforehand does not matter.

>  As a general rule, I think the ujax post servlet should return HTTP
>  error statuses, and rollback changes, whenever something goes wrong,
>  and it's up to the client to decide if they want to ignore those
>  errors or not.
you are right, of course.

-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: [jira] Commented: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Wed, Feb 27, 2008 at 5:57 PM, Tobias Bocanegra (JIRA)
<ji...@apache.org> wrote:

>  ...well i agree in general. but in case of the delete, there is no error thrown if the element does not exist.
>  so imo a namespace exception of a missing prefix is comparable to the item not found.
>
>  eg: deleting /foo/bar/not_exsiting
>  vs: deleting /foo/bar/my:not_existing  (if 'my' namespace not defined)...

Ok about being consistent, but maybe deleting something that does not
exist should be an error as well?

As a general rule, I think the ujax post servlet should return HTTP
error statuses, and rollback changes, whenever something goes wrong,
and it's up to the client to decide if they want to ignore those
errors or not.

-Bertrand

[jira] Commented: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12572992#action_12572992 ] 

Tobias Bocanegra commented on SLING-273:
----------------------------------------

the servlet should not swallow errors that might be relevant. so this 'error log' idea is crap.

i will remove this from the patch, but 'swallow' the NamespaceException in the 'processDeletes' anyways.

> ujax post servlet aborts processing if item names are invalid
> -------------------------------------------------------------
>
>                 Key: SLING-273
>                 URL: https://issues.apache.org/jira/browse/SLING-273
>             Project: Sling
>          Issue Type: Bug
>          Components: microsling
>            Reporter: Tobias Bocanegra
>         Attachments: ujax_error_fix.r630238.patch
>
>
> example:
> POST /content/test
> ujax:delete = "foo:test"
> returns:
>   javax.jcr.NamespaceException: foo: is not a registered namespace prefix.
> of course the value of the param is wrong. but imo it should ignore it (or log an error in the changelog) and continue processing.

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


[jira] Resolved: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved SLING-273.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0

Applied second path in Rev. 631682.

Please close if this suits your needs.

> ujax post servlet aborts processing if item names are invalid
> -------------------------------------------------------------
>
>                 Key: SLING-273
>                 URL: https://issues.apache.org/jira/browse/SLING-273
>             Project: Sling
>          Issue Type: Bug
>          Components: microsling
>            Reporter: Tobias Bocanegra
>            Assignee: Felix Meschberger
>             Fix For: 2.0.0
>
>         Attachments: ujax_error_fix.r630238.patch, ujax_error_fix.r631660.patch
>
>
> example:
> POST /content/test
> ujax:delete = "foo:test"
> returns:
>   javax.jcr.NamespaceException: foo: is not a registered namespace prefix.
> of course the value of the param is wrong. but imo it should ignore it (or log an error in the changelog) and continue processing.

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


[jira] Closed: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Bocanegra closed SLING-273.
----------------------------------


thanks.

> ujax post servlet aborts processing if item names are invalid
> -------------------------------------------------------------
>
>                 Key: SLING-273
>                 URL: https://issues.apache.org/jira/browse/SLING-273
>             Project: Sling
>          Issue Type: Bug
>          Components: microsling
>            Reporter: Tobias Bocanegra
>            Assignee: Felix Meschberger
>             Fix For: 2.0.0
>
>         Attachments: ujax_error_fix.r630238.patch, ujax_error_fix.r631660.patch
>
>
> example:
> POST /content/test
> ujax:delete = "foo:test"
> returns:
>   javax.jcr.NamespaceException: foo: is not a registered namespace prefix.
> of course the value of the param is wrong. but imo it should ignore it (or log an error in the changelog) and continue processing.

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


[jira] Commented: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12572952#action_12572952 ] 

Felix Meschberger commented on SLING-273:
-----------------------------------------

I tned to agree with Bertrand that failing the update request would be the better option.

I could of course agree, that failures (for whatever reason, not just a name space issue but also ValueFormatException etc.) could be recorded and sent back as status information but not as a 200/OK. And the session changes should be rolled back instead of being saved at the end.

> ujax post servlet aborts processing if item names are invalid
> -------------------------------------------------------------
>
>                 Key: SLING-273
>                 URL: https://issues.apache.org/jira/browse/SLING-273
>             Project: Sling
>          Issue Type: Bug
>          Components: microsling
>            Reporter: Tobias Bocanegra
>         Attachments: ujax_error_fix.r630238.patch
>
>
> example:
> POST /content/test
> ujax:delete = "foo:test"
> returns:
>   javax.jcr.NamespaceException: foo: is not a registered namespace prefix.
> of course the value of the param is wrong. but imo it should ignore it (or log an error in the changelog) and continue processing.

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


[jira] Commented: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12573022#action_12573022 ] 

Bertrand Delacretaz commented on SLING-273:
-------------------------------------------

Ok, agree about ignoring errors for deletes. 

But we should test that "important" errors are handled properly, by returning an error code and rolling changes back.

> ujax post servlet aborts processing if item names are invalid
> -------------------------------------------------------------
>
>                 Key: SLING-273
>                 URL: https://issues.apache.org/jira/browse/SLING-273
>             Project: Sling
>          Issue Type: Bug
>          Components: microsling
>            Reporter: Tobias Bocanegra
>         Attachments: ujax_error_fix.r630238.patch, ujax_error_fix.r631660.patch
>
>
> example:
> POST /content/test
> ujax:delete = "foo:test"
> returns:
>   javax.jcr.NamespaceException: foo: is not a registered namespace prefix.
> of course the value of the param is wrong. but imo it should ignore it (or log an error in the changelog) and continue processing.

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


[jira] Assigned: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger reassigned SLING-273:
---------------------------------------

    Assignee: Felix Meschberger

> ujax post servlet aborts processing if item names are invalid
> -------------------------------------------------------------
>
>                 Key: SLING-273
>                 URL: https://issues.apache.org/jira/browse/SLING-273
>             Project: Sling
>          Issue Type: Bug
>          Components: microsling
>            Reporter: Tobias Bocanegra
>            Assignee: Felix Meschberger
>         Attachments: ujax_error_fix.r630238.patch, ujax_error_fix.r631660.patch
>
>
> example:
> POST /content/test
> ujax:delete = "foo:test"
> returns:
>   javax.jcr.NamespaceException: foo: is not a registered namespace prefix.
> of course the value of the param is wrong. but imo it should ignore it (or log an error in the changelog) and continue processing.

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


[jira] Commented: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12572847#action_12572847 ] 

Bertrand Delacretaz commented on SLING-273:
-------------------------------------------

Wouldn't it be better to fail more loudly, with a 500 error?

My concern is that people might not check the detailed results in the HTML response to the POST, and might miss the problem.

Failing with a 500 and a descriptive enough error message (structured maybe) would be safer IMHO, but if you have a valid use case for your variant, I'm open to hear it.

> ujax post servlet aborts processing if item names are invalid
> -------------------------------------------------------------
>
>                 Key: SLING-273
>                 URL: https://issues.apache.org/jira/browse/SLING-273
>             Project: Sling
>          Issue Type: Bug
>          Components: microsling
>            Reporter: Tobias Bocanegra
>         Attachments: ujax_error_fix.r630238.patch
>
>
> example:
> POST /content/test
> ujax:delete = "foo:test"
> returns:
>   javax.jcr.NamespaceException: foo: is not a registered namespace prefix.
> of course the value of the param is wrong. but imo it should ignore it (or log an error in the changelog) and continue processing.

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


[jira] Updated: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Bocanegra updated SLING-273:
-----------------------------------

    Attachment: ujax_error_fix.r631660.patch

new patch that just swallows namespace exception on delete.

> ujax post servlet aborts processing if item names are invalid
> -------------------------------------------------------------
>
>                 Key: SLING-273
>                 URL: https://issues.apache.org/jira/browse/SLING-273
>             Project: Sling
>          Issue Type: Bug
>          Components: microsling
>            Reporter: Tobias Bocanegra
>         Attachments: ujax_error_fix.r630238.patch, ujax_error_fix.r631660.patch
>
>
> example:
> POST /content/test
> ujax:delete = "foo:test"
> returns:
>   javax.jcr.NamespaceException: foo: is not a registered namespace prefix.
> of course the value of the param is wrong. but imo it should ignore it (or log an error in the changelog) and continue processing.

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


[jira] Commented: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12572973#action_12572973 ] 

Tobias Bocanegra commented on SLING-273:
----------------------------------------

well i agree in general. but in case of the delete, there is no error thrown if the element does not exist.
so imo a namespace exception of a missing prefix is comparable to the item not found.

eg: deleting /foo/bar/not_exsiting
vs: deleting /foo/bar/my:not_existing  (if 'my' namespace not defined)


> ujax post servlet aborts processing if item names are invalid
> -------------------------------------------------------------
>
>                 Key: SLING-273
>                 URL: https://issues.apache.org/jira/browse/SLING-273
>             Project: Sling
>          Issue Type: Bug
>          Components: microsling
>            Reporter: Tobias Bocanegra
>         Attachments: ujax_error_fix.r630238.patch
>
>
> example:
> POST /content/test
> ujax:delete = "foo:test"
> returns:
>   javax.jcr.NamespaceException: foo: is not a registered namespace prefix.
> of course the value of the param is wrong. but imo it should ignore it (or log an error in the changelog) and continue processing.

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


[jira] Commented: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12573035#action_12573035 ] 

Felix Meschberger commented on SLING-273:
-----------------------------------------

> But we should test that "important" errors are handled properly, by returning an error code and rolling changes back.

This is already the case: The UjaxProcessor aborts on error and rolls back unsaved changes.

> ujax post servlet aborts processing if item names are invalid
> -------------------------------------------------------------
>
>                 Key: SLING-273
>                 URL: https://issues.apache.org/jira/browse/SLING-273
>             Project: Sling
>          Issue Type: Bug
>          Components: microsling
>            Reporter: Tobias Bocanegra
>            Assignee: Felix Meschberger
>         Attachments: ujax_error_fix.r630238.patch, ujax_error_fix.r631660.patch
>
>
> example:
> POST /content/test
> ujax:delete = "foo:test"
> returns:
>   javax.jcr.NamespaceException: foo: is not a registered namespace prefix.
> of course the value of the param is wrong. but imo it should ignore it (or log an error in the changelog) and continue processing.

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


[jira] Updated: (SLING-273) ujax post servlet aborts processing if item names are invalid

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Bocanegra updated SLING-273:
-----------------------------------

    Attachment: ujax_error_fix.r630238.patch

patch provides graceful handling of namespace errors.

> ujax post servlet aborts processing if item names are invalid
> -------------------------------------------------------------
>
>                 Key: SLING-273
>                 URL: https://issues.apache.org/jira/browse/SLING-273
>             Project: Sling
>          Issue Type: Bug
>          Components: microsling
>            Reporter: Tobias Bocanegra
>         Attachments: ujax_error_fix.r630238.patch
>
>
> example:
> POST /content/test
> ujax:delete = "foo:test"
> returns:
>   javax.jcr.NamespaceException: foo: is not a registered namespace prefix.
> of course the value of the param is wrong. but imo it should ignore it (or log an error in the changelog) and continue processing.

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