1
1
<!doctype html> < html > < head > < meta charset =utf-8 >
2
- < title > Using vnu.jar for Web-based markup checking</ title > </ head >
2
+ < title > Using vnu.jar or vnu.war for web-based markup checking</ title >
3
+
4
+ < style type ="text/css ">
5
+ html {
6
+ background : # DDE5D9 url (data:image/gif;base64, R0lGODlhBAAEAIAAANra2v///yH5BAAAAAAALAAAAAAEAAQAAAIFTGB4xlcAOw==) repeat 0 0 ;
7
+ font-family : "Lucida Sans Unicode" , "Lucida Sans" , verdana, arial, helvetica;
8
+ }
9
+ body {
10
+ border : solid 1px # CED4CA ;
11
+ background-color : # FFF ;
12
+ padding : 4px 25px 4px 25px ;
13
+ margin : 20px 20% 20px 20px ;
14
+ line-height : 1.75 ;
15
+ }
16
+ h1 {
17
+ font-size : 36px ;
18
+ font-weight : normal;
19
+ color : # 0B5B9D ;
20
+ vertical-align : top;
21
+ margin-bottom : 0px ;
22
+ }
23
+ h2 {
24
+ font-size : 28px ;
25
+ font-weight : normal;
26
+ color : # 0B5B9D ;
27
+ vertical-align : top;
28
+ margin-bottom : 0px ;
29
+ margin-top : 24px ;
30
+ }
31
+ h3 {
32
+ font-size : 22px ;
33
+ font-weight : normal;
34
+ color : # 0B5B9D ;
35
+ vertical-align : top;
36
+ margin-bottom : 0px ;
37
+ margin-top : 32px ;
38
+ }
39
+ h4 {
40
+ font-size : 20px ;
41
+ font-weight : normal;
42
+ color : # 0B5B9D ;
43
+ vertical-align : top;
44
+ margin-bottom : 0px ;
45
+ margin-top : 22px ;
46
+ }
47
+ a {
48
+ text-decoration : none;
49
+ color : # 0B5B9D ;
50
+ padding : 2px ;
51
+ }
52
+
53
+ a : hover {
54
+ text-decoration : none;
55
+ background-color : # 0B5B9D ;
56
+ color : white;
57
+ }
58
+ a : active {
59
+ text-decoration : none;
60
+ background-color : white;
61
+ color : black;
62
+ }
63
+ .set , .note {
64
+ background-color : ivory;
65
+ padding : 16px ;
66
+ padding-top : 4px ;
67
+ padding-bottom : 4px ;
68
+ padding-right : 32px ;
69
+ padding-left : 32px ;
70
+ border : 1px solid # ccc ;
71
+ margin-left : 2px ;
72
+ margin-right : 2px ;
73
+ border-radius : 6px ;
74
+ }
75
+ .note {
76
+ background-color : rgb (241 , 255 , 240 );
77
+ }
78
+ .note p {
79
+ margin-top : 8px ;
80
+ }
81
+ code {
82
+ background-color : # F8F8F8 ;
83
+ border : 1px solid # ccc ;
84
+ border-radius : 3px ;
85
+ padding : 2px 6px ;
86
+ }
87
+ pre {
88
+ background-color : # F8F8F8 ;
89
+ border : 1px solid # ccc ;
90
+ border-radius : 3px ;
91
+ padding : 10px ;
92
+ margin-right : 15% ; /* This seems high -- consider reducing? */
93
+ margin-top : 6px ;
94
+ line-height : 1.2
95
+ }
96
+ .java-class , .java-property , .option-value {
97
+ background-color : yellow;
98
+ padding : 2px 6px ;
99
+ }
100
+ .arg {
101
+ color : green;
102
+ }
103
+ .links {
104
+ text-align : center;
105
+ }
106
+ </ style >
107
+
108
+ </ head >
3
109
< body >
4
- < h1 > Using vnu.jar for Web -based markup checking</ h1 >
110
+ < h1 > Using vnu.jar or vnu.war for web -based markup checking</ h1 >
5
111
6
112
< p > The < code > vnu.jar</ code > application is a portable standalone
7
- version of the validator.nu markup checker. The
113
+ version of the validator.nu markup checker.
114
+ It is well suited to < a href ="./ "> command-line use</ a > or as a simple,
115
+ < a href ="#web-based-usage "> stand-alone HTTP server.</ a >
116
+ If you want to deploy the application to a servlet container
117
+ such as Apache Tomcat you will probably want to use the
118
+ < code > vnu.war</ code > package instead.
119
+ The
8
120
< a href ="https://github.com/validator/validator.github.io/releases "
9
- > latest vnu.jar release</ a >
10
- is available from the < code > validator</ code > project at github.
11
- The following are instructions on how to use it to provide a
12
- service for browser-based checking of HTML documents over the Web.
121
+ > latest releases of these files</ a >
122
+ are available from the < code > validator</ code > project at github.
123
+ The following are instructions demonstrating how to use these two
124
+ packages to provide a service for browser-based checking of
125
+ HTML documents over the web.
13
126
14
127
< p class =note > < b > Note:</ b > In the instructions, replace
15
- < var > "~/vnu.jar"</ var > with the actual path to the < code > vnu.jar </ code >
16
- file on your system.
128
+ < var > "~/vnu.jar"</ var > and < var > "~/ vnu.war" </ var >
129
+ with the actual paths to those files on your system.
17
130
18
131
< p class =links >
19
- < a href ="#web-based-usage "> Usage</ a > ·
20
- < 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 > ·
21
136
< a href ="#http-client-options "> Options</ a >
22
137
23
138
< div class =set >
24
139
< section id =web-based-usage >
25
140
< h2 > Web-based usage</ h2 >
26
141
27
- < p > You can use < code > vnu.jar</ code > to provide a service for
28
- 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
29
144
< a href ="http://html5.validator.nu/ "> http://html5.validator.nu/</ a >
30
145
and
31
146
< a href ="http://validator.w3.org/nu/ "> http://validator.w3.org/nu/</ a > .
32
147
The service also includes a REST API for providing checking of HTML
33
- documents to non-browser clients.
148
+ documents for other clients, not just web browsers .
34
149
35
- < 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
36
156
and invoke < code > vnu.jar</ code > like this:
37
157
38
158
< pre >
@@ -52,14 +172,59 @@ <h2>Web-based usage</h2>
52
172
< div class =note >
53
173
< p > < b > Note:</ b > If you get a < code > StackOverflowError</ code >
54
174
error when using the vnu.jar file, try adjusting the thread stack size by
55
- providing the < code > -Xss</ code > option to java:</ p >
175
+ providing the < code > -Xss</ code > option to java:
56
176
57
177
< pre >
58
178
java < span class ="option-value "> -Xss512k</ span > -cp ~/vnu.jar nu.validator.servlet.Main 8888
59
179
</ pre >
60
180
181
+ </ div >
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 >
61
225
</ div >
62
226
227
+ </ section >
63
228
< section id =http-client >
64
229
< h2 > HTTP client (for fast command-line checking)</ h2 >
65
230
@@ -91,7 +256,7 @@ <h3 id="http-client-options">HTTP client options</h3>
91
256
< p > For example, you can suppress warning-level messages and only
92
257
show error-level ones by setting the value of the
93
258
< code > nu.validator.client.level</ code > system property to
94
- < code > error</ code > , like this:</ p >
259
+ < code > error</ code > , like this:
95
260
96
261
< pre >
97
262
java < span class =java-property > -Dnu.validator.client.level=error</ span > \
@@ -178,107 +343,3 @@ <h4 id="nuvalidatorclientasciiquotes">nu.validator.client.asciiquotes</h4>
178
343
</ div >
179
344
180
345
<!-- TODO: For more information... sources bugz etc. -->
181
-
182
- < style type ="text/css ">
183
- html {
184
- background : # DDE5D9 url (data:image/gif;base64, R0lGODlhBAAEAIAAANra2v///yH5BAAAAAAALAAAAAAEAAQAAAIFTGB4xlcAOw==) repeat 0 0 ;
185
- font-family : "Lucida Sans Unicode" , "Lucida Sans" , verdana, arial, helvetica;
186
- }
187
- body {
188
- border : solid 1px # CED4CA ;
189
- background-color : # FFF ;
190
- padding : 4px 25px 4px 25px ;
191
- margin : 20px 20% 20px 20px ;
192
- line-height : 1.75 ;
193
- }
194
- h1 {
195
- font-size : 36px ;
196
- font-weight : normal;
197
- color : # 0B5B9D ;
198
- vertical-align : top;
199
- margin-bottom : 0px ;
200
- }
201
- h2 {
202
- font-size : 28px ;
203
- font-weight : normal;
204
- color : # 0B5B9D ;
205
- vertical-align : top;
206
- margin-bottom : 0px ;
207
- margin-top : 24px ;
208
- }
209
- h3 {
210
- font-size : 22px ;
211
- font-weight : normal;
212
- color : # 0B5B9D ;
213
- vertical-align : top;
214
- margin-bottom : 0px ;
215
- margin-top : 32px ;
216
- }
217
- h4 {
218
- font-size : 20px ;
219
- font-weight : normal;
220
- color : # 0B5B9D ;
221
- vertical-align : top;
222
- margin-bottom : 0px ;
223
- margin-top : 22px ;
224
- }
225
- a {
226
- text-decoration : none;
227
- color : # 0B5B9D ;
228
- padding : 2px ;
229
- }
230
-
231
- a : hover {
232
- text-decoration : none;
233
- background-color : # 0B5B9D ;
234
- color : white;
235
- }
236
- a : active {
237
- text-decoration : none;
238
- background-color : white;
239
- color : black;
240
- }
241
- .set , .note {
242
- background-color : ivory;
243
- padding : 16px ;
244
- padding-top : 4px ;
245
- padding-bottom : 4px ;
246
- padding-right : 32px ;
247
- padding-left : 32px ;
248
- border : 1px solid # ccc ;
249
- margin-left : 2px ;
250
- margin-right : 2px ;
251
- border-radius : 6px ;
252
- }
253
- .note {
254
- background-color : rgb (241 , 255 , 240 );
255
- }
256
- .note p {
257
- margin-top : 8px ;
258
- }
259
- code {
260
- background-color : # F8F8F8 ;
261
- border : 1px solid # ccc ;
262
- border-radius : 3px ;
263
- padding : 2px 6px ;
264
- }
265
- pre {
266
- background-color : # F8F8F8 ;
267
- border : 1px solid # ccc ;
268
- border-radius : 3px ;
269
- padding : 10px ;
270
- margin-right : 15% ;
271
- margin-top : 6px ;
272
- line-height : 1.2
273
- }
274
- .java-class , .java-property , .option-value {
275
- background-color : yellow;
276
- padding : 2px 6px ;
277
- }
278
- .arg {
279
- color : green;
280
- }
281
- .links {
282
- text-align : center;
283
- }
284
- </ style >
0 commit comments