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
79 CSS font stacks, media style sheets & web standards 80
81
82 92
93
94 95 102
103 104 105
106 Site navigation below 107
108
109
110

111 124

125

126 Your banner ad here 127

128
129
130

131 In this section 132

133 156

157 Follow Code Style 158

159 170

171 Text ad service 172

173

174 Put your text ad here Down arrow icon 175

176
177 178
179

180 Web hosting directory, find affordable web hosting 181

182
183
184

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

187
188
189

190 WestNIC provides reliable web hosting services 191

192
193
194

195 Mortgage Calculator 196

197
198
199

200 25% off cpanel web hosting and reseller hosting deals. Promo: codestyle25off 201

202
203 204
205

206 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. 207

208

209 Font stack builder 210

211

212 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. 213

214

215 Font sampler 216

217

218 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. 219

220

221 Echo request 222

223

224 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. 225

226

227 Anchor Points 228

229

230 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. 231

232

233 View source 234

235

236 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.

237

238 View the source of this page for example, click Back to return. 239

240

241 View sequence 242

243

244 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. 245

246
247
248 249 250
251

252 Article feedback 253

254

255 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. 256

257
258 259 260 261 262 263 268 271 272 273 278 282 283 284 289 312 313 314 319 322 323 324 329 330 331 334 335 336 341 354 355 356 359 362 363 364 365
366

367 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. 368

369
370
371 415
416 424 Add this page to your chosen social bookmarking service 425 426
427

428 Style warning - please read 429

430
431 Home · 432 CSS · 433 Java · 434 Javascript · 435 HTML · 436 Help · 437 Log 438
443