Articles
Java Platform, Standard Edition
Code Fragment 1
private Source get(MessageContext mc) throws JAXBException {
String path = (String)mc.get(MessageContext.PATH_INFO);
if((path.indexOf("/errortest")!=-1) || path.equals("") || path.equals("/")){
mc.put(MessageContext.HTTP_RESPONSE_CODE, 400);
POProcessingProblem fault= new POProcessingProblem();
fault.setMessage("Unable to retrieve the order associated with the orderid
you specified");
return new JAXBSource(jc, new objectFactory().createPOProcessingFault(fault));
}
}
|