1 2 3 4 5 Code Style: Servlets in action 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 62 63 64 65 66 73 74 75
76 77
78 CSS font stacks, developer FAQs & web standards 79
80
81 91
92
93 94 101
102 103 104
105 Site navigation below 106
107
108
109

110 123

124

125 Your banner ad here 126

127
128
129

130 In this section 131

132 155

156 Follow Code Style 157

158 169

170 Text ad service 171

172

173 Put your text ad here Down arrow icon 174

175
176 177
178

179 Web hosting directory, find affordable web hosting 180

181
182
183

184 Data recovery software tools & file recovery utilities to recover lost data 185

186
187
188

189 WestNIC provides reliable web hosting services 190

191
192
193

194 Mortgage Calculator 195

196
197 198
199

200 Java servlets are used to deliver some of the key features of the Code Style Web site. This article briefly introduces each, with hyperlinks to working examples throughout the site. 201

202

203 Font stack builder 204

205

206 The FontStack servlet parses an XML data file at start-up to load the latest font survey results and uses these figures to help create a robust CSS font stack. Each font in the font stack builder is represented by a Java object with its own statistical data. The servlet dynamically generates a set of forms to select a generic font family, add multiple fonts to the stack and change the order of fonts. The servlet gives a live preview the chosen font stack and allows users to set the size of the font sample. 207

208

209 Font sampler 210

211

212 The FontSampler servlet that delivers the Web font sampler is an example of a lightweight Java servlet fulfilling a typical CGI function. This servlet class accepts a limited number of query parameters that are used to present standing text with CSS rules for named fonts, or to display an image of the named font. 213

214

215 Echo request 216

217

218 The EchoRequest servlet lists all the HTTP headers and URL request parameters sent by Web browsers. This servlet can be used for debugging servlets and with HTML form submissions and browser issues, it reflects whatever request data is sent. 219

220

221 Anchor Points 222

223

224 The AnchorPoints class is a simple redirection servlet used as a form based navigation mechanism . The ultimate destination URL is passed to the servlet as a query parameter, and uses an HTTP 302 Found response to forward requests. See the Code Style Site log archive navigation for a working example. 225

226

227 View source 228

229

230 The ViewSource servlet returns a selected Javascript or CSS source file with the content type text/plain render as plain text. The addition of a number=true request parameter adds line numbering to the output.

231

232 View the source of this page for example, click Back to return. 233

234

235 View sequence 236

237

238 ViewSequence is a servlet that shows a numbered sequence of image files with custom page titles and navigational links. All pages are generated dynamically from parameters passed in the initial request and include links to advance to the original article. See the installation steps in the Apache JServ on Windows 95 article for examples of this servlet. 239

240
241
242 243 244
245

246 Article feedback 247

248

249 Your comments on this article will be appreciated, please use the form below to submit your views. If you would like a reply or article update notification, include your email address. 250

251
252 253 254 255 256 257 262 265 266 267 272 276 277 278 283 306 307 308 313 316 317 318 323 324 325 328 329 330 335 348 349 350 353 356 357 358 359
360

361 Information: Your email address will not be mis-used. If you include your address you may be sent a personal reply, you will not be added to any mailing list unless you request update notification. Read the site privacy statement for details. 362

363
364
365 409
410 418 Add this page to your chosen social bookmarking service 419 420
421
422 435 448
449

450 Style warning, please read 451

452
453 Home · 454 CSS · 455 Java · 456 Javascript · 457 HTML · 458 Help · 459 Log 460
465 466 467