Skip to content

Commit b364795

Browse files
committed
add simple logger implementation, tweak build, and servler request logging
1 parent 412a445 commit b364795

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

build.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,16 @@
6868
<unzip src="build/calabash.zip" dest="build/lib">
6969
<patternset>
7070
<include name="**/*.jar"/>
71+
<exclude name="**/javax.servlet-api-3.1.0.jar"/>
7172
</patternset>
7273
<mapper type="flatten"/>
7374
</unzip>
75+
<copy todir="build/lib">
76+
<fileset dir="lib">
77+
<include name="**/*.jar"/>
78+
<exclude name="**/servlet-api.jar"/>
79+
</fileset>
80+
</copy>
7481
</target>
7582

7683
<target name="compile" depends="init">
@@ -87,7 +94,7 @@
8794
</javac>
8895
</target>
8996

90-
<target name="copy" depends="compile">
97+
<target name="copy" depends="compile, update-version-string">
9198
<echo>Copying files ...</echo>
9299
<copy todir="build/webapp/xproc">
93100
<fileset dir="xproc"/>
@@ -101,13 +108,8 @@
101108
<copy todir="build/webapp/WEB-INF/lib">
102109
<fileset dir="build/lib">
103110
<include name="**/*.jar"/>
104-
<exclude name="**/servlet-api.jar"/>
105-
</fileset>
106-
<!--
107-
<fileset dir="../xmlcalabash1">
108-
<include name="calabash.jar"/>
111+
<exclude name="**/javax.servlet-api-3.1.0.jar"/>
109112
</fileset>
110-
-->
111113
</copy>
112114
</target>
113115

lib/slf4j-simple-1.7.36.jar

15 KB
Binary file not shown.

src/com/conaltuohy/xprocz/XProcZServlet.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ private String purifyForXML(String text) {
307307

308308
public void init() throws ServletException {
309309
getServletContext().log("XProc-Z initializing ...");
310+
getServletContext().log("Main pipeline is " + getMainPipelineFilename());
310311
try {
311312
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
312313
builder = factory.newDocumentBuilder();
@@ -444,7 +445,8 @@ private XdmNode getRequestDocument(XProcRuntime runtime, HttpServletRequest req)
444445
String partContentType = part.getContentType();
445446
// The http client may legitimately not send part headers, but for politeness we
446447
// supply the XProc pipeline with an explicit Content-Type, because
447-
// rfc1341 says that absent headers imply "plain US-ASCII text"
448+
// rfc1341 says that absent headers imply "plain US-ASCII text" and XProc-Z
449+
// will provide a default of "utf-8" which will be correct if the text is US-ASCII.
448450
// https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
449451
if (partContentType == null) {
450452
partContentType = defaultContentType;
@@ -775,7 +777,6 @@ private Input getMainPipelineInput() throws SecurityException, FileNotFoundExcep
775777
private Input getPipelineInput(String filename) throws SecurityException, FileNotFoundException {
776778
File file = new File(filename);
777779
if (file.isFile() && file.canRead()) {
778-
getServletContext().log("Loading pipeline from " + file);
779780
return new Input(filename);
780781
} else {
781782
throw new FileNotFoundException("Pipeline " + file + " not found");

0 commit comments

Comments
 (0)