[MOBY-guts] biomoby commit
Martin Senger
senger at dev.open-bio.org
Sun May 27 19:18:17 UTC 2007
senger
Sun May 27 15:18:17 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/samples/org/jmoby/tutorial/service
In directory dev.open-bio.org:/tmp/cvs-serv26856/src/samples/org/jmoby/tutorial/service
Modified Files:
TestServiceNotesImpl.java
Log Message:
moby-live/Java/src/samples/org/jmoby/tutorial/service TestServiceNotesImpl.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/samples/org/jmoby/tutorial/service/TestServiceNotesImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/samples/org/jmoby/tutorial/service/TestServiceNotesImpl.java 2007/05/21 00:56:15 1.1
+++ /home/repository/moby/moby-live/Java/src/samples/org/jmoby/tutorial/service/TestServiceNotesImpl.java 2007/05/27 19:18:17 1.2
@@ -37,13 +37,31 @@
throws MobyException {
MobyDateTime input = get_input_date (request);
String date = input.getValue();
- outputContext.setServiceNotes ("This is a general service note.");
outputContext.addException (ServiceException.info ("Input date was " + date),
request);
+
+ StringBuilder buf = new StringBuilder();
+ buf.append ("This is a general service note.\n");
+ buf.append ("HTTP Headers:\n");
+ buf.append ("-------------\n");
+ buf.append (getHTTPHeaders().toString());
+ buf.append ("\n");
+ buf.append ("Length: ");
+ buf.append (getRequestLength() + "\n");
+ try {
+ buf.append ("Request URL: ");
+ buf.append (getServletRequest().getRequestURL().toString());
+ buf.append ("\n");
+ } catch (NullPointerException e) {
+ // can happen if the servlet request is not available
+ }
+ outputContext.setServiceNotes (buf.toString());
+
SimpleDateFormat sdf = new SimpleDateFormat (MobyDateTime.FULL_FORMAT);
MobyDateTime output = new MobyDateTime ();
output.setValue (sdf.format (new Date()));
set_output_date (response, output);
+
}
}
More information about the MOBY-guts
mailing list