Changeset 898:efaa9262ed7d
- Timestamp:
- 10/23/09 11:44:38 (4 years ago)
- Author:
- tgambet
- Branch:
- default
- convert_revision:
- svn:cdcfb263-7567-472c-a848-e2c2df3466e7/trunk@899
- Message:
-
changed X-W3C-Validator-Status possible values to Passed/Failed/Abort?
+ response code 500 if no observation has been made
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r788
|
r898
|
|
| 1 | | // $Id: ObserveAction.java,v 1.55 2009-10-16 16:51:00 tgambet Exp $ |
| | 1 | // $Id: ObserveAction.java,v 1.56 2009-10-23 11:44:38 tgambet Exp $ |
| 2 | 2 | // Author: Jean-Guilhem Rouel & Thomas GAMBET |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM and Keio, 2006. |
| … |
… |
|
| 287 | 287 | } |
| 288 | 288 | if (errors > 0) |
| 289 | | resp.setHeader("X-W3C-Validator-Status", "Invalid"); |
| | 289 | resp.setHeader("X-W3C-Validator-Status", "Failed"); |
| 290 | 290 | else |
| 291 | | resp.setHeader("X-W3C-Validator-Status", "Valid"); |
| | 291 | resp.setHeader("X-W3C-Validator-Status", "Passed"); |
| 292 | 292 | resp.setHeader("X-W3C-Validator-Errors", Integer.toString(errors)); |
| 293 | 293 | resp.setHeader("X-W3C-Validator-Warnings", Integer.toString(warnings)); |
| 294 | 294 | resp.setHeader("X-W3C-Validator-Info", Integer.toString(infos)); |
| | 295 | } else { |
| | 296 | aOutputModule.produceOutput(mapOfStringObject, resp.getWriter()); |
| 295 | 297 | } |
| 296 | | |
| 297 | | |
| 298 | | aOutputModule.produceOutput(mapOfStringObject, resp.getWriter()); |
| 299 | 298 | } |
| 300 | 299 | } catch (final UnicornException e) { |
| 301 | | if (e.getUnicornMessage() != null) |
| 302 | | messages.add(e.getUnicornMessage()); |
| 303 | | else if (e.getMessage() != null) |
| 304 | | messages.add(new Message(Message.ERROR, e.getMessage(), null)); |
| 305 | | aOutputModule.produceError(mapOfStringObject, resp.getWriter()); |
| | 300 | resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); |
| | 301 | if (req.getMethod().equals("HEAD")) { |
| | 302 | resp.setHeader("X-W3C-Validator-Status", "Abort"); |
| | 303 | } else { |
| | 304 | if (e.getUnicornMessage() != null) |
| | 305 | messages.add(e.getUnicornMessage()); |
| | 306 | else if (e.getMessage() != null) |
| | 307 | messages.add(new Message(Message.ERROR, e.getMessage(), null)); |
| | 308 | aOutputModule.produceError(mapOfStringObject, resp.getWriter()); |
| | 309 | } |
| 306 | 310 | } catch (final Exception aException) { |
| 307 | 311 | logger.error("Exception : " + aException.getMessage(), aException); |