89
89
border : 1px solid # ccc ;
90
90
border-radius : 3px ;
91
91
padding : 10px ;
92
- margin-right : 15% ;
92
+ margin-right : 15% ; /* This seems high -- consider reducing? */
93
93
margin-top : 6px ;
94
94
line-height : 1.2
95
95
}
@@ -129,24 +129,30 @@ <h1>Using vnu.jar or vnu.war for web-based markup checking</h1>
129
129
with the actual paths to those files on your system.
130
130
131
131
< 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 > ·
134
136
< a href ="#http-client-options "> Options</ a >
135
- </ p >
136
137
137
138
< div class =set >
138
139
< section id =web-based-usage >
139
140
< h2 > Web-based usage</ h2 >
140
141
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
143
144
< a href ="http://html5.validator.nu/ "> http://html5.validator.nu/</ a >
144
145
and
145
146
< a href ="http://validator.w3.org/nu/ "> http://validator.w3.org/nu/</ a > .
146
147
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 .
148
149
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
150
156
and invoke < code > vnu.jar</ code > like this:
151
157
152
158
< pre >
@@ -166,14 +172,59 @@ <h2>Web-based usage</h2>
166
172
< div class =note >
167
173
< p > < b > Note:</ b > If you get a < code > StackOverflowError</ code >
168
174
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:
170
176
171
177
< pre >
172
178
java < span class ="option-value "> -Xss512k</ span > -cp ~/vnu.jar nu.validator.servlet.Main 8888
173
179
</ pre >
174
180
175
181
</ 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
+ <!--
216
+ <filter>
217
+ <filter-name> gzip-filter</filter-name>
218
+ <filter-class> org.mortbay.servlet.GzipFilter</filter-class>
219
+ </filter>
220
+ <filter-mapping>
221
+ <filter-name> gzip-filter</filter-name>
222
+ <url-pattern> *</url-pattern>
223
+ </filter-mapping>
224
+ --> </ pre >
225
+ </ div >
226
+
227
+ </ section >
177
228
< section id =http-client >
178
229
< h2 > HTTP client (for fast command-line checking)</ h2 >
179
230
@@ -205,7 +256,7 @@ <h3 id="http-client-options">HTTP client options</h3>
205
256
< p > For example, you can suppress warning-level messages and only
206
257
show error-level ones by setting the value of the
207
258
< code > nu.validator.client.level</ code > system property to
208
- < code > error</ code > , like this:</ p >
259
+ < code > error</ code > , like this:
209
260
210
261
< pre >
211
262
java < span class =java-property > -Dnu.validator.client.level=error</ span > \
0 commit comments