Skip to content

Commit 7766415

Browse files
committed
Deployment to servlet container documentation finished
1 parent c280104 commit 7766415

File tree

1 file changed

+62
-11
lines changed

1 file changed

+62
-11
lines changed

service.html

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
border: 1px solid #ccc;
9090
border-radius: 3px;
9191
padding: 10px;
92-
margin-right: 15%;
92+
margin-right: 15%; /* This seems high -- consider reducing? */
9393
margin-top: 6px;
9494
line-height: 1.2
9595
}
@@ -129,24 +129,30 @@ <h1>Using vnu.jar or vnu.war for web-based markup checking</h1>
129129
with the actual paths to those files on your system.
130130

131131
<p class=links>
132-
<a href="#web-based-usage">Usage</a> ·
133-
<a href="#http-client">Client</a> ·
132+
<!--<a href="#web-based-usage">Usage</a> · -->
133+
<a href="#stand-alone">Stand-Alone</a> ·
134+
<a href="#servlet">Servlet</a> ·
135+
<a href="#http-client">Client</a> ·
134136
<a href="#http-client-options">Options</a>
135-
</p>
136137

137138
<div class=set>
138139
<section id=web-based-usage>
139140
<h2>Web-based usage</h2>
140141

141-
<p>You can use <code>vnu.jar</code> to provide a service for
142-
browser-based checking of HTML documents over the Web, similar to
142+
<p>You can use <code>vnu.jar</code> or <code>vnu.war</code> to provide a service for
143+
browser-based checking of HTML documents over the web, similar to
143144
<a href="http://html5.validator.nu/">http://html5.validator.nu/</a>
144145
and
145146
<a href="http://validator.w3.org/nu/">http://validator.w3.org/nu/</a>.
146147
The service also includes a REST API for providing checking of HTML
147-
documents to non-browser clients.
148+
documents for other clients, not just web browsers.
148149

149-
<p>To run the markup checker as a service, open a new terminal window
150+
</section>
151+
<section id=stand-alone>
152+
<h2>Stand-alone web server</h2>
153+
<p>To run the markup checker as a stand-alone service
154+
(using built-in Jetty server),
155+
open a new terminal window
150156
and invoke <code>vnu.jar</code> like this:
151157

152158
<pre>
@@ -166,14 +172,59 @@ <h2>Web-based usage</h2>
166172
<div class=note>
167173
<p><b>Note:</b> If you get a <code>StackOverflowError</code>
168174
error when using the vnu.jar file, try adjusting the thread stack size by
169-
providing the <code>-Xss</code> option to java:</p>
175+
providing the <code>-Xss</code> option to java:
170176

171177
<pre>
172178
java <span class="option-value">-Xss512k</span> -cp ~/vnu.jar nu.validator.servlet.Main 8888
173179
</pre>
174180

175181
</div>
176-
</section>
182+
</section>
183+
<section id=servlet>
184+
<h2>Deployment to servlet container</h2>
185+
<p>To run the markup checker inside of an existing servlet container
186+
such as Apache Tomcat you will need to deploy the <code>vnu.war</code>
187+
file to that server following its documentation.
188+
For example, on Apache Tomcat you could do this using
189+
the <a href="http://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html">Manager</a> application or simply by copying the file to
190+
the <code>webapps</code> directory
191+
(since that is the default <code>appBase</code> setting).
192+
Typically you would see a message similar to the following
193+
in the <code>catalina.out</code> log file.
194+
<pre>
195+
May 7, 2014 4:42:04 PM org.apache.catalina.startup.HostConfig deployWAR
196+
INFO: Deploying web application archive /var/lib/tomcat7/webapps/vnu.war
197+
</pre>
198+
199+
Assuming your servlet container is configured to receive HTTP
200+
requests sent to <code>localhost</code> on port <code>80</code>
201+
and the context root of this application is <code>vnu</code>
202+
(often the default behavior is to use the WAR file's filename
203+
as the context root unless one is explicitly specified)
204+
you should be able to access the application by connecting
205+
to <a href="http://localhost/vnu/">http://localhost/vnu/</a>.
206+
207+
<div class=note>
208+
<b>Note:</b> You may want to customize the <code>/WEB-INF/web.xml</code>
209+
file inside the WAR file (you can use any ZIP handing program)
210+
to modify the servlet filter configuration.
211+
For example, if you wanted to disable gzip decompression you
212+
could comment-out that filter like this:
213+
214+
<pre>
215+
&lt;!--
216+
&lt;filter>
217+
&lt;filter-name>gzip-filter&lt;/filter-name>
218+
&lt;filter-class>org.mortbay.servlet.GzipFilter&lt;/filter-class>
219+
&lt;/filter>
220+
&lt;filter-mapping>
221+
&lt;filter-name>gzip-filter&lt;/filter-name>
222+
&lt;url-pattern>*&lt;/url-pattern>
223+
&lt;/filter-mapping>
224+
--></pre>
225+
</div>
226+
227+
</section>
177228
<section id=http-client>
178229
<h2>HTTP client (for fast command-line checking)</h2>
179230

@@ -205,7 +256,7 @@ <h3 id="http-client-options">HTTP client options</h3>
205256
<p>For example, you can suppress warning-level messages and only
206257
show error-level ones by setting the value of the
207258
<code>nu.validator.client.level</code> system property to
208-
<code>error</code>, like this:</p>
259+
<code>error</code>, like this:
209260

210261
<pre>
211262
java <span class=java-property>-Dnu.validator.client.level=error</span>\

0 commit comments

Comments
 (0)