You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2007/12/07 15:08:43 UTC

[jira] Created: (SLING-126) MicrojaxPostServlet: redirect to Referer is provided, unless ujax_redirect is provided

MicrojaxPostServlet: redirect to Referer is provided, unless ujax_redirect is provided
--------------------------------------------------------------------------------------

                 Key: SLING-126
                 URL: https://issues.apache.org/jira/browse/SLING-126
             Project: Sling
          Issue Type: Improvement
          Components: microsling
            Reporter: Bertrand Delacretaz
            Priority: Minor


Currently, the Referer HTTP header is ignored for redirects, as MicrojaxPostServlet redirects to the created or modified node.

Redirecting to the Referer is often useful in browser-based applications, to enable this I suggest the following logic:

1) If ujax_redirect parameter is given, redirect to that after the POST

2) else use the "Referer" HTTP header, if provided

3) else redirect to the Node that was created or modified.

We might want to add a "magic" value (a star?) to ujax_redirect that says "use method 3) even if Referer is given", or "insert the path of the created/modified Node instead of the star"?

For now, I'll implement the simple logic shown above, and we can refine if needed.

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


[jira] Commented: (SLING-126) MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided

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

Tobias Bocanegra commented on SLING-126:
----------------------------------------

forget about my path. if you wan't to get a non-html response, redirect to a JSON export:

ujax:redirect="/my/content.json"


> MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided
> --------------------------------------------------------------------------------------
>
>                 Key: SLING-126
>                 URL: https://issues.apache.org/jira/browse/SLING-126
>             Project: Sling
>          Issue Type: Improvement
>          Components: microsling
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: launchpad-json-status-r615414.patch
>
>
> Currently, the Referer HTTP header is ignored for redirects, as MicrojaxPostServlet redirects to the created or modified node.
> Redirecting to the Referer is often useful in browser-based applications, to enable this I suggest the following logic:
> 1) If ujax_redirect parameter is given, redirect to that after the POST
> 2) else use the "Referer" HTTP header, if provided
> 3) else redirect to the Node that was created or modified.
> We might want to add a "magic" value (a star?) to ujax_redirect that says "use method 3) even if Referer is given", or "insert the path of the created/modified Node instead of the star"?
> For now, I'll implement the simple logic shown above, and we can refine if needed.

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


[jira] Updated: (SLING-126) MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided

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

Tobias Bocanegra updated SLING-126:
-----------------------------------

    Attachment: launchpad-json-status-r615414.patch

suggested patch for handling JSON status responses.


> MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided
> --------------------------------------------------------------------------------------
>
>                 Key: SLING-126
>                 URL: https://issues.apache.org/jira/browse/SLING-126
>             Project: Sling
>          Issue Type: Improvement
>          Components: microsling
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: launchpad-json-status-r615414.patch
>
>
> Currently, the Referer HTTP header is ignored for redirects, as MicrojaxPostServlet redirects to the created or modified node.
> Redirecting to the Referer is often useful in browser-based applications, to enable this I suggest the following logic:
> 1) If ujax_redirect parameter is given, redirect to that after the POST
> 2) else use the "Referer" HTTP header, if provided
> 3) else redirect to the Node that was created or modified.
> We might want to add a "magic" value (a star?) to ujax_redirect that says "use method 3) even if Referer is given", or "insert the path of the created/modified Node instead of the star"?
> For now, I'll implement the simple logic shown above, and we can refine if needed.

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


[jira] Updated: (SLING-126) MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided

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

Bertrand Delacretaz updated SLING-126:
--------------------------------------

    Summary: MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided  (was: MicrojaxPostServlet: redirect to Referer is provided, unless ujax_redirect is provided)

> MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided
> --------------------------------------------------------------------------------------
>
>                 Key: SLING-126
>                 URL: https://issues.apache.org/jira/browse/SLING-126
>             Project: Sling
>          Issue Type: Improvement
>          Components: microsling
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>
> Currently, the Referer HTTP header is ignored for redirects, as MicrojaxPostServlet redirects to the created or modified node.
> Redirecting to the Referer is often useful in browser-based applications, to enable this I suggest the following logic:
> 1) If ujax_redirect parameter is given, redirect to that after the POST
> 2) else use the "Referer" HTTP header, if provided
> 3) else redirect to the Node that was created or modified.
> We might want to add a "magic" value (a star?) to ujax_redirect that says "use method 3) even if Referer is given", or "insert the path of the created/modified Node instead of the star"?
> For now, I'll implement the simple logic shown above, and we can refine if needed.

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


[jira] Issue Comment Edited: (SLING-126) MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided

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

tripod edited comment on SLING-126 at 1/28/08 2:46 AM:
-----------------------------------------------------------------

forget about my patch. if you want to get a non-html response, redirect to a JSON export:

ujax:redirect="/my/content.json"


      was (Author: tripod):
    forget about my path. if you wan't to get a non-html response, redirect to a JSON export:

ujax:redirect="/my/content.json"

  
> MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided
> --------------------------------------------------------------------------------------
>
>                 Key: SLING-126
>                 URL: https://issues.apache.org/jira/browse/SLING-126
>             Project: Sling
>          Issue Type: Improvement
>          Components: microsling
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: launchpad-json-status-r615414.patch
>
>
> Currently, the Referer HTTP header is ignored for redirects, as MicrojaxPostServlet redirects to the created or modified node.
> Redirecting to the Referer is often useful in browser-based applications, to enable this I suggest the following logic:
> 1) If ujax_redirect parameter is given, redirect to that after the POST
> 2) else use the "Referer" HTTP header, if provided
> 3) else redirect to the Node that was created or modified.
> We might want to add a "magic" value (a star?) to ujax_redirect that says "use method 3) even if Referer is given", or "insert the path of the created/modified Node instead of the star"?
> For now, I'll implement the simple logic shown above, and we can refine if needed.

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


[jira] Closed: (SLING-126) MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided

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

Felix Meschberger closed SLING-126.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Felix Meschberger

Closing this issue as won't fix as the proposed patch collides with SLING-213.

> MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided
> --------------------------------------------------------------------------------------
>
>                 Key: SLING-126
>                 URL: https://issues.apache.org/jira/browse/SLING-126
>             Project: Sling
>          Issue Type: Improvement
>          Components: microsling
>            Reporter: Bertrand Delacretaz
>            Assignee: Felix Meschberger
>            Priority: Minor
>         Attachments: launchpad-json-status-r615414.patch
>
>
> Currently, the Referer HTTP header is ignored for redirects, as MicrojaxPostServlet redirects to the created or modified node.
> Redirecting to the Referer is often useful in browser-based applications, to enable this I suggest the following logic:
> 1) If ujax_redirect parameter is given, redirect to that after the POST
> 2) else use the "Referer" HTTP header, if provided
> 3) else redirect to the Node that was created or modified.
> We might want to add a "magic" value (a star?) to ujax_redirect that says "use method 3) even if Referer is given", or "insert the path of the created/modified Node instead of the star"?
> For now, I'll implement the simple logic shown above, and we can refine if needed.

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


[jira] Commented: (SLING-126) MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided

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

Tobias Bocanegra commented on SLING-126:
----------------------------------------

Further add possibility to turn of redirection at all and just provide some status message. like list of modifications.

eg:

{
status: "ok" ,  // or error, or exception message...
modifications: {
  "/content/foo/bar": "modified",
  "/content/test": "deleted"
}

maybe with: ujax:redirect="ujax:status"



> MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided
> --------------------------------------------------------------------------------------
>
>                 Key: SLING-126
>                 URL: https://issues.apache.org/jira/browse/SLING-126
>             Project: Sling
>          Issue Type: Improvement
>          Components: microsling
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>
> Currently, the Referer HTTP header is ignored for redirects, as MicrojaxPostServlet redirects to the created or modified node.
> Redirecting to the Referer is often useful in browser-based applications, to enable this I suggest the following logic:
> 1) If ujax_redirect parameter is given, redirect to that after the POST
> 2) else use the "Referer" HTTP header, if provided
> 3) else redirect to the Node that was created or modified.
> We might want to add a "magic" value (a star?) to ujax_redirect that says "use method 3) even if Referer is given", or "insert the path of the created/modified Node instead of the star"?
> For now, I'll implement the simple logic shown above, and we can refine if needed.

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


[jira] Commented: (SLING-126) MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided

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

Tobias Bocanegra commented on SLING-126:
----------------------------------------

i would add an additional step:

1.5) if POST url contains and extension, use this url.

> MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided
> --------------------------------------------------------------------------------------
>
>                 Key: SLING-126
>                 URL: https://issues.apache.org/jira/browse/SLING-126
>             Project: Sling
>          Issue Type: Improvement
>          Components: microsling
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>
> Currently, the Referer HTTP header is ignored for redirects, as MicrojaxPostServlet redirects to the created or modified node.
> Redirecting to the Referer is often useful in browser-based applications, to enable this I suggest the following logic:
> 1) If ujax_redirect parameter is given, redirect to that after the POST
> 2) else use the "Referer" HTTP header, if provided
> 3) else redirect to the Node that was created or modified.
> We might want to add a "magic" value (a star?) to ujax_redirect that says "use method 3) even if Referer is given", or "insert the path of the created/modified Node instead of the star"?
> For now, I'll implement the simple logic shown above, and we can refine if needed.

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


[jira] Commented: (SLING-126) MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided

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

Bertrand Delacretaz commented on SLING-126:
-------------------------------------------

Revision 602108 implements the above logic, see PostRedirectTest for details.

Leaving this issue open as we might want to discuss the "magic value" thing for the ujax_redirect parameter.

> MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided
> --------------------------------------------------------------------------------------
>
>                 Key: SLING-126
>                 URL: https://issues.apache.org/jira/browse/SLING-126
>             Project: Sling
>          Issue Type: Improvement
>          Components: microsling
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>
> Currently, the Referer HTTP header is ignored for redirects, as MicrojaxPostServlet redirects to the created or modified node.
> Redirecting to the Referer is often useful in browser-based applications, to enable this I suggest the following logic:
> 1) If ujax_redirect parameter is given, redirect to that after the POST
> 2) else use the "Referer" HTTP header, if provided
> 3) else redirect to the Node that was created or modified.
> We might want to add a "magic" value (a star?) to ujax_redirect that says "use method 3) even if Referer is given", or "insert the path of the created/modified Node instead of the star"?
> For now, I'll implement the simple logic shown above, and we can refine if needed.

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


[jira] Commented: (SLING-126) MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided

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

Bertrand Delacretaz commented on SLING-126:
-------------------------------------------

Redirecting to the Referer by default breaks the http://localhost:8080/content-creation-forms.html example form. 

In revision 602147 I've changed MicrojaxPostServlet so that ujax_redirect=* means "redirect to created or modified node".

> MicrojaxPostServlet: redirect to Referer if provided, unless ujax_redirect is provided
> --------------------------------------------------------------------------------------
>
>                 Key: SLING-126
>                 URL: https://issues.apache.org/jira/browse/SLING-126
>             Project: Sling
>          Issue Type: Improvement
>          Components: microsling
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>
> Currently, the Referer HTTP header is ignored for redirects, as MicrojaxPostServlet redirects to the created or modified node.
> Redirecting to the Referer is often useful in browser-based applications, to enable this I suggest the following logic:
> 1) If ujax_redirect parameter is given, redirect to that after the POST
> 2) else use the "Referer" HTTP header, if provided
> 3) else redirect to the Node that was created or modified.
> We might want to add a "magic" value (a star?) to ujax_redirect that says "use method 3) even if Referer is given", or "insert the path of the created/modified Node instead of the star"?
> For now, I'll implement the simple logic shown above, and we can refine if needed.

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