You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Wes Wannemacher (JIRA)" <ji...@apache.org> on 2008/02/27 04:07:08 UTC
[jira] Commented: (WW-2358) RestWorkflowInterceptor in
struts2-rest-plugin is returning a status which kills browser sessions
[ https://issues.apache.org/struts/browse/WW-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43390#action_43390 ]
Wes Wannemacher commented on WW-2358:
-------------------------------------
Sadat, if you are still watching this issue (or anyone), a little searching found that Roy F (the main dude behind REST) suggested status code 422 be used on validation failures ->
http://tech.groups.yahoo.com/group/rest-discuss/message/6183
It appears this comes from the WebDAV spec. Could someone familiar with RoR check what they do when validation fails? Incidentally, it appears that HttpServletResponse doesn't have a const to represent "unprocessable entity," so this would have to be inserted explicitly.
> RestWorkflowInterceptor in struts2-rest-plugin is returning a status which kills browser sessions
> -------------------------------------------------------------------------------------------------
>
> Key: WW-2358
> URL: https://issues.apache.org/struts/browse/WW-2358
> Project: Struts 2
> Issue Type: Bug
> Components: Other
> Affects Versions: 2.1.1
> Environment: Struts 2.1.1-SNAPSHOT on Jetty 6.1.6
> Reporter: Sarat Pediredla
> Fix For: Future
>
>
> The RestWorkflowInterceptor in the struts2-rest-plugin is a cool addition but unfortunately returns SC_BAD_REQUEST on validation fail, which might work with testing frameworks but kills real browsers.
> The response tested on Safari 3 and Firefox 2.0.0.11 just shows a blank screen.
> If I change the following line from,
> HttpHeaders info = new DefaultHttpHeaders()
> .disableCaching()
> .renderResult(method)
> .withStatus(SC_BAD_REQUEST);
>
> to,
> HttpHeaders info = new DefaultHttpHeaders()
> .disableCaching()
> .renderResult(method);
> then it works great as the server returns the right result as of validation failure (editNew in this case)
> I am not entirely sure what the solution to this would be; either using a status code that the browsers will respond to or maybe not have a status code at all (although this might not be strictly RESTful) given that errors are sent back in a Map.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.