Pekowsky-138003 book December 8, 2004 19:38

Index

ACCEPT filters, 243, 245 addDocument method, 329 Action sets in Cocoon, 546 addEqualTo method, 215 action tag, 517 addFileset method, 40–41 ActionError class, 513 addFilter method, 289 ActionForm class, 513 addHandler method, 557–558 ActionMapping class, 513 addInput method, 289 Actions and action field Addition in Expression Language, 474 in Cocoon, 545–548 AddObjectCreate method, 276, 283 in Tomcat, 432 addOption method, 262, 270–271 ActionServlet servlet, 508–509, 516 addOutput method, 289 activateOptions method addSetProperties method, 276 in ExecAppender, 254–255 addSquares method, 396, 403 in Layout, 242 addTest method, 79 Add menu in JMeter, 119–120 addTestSuite method, 79 add method addThree function, 402 in BooleanQuery, 331 addToIndex method, 328 in Calc, 395 admin role, 429 in CalcInterface, 553–554 Administration, web-based, 461–462 in CalcServlet, 101 Album class, 136, 274–275 in Demo, 408 AlbumProxy class, 218 for filters, 284 albums.html page, 544–545 in Query, 330 Aliases testing, 111 in hsqldb, 178 validating, 506 in keytool, 438 AddAlbum method, 274 Analyzers for searches, 324–326, 336 addArgument method, 283, 285, 292 AND operator, 332, 334 addArtist method, 274, 276 Angle brackets (<>) in regular addColumnEqualTo method, 215 expressions, 304

559 Pekowsky-138003 book December 8, 2004 19:38

560 Index

annotation property, 145 AppenderSkeleton class, 253 ant-jmeter.jar file, 127 Application development, 5–6 Ant tool, 11–13 Java modularity in, 6–8 built-in tasks in, 27–28 Model/View/Controller model, 8–9 AntCall, 28 application parameter for ActionServlet, 509 Copy, 28–29 Application servers. See Tomcat Delete, 29–30 ApplicationResources, 509 example, 35–36 Archive files in Ant, 31–32 Exec, 30 arg element, 30 Get, 30–31 Argument class, 283 Jar, 31–32 Argument tab, 60 Java, 32–33 Arguments, 16 Javac, 33–34 in Ant Javadoc, 34–35 command line, 26–27 command line arguments in, 26–27 sets of files as, 16–21 creating tasks in, 36–41 in CLI, 263 dependencies in, 14–16 in Digester, 283 with Eclipse, 65–66 in Eclipse, 60–61 example, 35–36 in JMeter, 123 file sets in rules for, 291–292 including and excluding, 18–20 Arguments attribute in Exec, 30 patterns in, 19–20 ArrayIndexOutOfBoundsException as task arguments, 16–18 class, 138 tools for, 20–21 Arrays in BeanUtils, 141 global variables in, 21–22 arrayToString method, 345 with JMeter, 127–128 Artist class, 134–136, 197–200, 274 with JUnit, 83–85 artist form.xml file, 548 paths in, 23 artist table.xml file, 547 properties in, 24–27 assertEquals method, 97 summary, 41 Assertions AntCall task, 28 in JMeter, 122, 130 Apache Software Foundation, 5 in JUnit, 74 APIs assertNotNull method, 95 event-driven, 352–353 assertTrue method, 75 high-level, 357–358 Asterisks (*) reflection, 134 in Ant patterns, 20 scripting for, 413 in regular expressions, 299 append method, 255–257 Asymmetric encryption, 436 Appenders in , 242–243 AsyncAppenders, 253 AsyncAppenders, 253 At signs (@) configuring, 243–245 in JXPath, 158 DailyRollingFileAppenders, 247 in XPath, 150 JDBCAppenders, 252 Atomic queries, 331 NTEventLogAppenders, 251 attributeIterator method, 164–166 RollingFileAppenders, 246–247 Attributes SMTPAppenders, 250–251 dynamic, 468–472 SocketAppenders, 247–249 in Eclipse, 52 SyslogAppenders, 251–252 in JXPath, 158, 165 TelnetAppenders, 249–250 in regular expressions, 304 Pekowsky-138003 book December 8, 2004 19:38

Index 561

in tags, 468–472 and SQL, 493–494 in XML, 244 validating, 520–524 in XPath, 150 BeanShell language, 398 auth-constraint section, 430 calling from Java, 411–412 authenticate method components of, 399–402 in ModifiedUserDatabaseRealm, 448 functions in, 402–405 in UserDatabaseRealm, 447, 450–451, 454 BeanUtils, 133–137 Authentication converters in, 140–144 HTTP-based, 126–127 for dynamic beans, 144–146 in Tomcat properties in certificate-based, 446–456 indexed, 137–138 operation of, 429–432 mapped, 138–139 in web.xml, 427–428 nested, 139–140 auto-delete attribute, 212, 218 simple, 137 auto-incrementing functionality summary, 146 in forms, 547 begin method, 302 in OJB, 204 in Cactus, 108 auto-load, 216 in Matcher, 310 auto-retrieving attribute, 213 in MatchResult, 303 auto-update attribute, 211–212, 218 in Rule, 291 Automated testing with JUnit. See JUnit class in SetObjectPropertyRule, 293–294 Awk utility, 301 in SetProgramArgRule, 291–292 awl:date tag, 507 beginAdditionOK method, 110–111 awl:maybeShow tag, 467, 472, 481–482 BigCalc class, 408–409 awl:reverse tags, 481 bin directory, 419 awl:time tag, 466 Binary large objects (blobs), 179 BlankRecord class, 360 Back pointers in OJB, 195 Blob class, 180–184 Back references BlobDeleteTrigger class, 184 in pattern matching, 310 Blobs (binary large objects), 179 in regular expressions, 304 Blocks, libraries for, 6 Backups blocks.properties file, 530 in hsqldb, 176 Bodies, tags with, 466–468 for log files, 246–247 body.jsp file, 482 basedir attribute, 31 body method, 291 baseOffset in searches, 339 BOFRecord class, 360 BASIC authentication, 431 Bookmarks, URLs for, 112–113 BasicAnalyzer class, 329 Boolean operators in XPath, 150 BasicDynaBean class, 146 BooleanQuery class, 331–333 BasicDynaClass class, 144–146 BoundSheetRecord class, 360 BasicParser class, 263 Braces ({}) BasicSearch class, 335–336 for Ant properties, 24 BasicTokenStream class, 329 in BeanUtils, 141 bean:message tag, 519 in JSP, 468 bean tag library, 518 in regular expressions, 299 Bean1 class, 469 Brackets ([]) in regular expressions, 299–300 Beans, 6–7 Breakpoints in Eclipse, 60, 62 dynamic, 144–145 Brokers in OJB, 210–211 form, 471–472, 522–526 BrowserBean class, 484–485 Pekowsky-138003 book December 8, 2004 19:38

562 Index

Browsers CalcServlet class, 100–103 Cactus tests with, 111–114 CalcServletTest class, 110 detecting, tags for, 483–485 CalcTest class, 555 importing client certificates into, 446 Calculator bsh.jar file, 398 actions for, 522–524 Bugs dynamic handlers for, 553–555 in Eclipse, 60, 62–64 Expression Language for, 473–476 JUnit tests for, 80–81 form beans for, 522–524 Build process and files. See Ant tool formatting for, 477–478 build.properties file, 530 forms for, 511–513 build.xml file, 13 JMeter for, 122 buildArrays method, 170–171 scripts for, 395–398 Builder patterns, 268 ServletRunner for, 100–103 BuildException class, 38 struts for, 510–520 -buildfile option in Ant, 26 validating, 506 Built-in tasks in Ant, 27–28 Web-based, 91–99 AntCall, 28 Calculator class, 510 Copy, 28–29 calculator.jsp file, 517 Delete, 29–30 CalculatorAction class, 514–516 example, 35–36 CalculatorAction2 class, 523–524 Exec, 30 CalculatorAction3 class, 525 Get, 30–31 CalculatorForm class, 511–513, 515–516, 518 Jar, 31–32 CalculatorForm2 class, 521–522 Java, 32–33 Call stacks in Eclipse, 62 Javac, 33–34 Calling BeanShell from Java, 411–412 Javadoc, 34–35 Capturing patterns, 310 Carets (ˆ) in regular expressions, 300 c:choose tag, 486–488 CASE INSENSITIVE MASK flag, 301 c:forEach tag, 478–479, 485, 489 CASE SENSITIVE MASK flag, 307 c:if tag, 480–482, 485–486 case sensitivity c:import tag, 497, 501, 538 in grep, 312 c:otherwise tag, 486–487 of search tokens, 339 c:out tag, 472–477, 485, 489 Cat class, 264–269 c:set tag, 476–477, 485 Cat3 class, 286–291 c:when tag, 486–487 catalina.policy file, 419 Caches in DBCP, 192 catalina.properties file, 419 Cactification process, 115 Cathedral and the Bazaar (Raymond), 4 Cactus, 105–109 CDCollection class, 274–277 browser tests with, 111–114 CDFactory class, 156 with Eclipse, 114–117 CellValueRecordInterface class, 369 summary, 118 Certificate authorities, 437, 441 writing and running tests in, 109–111 Certificates in Tomcat, 437–440 cactus.properties file, 107–109 in certificate-based authentication, 446–456 cactus-report.xsl stylesheet, 113 client, 440–446 Calc class, 395–398 Characters in regular expressions, 298 calc result.jsp file, 517 checkValues method, 92 CalcBean class, 474 childIterator method, 163–164, 166 CalcImpl class, 553–555 choose tag, 486–488, 498 CalcInterface interface, 553–555 class-descriptor node in OJB, 204–205 Pekowsky-138003 book December 8, 2004 19:38

Index 563

Classes Combining tags, 485–486 in Eclipse, 49–53 Command line arguments in Ant, 26–27 extending, 408 Command-line interface (CLI), 261–272 in Java, 6–7 CommandLine class, 263, 268 in JUnit, 78–80 CommandLineParser interface, 263 in JXPath, 156 Commas (,) for calculator output, 477 redefining, 409 common directory, 420 classes directory, 420, 422 Company information in certificates, 445 ClassFilter class, 284–285 compareChildNodePointers method, 162, 165 classname attribute, 33 Compatibility of Java scripts, 408–411 classpath element, 23–24 Compiling classpathref attribute in Ant. See Ant tool in Javac, 33 regular expressions, 301 in Javadoc, 34 Components in XML, 534 CLASSPATHs and classpath attribute Compound objects, 155 in Ant, 23–26 computeSum method, 511, 515 in Javac, 33 Conditional tags for page sections, 480–482 in Javadoc, 34 conf directory, 419–420, 426, 433 in JMeter, 127 config parameter for ActionServlet, 509 for Web applications, 422 Configurable behavior, scripting for, 413–414 Cleartext, 436 Configurable log destinations, 228 CLI (command-line interface), 261–272 Configuration click method, 94–95 DBCP, 187, 190–192 Client certificates in Tomcat, 440–446 Log4j, 243–246 Clients in Cactus, 107, 112 logging, 233–236 Clobs, 179 program options close method Jakarta CLI, 261–272 in ExecAppender, 256–257 Jakarta Digester, 272–294 in OJHandler, 239 summary, 295 in SimpleIndex, 327–328 configurations parameter for Cocoon, 532 in WebIndex, 342 Connection class, 185 closeProgram method, 256 Connections in database pooling, 185–193 Closures in BeanShell, 403 Console view in Eclipse, 62 Clusters for Tomcat, 463 Constants in Java, 481 Cocoon, 529 Constraints building and configuring, 529–533 in OJB, 390 for databases in web.xml, 427 accessing, 541–545 Constraints class, 390 writing to, 545–549 contains element, 20–21 pros and cons of, 549 contains method, 302 summary, 550 Content files for Web applications, 422 Web application, 531–533 Context node in Tomcat, 457–458 working with, 533–541 Context parameters in web.xml, 423 cocoon.xconf file, 533, 541 Contexts in JXPath, 158, 169–171 cocoon.xmap file, 535 Controller tasks Code references in Eclipse, 55 common, 505–507 Collection class, 136 struts for. See Struts collection-descriptors, 208, 212 Controllers in Model/View/Controller Collections in OJB, 204–205 model, 8–9 Pekowsky-138003 book December 8, 2004 19:38

564 Index

convert method, 142–143 in server mode, 225 Converters triggers in, 184–185 in BeanUtils, 140–144 JUnit tests for, 82–83 in JXPath, 155 lazy evaluation in, 216–219 Converting dates, 325 OJB tool for Copy task, 28–29 mapping databases to objects in, 193–209 copyDir task, 29 queries in, 212–214 copyFile task, 29 working with, 210–212 Copying Ant files and directories, 28–29 related tools for, 219–222 copySheetProperties method, 381–383 retrieving data, 212–216 CreateArtist action, 546, 548 saving log messages to, 236–239 createDirectory method, 356 summary, 226 createDocument method, 356 for Web applications, 456 createDocumentInputStream method, 362 writing to, 545–549 createNodePointer method, 159–160 DataSourceConnectionFactory class, 189 createObject method, 156–157 date property, 478 createPath method, 158 date tag, 507 Credentials in Tomcat, 429 DateDynaBean class, 146 Criteria class, 214 Dates Criteria in database queries, 214–216 converting, 325 Cryptography classes, 49 formatting, 478 Curly braces ({}) Davidson, James Duncan, 11 for Ant properties, 24 DBCP (Database Connection Pool), 185–193 in BeanUtils, 141 DEBUG level in Log4J, 243 in JSP, 468 Debugging in regular expressions, 299 in Eclipse, 60, 62–64 Custom handlers in Digester, 291–294 JUnit tests for, 80–81 Custom rules in Digester, 284 Debugging level in JDBC realm, 435 customer role, 428 debuglog.xml file, 235 Decimal points (.) -D option in Ant, 27 for calculator output, 477 DailyRollingFileAppenders, 247 in log files, 235 Dashes (−) in regular expressions, 299 in Ant command line, 26 in XPath, 150 in CLI, 263 Declarations in regular expressions, 300 BeanShell variables, 401 in text searches, 334 servlet, in web.xml, 424 Data files in hsqldb, 176 Defining Database Connection Pool (DBCP), 185–193 databases and objects, 193–200 Database manager in hsqldb, 174 object-relational mapping, 200–209 DatabaseAddAction class, 546 delete method DatabaseManager class, 174–175 in Blob, 180, 183 DatabaseManagerSwing class, 175 for brokers, 211 Databases in PersistentObject, 223 Cocoon for, 541–545 Delete task, 29–30 DBCP connection pooling for, 185–193 DeleteArtist action, 546 hiding persistence from applications, 222–225 deleteDir tasks, 30 hsqldb tool for, 173–179 deleteFile task, 30 large objects in, 179–184 Deleting Ant files and directories, 29–30 Pekowsky-138003 book December 8, 2004 19:38

Index 565

Demo class, 408 DocumentInputStream class, 352 Demo1 class, 411–412 doGet method, 100 DemoTask class, 37 Dollar signs ($) demotest.jmx file, 128 for Ant properties, 24 demotest.jtl file, 128 in regular expressions, 300 DENY filters in Log4J, 243, 245 DOM (Document Object Model), 94–96 Dependencies in ant, 14–16 doPost method, 100 depends attribute doRead method, 279–280 for Ant targets, 14 doRun method, 342 in form beans, 524 Dots (.) Descriptions in web.xml, 423–424 for calculator output, 477 descriptor property, 547–548 in log files, 235 Design patterns in JXPath, 156 in regular expressions, 299 dest attribute, 31 in XPath, 150 destdir attribute, 34 double validations in form beans, 524 destfile attribute, 31 doubleValue method, 526 dictionaries in Egrep, 317 doWrite method, 280–281 digest attribute, 436 DRM (digital rights management), 347 Digester, 272–294 DTDs (Document Type Definitions) Digital rights management (DRM), 347 in Digester, 275, 284 dir attribute in OJB, 201 in Ant, 18 in web.xml, 422 in Delete, 29 in XPath, 147–148 Directories dump method, 350–352 in Ant DynaBeans, 144–146, 524–525 copying, 28–29 DynaClass interface, 144, 146 deleting, 29–30 Dynamic attributes, 468–472 listing, 39–41 Dynamic beans, 144–145 in JXPath, 158–159 Dynamic proxies, 551–558 in POIFS, 348–349 DynaProperties, 144 in Tomcat, 418–421 DynaValidatorForm class, 526 DirectoryBean class, 169–171 DirectoryEntry class, 348–349, 352 Eager evaluation, 213–214 DirectoryScanner class, 39, 41 Eavesdropping, 437 Dispatching, 556 Eclipse editor, 43–45 Display names in web.xml, 423 Ant with, 65–66 Displaying expressions, tags for, 472–477 with Cactus, 114–117 Distributed testing, 125–126 classes in, 49–53 div method, 408–409 for databases, 220–221 Document class, 324–325 error handling in, 53–56 Document Object Model (DOM), 94–96 factorial program in, 56–65 Document Type Definitions (DTDs) JUnit integration with, 85–87 in Digester, 275, 284 Package Explorer in, 49–51, 53 in OJB, 201 projects in, 46–48 in web.xml, 422 startup screen in, 45–46 in XPath, 147–148 summary, 67 Documentation, javadoc-style, 34–35 Edit-time error detection, 56 DocumentContainer class, 153 Editor view in Eclipse, 62 DocumentEntry class, 348, 352, 356 Editors, Eclipse. See Eclipse editor Pekowsky-138003 book December 8, 2004 19:38

566 Index

Egrep class, 312–318 templating, 373–393 Egrep tool ExcelReader class, 365–369 implementation, 312–318 exclude element, 18–20 for Web pages, 323 excludes attribute, 33 element-class-ref attribute, 205 Excluding Ant filesets, 18–20 Element matching patterns, 272–273 Exec task, 30 Emacs editor, 45 ExecAppender class, 254–258 Embedded SQL, 542 executable attribute, 30 empty method, 513 execute method Encryption in DemoTask, 37 passwords, 436 in LsTask, 39–41 in Tomcat, 437–440 in SimpleEchoTask, 38 end method, 302 Export passwords for certificates, 445 in Matcher, 310 Expression Language, 473–476 in MatchResult, 303 Expressions in Rule, 291 in BeanShell, 399–400 endorsed directory, 420 displaying, tags for, 472–477 endsWith method, 177 in JSP, 468–469 Engineering, 5–6 regular. See Regular expressions Environment variables and resources in XPath, 150 in Ant, 25–26 Extending Java classes, 408 in Tomcat, 456–457 Extensible Markup Language. See XML in web.xml, 426–427 (Extensible Markup Language) and XML EOFRecord class, 360 documents Equal signs (=) Extensible Stylesheet Transformation (XSLT) in Ant command line, 27 files, 499–504 in certificate-based authentication, 446 for HTML, 537–539, 543–544 for Java equality, 481 for JUnitReport, 85 Equality in Java, 481 Extensions, scripting for, 414 error.jsp file, 432 External programs in Ant, 30 ERROR messages, SMTPAppenders for, External Tools option in Eclipse, 65–66 250–251 Error pages in web.xml, 426 -f option in Ant, 26–27 Errors fact function, 402–403 in Eclipse, 53–56 Factorial class, 58–59, 72–73 logging for. See Logging factorial method, 177–178 in OJB, 209 Factorials errors tag, 518–519 in BeanShell, 402 escapeXml option, 489 in Eclipse, 58–65 eval method, 411–412 in hsqldb, 177–178 evaluate method, 410 in JUnit, 70–73 Evaluation in regular expressions, 298 Factories, 7 Event-driven APIs, 352–353 in DBCP, 187–190 EventDemo class, 353–357 in JXPath, 156–160 Events in HTTPUnit, 96 FactSuite class, 78–79 Evict class, 188 FactSuite.txt file, 84 Excel spreadsheets, 347, 357–369 FactTest class, 70–71 creating, 369–372 FactUnit class, 74–75 formatting, 372–373 fail method, 75 Pekowsky-138003 book December 8, 2004 19:38

Index 567

fail task in Ant, 26–27 for syntax in BeanShell, 400–401 Failure modes in HTTPUnit, 96 forEach tag, 478–479, 485, 489, 498 FATAL messages, 250–251 Foreign keys in OJB, 195, 205, 212 Field class, 324 Form parameters in JMeter, 123 field-descriptor node in OJB, 204–205 form tag, 519 file attribute format parameter for Digester filters, 284 in Copy, 29 formatDate tag, 477 in Delete, 29 formatNumber tag, 477 File-based realms, 433–434 Formatter class, 231 File generators, 538 Formatting File menu in Eclipse, 50 calculator, 477–478 -file option in Ant, 26 logging data, 231, 239–241 FileDocument class, 325 spreadsheets, 372–373 FileHandler class, 234, 281–282 XML, 498–504 Files in Ant FormBean class, 471–472 copying, 28–29 Forms deleting, 29–30 auto incrementing in, 547–548 fileset element, 18 for calculators, 511–513 Filesets in Ant, 31 form beans, 471–472 implicit, 31 eliminating, 524–526 including and excluding, 18–20 validating, 520–524 patterns in, 19–20 in HTTPUnit, 95 as task arguments, 16–18 in JMeter, 123–124 tools for, 20–21 testing, 102–103 FileSystemNodeIterator class, 166–169 validating, 506 FileSystemNodePointer class, 161–166 FormulaRecord class, 360 FileSystemNodePointerFactory class, 159–160 forward tag, 517 Filesystems, recursiveness of, 352 Free software, 3–4 Filter interface, 279, 282 Free Software Foundation (FSF), 3–4 filter method, 284–285 Free text searches, 323 Filters Function class, 410–411 in CLI, 269 Functions in BeanShell, 402–405 in Digester, 284–285 Fuzzy matches, 334 in logging, 232–233, 243, 245 FuzzyQuery class, 331 in web.xml, 423–424 find method, 310 General Public License (GPL), 3 -find option in Ant, 27 Generators findLastIterateRow method, 392 file, 538 findNode method, 95 pipeline, 533 FINE logging level, 230 generators tag, 535 fine method, 230 GenericObjectPool class, 187 FINER logging level, 230 genkey option in keytool, 438 FINEST logging level, 230, 232 get method finish method, 291 in DynaValidatorForm, 526 Finite state machines, 298 for indexed properties, 137–138 fire method, 184 in Interpreter, 411–412 flush method, 239 in lazy evaluation, 216 fmt:formatDate tag, 477 Get task, 30–31 fmt:formatNumber tag, 477 getAlbum method, 135, 198 Pekowsky-138003 book December 8, 2004 19:38

568 Index

getAlbums method, 198, 217 getMessage method getAnnotation method, 136 in BeanShell, 409 getArgs method, 340 in SampleBean, 459 getArtistId method, 195, 198 getMetaTagContent method, 345 getBaseValue method, 162, 166 GetMethodWebRequest method, 91 getCheese method, 471 getModifiedTime method, 170 getClassName method getName method in ClassFilter, 284 in Album, 274 for templates, 378 in Argument, 283 getCollectionByQuery method, 217 in Artist, 135, 198, 274 getColor method in Bean1, 469 in Bean1, 469 in DirectoryBean, 170 in FormBean, 471 in FileSystemNodePointer, 162 getConnection method, 186–187 getNodePointer method getConstraints method, 378 in FileSystemNodeIterator, 167 getContents method in SimpleIterator, 168 in Blob, 181–183 getNumAlbums method, 135 in FileSystemNodePointer, 165–166 getNumber method, 515 getContentType method, 180 getNumber1 method getCurrentTime method, 469 in Calculator, 510 getDate method, 146 in CalculatorForm, 511 getDBClassName method, 381 in CalculatorForm2, 522 getDBObjectIterator method, 383, getNumber2 method 389–390 in Calculator, 510 getDirectories method, 164 in CalculatorForm, 511 getDirectory method, 170–171 in CalculatorForm2, 522 getDOM method, 95 getObjectByQuery method, 215 getEntries method, 349 getOpenEachTime method, 254 getFactorial method getOrder method, 160 in Factorial, 58–63, 72 getOrderedAlbum method, 135 testing, 71 getOutputFileName method, 378 getFile method, 171 getPassword method getFiles method, 164 in ModifiedUserDatabaseRealm, 449, 451 getFirstCellText method, 391–392 in UserDatabaseRealm, 447 getFirstCollection method, 153 getPosition method getForms method, 95 in FileSystemNodeIterator, 167 getFullName method, 484 in SimpleIterator, 168 getImmediateNode method, 162, 166 getPrime method, 405, 407 getIndexedProperty method, 137 getPrimer method, 406 getInputFileName method, 377 getPrimes method, 406 getInValue method, 459 getPrincipal method getLength method, 162 in ModifiedUserDatabaseRealm, 449, getLevel method, 237 451–455 getLinks method, 345 in UserDatabaseRealm, 447 getLinkWith method, 94–95 getProgramName method, 254 getLiveShow method, 199 getProperty method, 139–140 getLiveShows method, 199 getResource method, 153 getLogger method, 240 getRoot method, 349, 351 getMatching method, 223–225 getSave method, 222 Pekowsky-138003 book December 8, 2004 19:38

Index 569

getSecondCollection method, 153 handleLabelSSTRecord method, 367 getSeventhPrimeNumber method, 469 handleMergeCellsRecord method, 366 getSheetName method, 378 handleNumberRecord method, 366 getShoulderShow method, 471 handleRowRecord method, 366 getShowSize method, 39 Handlers getStartFlag method, 386, 390–391 in Digester, 291–294 getSum method dynamic, 553–555 in CalcBean, 474 for logging, 236–239 in Calculator, 510 handlers property, 236 getText method, 95, 345 handleSSTRecord method, 365 getTextField method, 471 handleUnknownRecord method, 364, 367, 369 getTheFile method, 170 hasArg method, 269 getTotal method, 408 hasArgs method, 269 getTrack method, 149 hasOptionalArg method, 269 getType method, 484 hasOptionalArgs method, 269 getValue method HelpFormatter utility, 264, 268 in Argument, 283 Hiding persistence, 222–225 in FileSystemNodePointer, 163 Hierarchical data in JXpath, 154–155 with beans, 133 getValue1 method, 474 traversing with JXPath. See JXPath getValue2 method, 474 High-level APIs, 357–358 getValues method, 409–410 Hits class, 329 getVenue method, 197–199 Hsqldb manager, 175 getVenues method, 198 Hsqldb tool, 173–179 getxml tag, 545 large objects in, 179–184 getYearReleased method in server mode, 225 in Album, 275 triggers in, 184–185 in AlbumProxy, 218 HSSF APIs, 357–358 Global resources for Tomcat, 456–461 HSSF serializers, 394 Global variables in Ant, 21–22 HSSFCellStyle class, 372 GNU, 3–4 HSSFDispatcher class, 363–365 GPL (General Public License), 3 HSSFEventFactory class, 360 Greediness in regular expressions, 305–306 HSSFListener interface, 360, 363 grep program, 278, 311–312 HSSFRequest class, 360 group method, 310–311 HSSFWorkbook class, 383 html:base tag, 518 handle method, 100–101 HTML documents, indexing, 326 handleAreaFormatRecord method, 364 html:errors tag, 518–519 handleAreaRecord method, 364 html:form tag, 519 handleBlankRecord method, 367 html:html tag, 518 handleBOFRecord method, 365 html tag library, 518 handleBoundSheetRecord method, 366 html:text tag, 519 handleDefaultRecord method, 363–365, HTTP-based authentication, 126–127 367, 369 HttpServletRequest interface, 99 handleFile method HTTPUnit, 89–91 in Cat, 265–266 ServletRunner with, 99–103 in Egrep, 314–315 summary, 103 in LsTask, 40 Web-based calculator example, 91–99 handleFormulaRecord method, 366–367 HURD kernel, 3 Pekowsky-138003 book December 8, 2004 19:38

570 Index

I/O bound applications, 413 for scripting, 405–408 Icons in web.xml, 423 in Tomcat, 420 Identical functions in BeanShell, 403 Internationalization IDEs (Integrated Development Environments), formatting for, 478 44–45 il8n.jar classes for, 49 Idle objects in DBCP, 188 of log messages, 239–241 if tag, 480–482, 485–486, 498 Interpreted languages, 395 il8n.jar file, 49 Interpreter class, 411–412 IllegalArgumentException class, 71–72, 75 inverse-foreignkey, 205 Impart plugin, 219–221 Inverse relationships, 195 ImpartOJBGenerator.properties file, 220 Invocation of methods, 552 Implementing interfaces, 405–408 invoke method, 552 Implicit filesets, 31 in CalcImpl, 554 Implicit objects, 475 in SampleOBJProxy, 556 import statement in BeanShell, 401–402 in SampleScriptProxy, 557 import tag, 497, 501, 538 IOUtils class, 279–281 Importing isAttribute method, 163 client certificates, 446 isCollection method, 162 for templates, 375–376 isDayPrime method, 406 In-container strategy, 105 isEndMarker method, 386, 391 In-memory hsqldb modes, 174 isLeaf method, 163 In-process hsqldb modes, 174 isLoggable method, 232–233, 239 include element, 18–20 isPrime method, 405–407 include tag, 482 isRequired method, 269 includer.xml file, 539–540 iterate method, 154, 167, 216 includes attribute, 33 Iterations and iterators Including Ant filesets, 18–20 in BeanShell functions, 402 index.html file, 421 in JXPath, 166–169 Indexed properties in BeanUtils, in lazy evaluation, 216 137–138 in pages, 478–480 Indexes in POIFS, 349 in OJB, 194–195 in traversing documents, 154 in searches Jakarta Cactus, 105–109 creating, 323–329 browser tests with, 111–114 for Web pages, 336–345 with Eclipse, 114–117 working with, 329–336 summary, 118 in XPath, 149 writing and running tests in, indexPage method, 343–345 109–111 IndexSearcher class, 329 Jakarta CLI, 261–272 IndexWriter class, 326 Jakarta Digester, 272–294 Infinite loops, 239 jar attribute, 33 Input in regular expressions, 298 Jar task, 31–32 Inserting data from JSPs, 491–493 Java Integrated Development Environments (IDEs), in Ant 44–45 compiling, 33–34 Interactive languages, 395 running, 32–33 Interfaces beans in. See Beans in Eclipse, 52 BeanShell with in Java, 7 calls from, 411–412 Pekowsky-138003 book December 8, 2004 19:38

Index 571

classes, 401–402 inserting data from, 491–493 script compatibility for, 408–411 for XSLT files, 500–501 modularity in, 6–8 jsp:include tag, 482 scripting languages within, 395 jsp:setProperty tag, 472, 477, 494, 505 Java Data Objects (JDO), 225 jsp:transaction tag, 492 JAVA HOME environment variable, 26, jsp:useBean tag, 469, 472, 478–479, 494 442, 529 JSTL (Java Standard Tag Library), 93 Java Naming and Directory Interface (JNDI), JUnit class, 69–70, 74 456, 489 Ant integration with, 83–85 Java option in Eclipse, 47 classes in, 78–80 Java Runtime Environment (JRE), 49 Eclipse integration with, 85–87 Java Server Pages. See JSP (Java Server Pages) factorial program in, 70–73 Java Standard Tag Library (JSTL), 93 summary, 87 Java task, 32–33 test decisions for, 79–83 Java.util.logging package, 228–229 testing framework in, 73–78 Javac task, 33–34 .jar file, 83 javadoc junit task, 84 in Ant, 34–35 JUnitReport task, 85 in Eclipse, 53 JXPath Javadoc task, 34–35 contexts in, 169–171 jdbc-connection-descriptor node, 202 extending, 158–169 JDBC realms, 434–436 iterators in, 166–169 JDBCAppenders, 252 nodes in, 159–166 JDBCRealm realm, 436 with OJB, 197 JDEE IDE, 44–45 setting values in, 155 JDKI.4 pattern matching classes, 309–311 structures in, 155–158 JDO (Java Data Objects), 225 summary, 171 jk2.properties directory, 419 working with, 150–155 JMeter JXPathContext class, 152–153 with Ant, 127–128 JXPathContextReferenceImpl class, 158 distributed testing in, 125–126 JXPathDemo class, 151–152 logic controllers in, 126–127 for pool configurations, 188 Keys in OJB, 194–195, 202, 205, 211–212 stress test procedures in, 128–130 keystore directory, 438 summary, 130–131 keystore option working with, 119–125 in keytool, 443 jmeter.properties file, 125–126 in server.xml, 446 jmeterhome attribute, 128 keystores, 438 JMeterTask task, 127 keytool tool, 438–440, 442–444 JNDI (Java Naming and Directory Interface), 456, 489 L4JManual class, 242 Join tables, 196 LabelRecord class, 360 JRE (Java Runtime Environment), 49 LabelSSTRecord class, 360 -Jremote hosts option, 125 Large objects, 179–184 JSP (Java Server Pages) Layout class, 249 addition objects in, 474 Lazy evaluation in database retrieval, 214, expressions in, 468–469 216–219 for generating XML, 495–496 Leaf data in JXPath, 154 implicit objects in, 475 Level class, 229–230 Pekowsky-138003 book December 8, 2004 19:38

572 Index

LevelFilter class, 233 Logical operators in searches, 334 Levels login-config node, 431, 446 log, 227, 229–230 login.jsp file, 431–432 in Log4J, 241 logkit-config file, 532 lib directory, 420, 422 logkit.xconf file, 533 Libraries, tag. See Tags and tag libraries logMessage en.properties file, 240 Lifecycle methods for rules, 291 LogRecord class, 230–231, 236–237 like keyword in SQL, 318 logs directory, 420 like method in RegexpLike, 319–320 LogServer class, 248–249 links for Web-based calculator, 94–95 Loops, infinite, 239 Linux, 4 Lowercase for search tokens, 339 list option in keytool, 439 ls task, 16, 19, 22 Listeners LsTask class, 39–41 in JMeter, 123 in web.xml, 424 Make tool, 11 Listing Ant directories, 39–41 makeBlobFromContents method, 181 Literals makeBlobFromFile method, 181–183 in Java, 481 makeBlobStringFromContents method, 181 in JSP, 468 makeBlobStringFromFile method, 181 in regular expressions, 299 makeClosure function, 404 load-on-startup file, 532 makeObject method, 190 Load testing in JMeter, 125–126 makeOptions method loadAlbum method, 218 in Cat, 264–265 local.blocks.properties file, 530 in Egrep, 312–313 local.build.properties file, 530 for templates, 376–377, 380 log method, 229–230 in WebIndex, 341 log table, 236–237 MakeSpreadsheet class, 370–372 Log4J logging system, 241 Manager role, 428–429 appenders in, 246–253 manifest attribute, 36 configuring, 243–246 manual method, 233–234 extending, 253–258 Many-to-many relationships, 194, 196–197, working with, 241–243 204–205 log4j.properties file, 246 map:generators tag, 535 log4j.xml file, 246 map:serializers tag, 535 logdata.xml file, 234 map:transformers tag, 535 Logger class, 228, 241 Mapped BeanUtils properties, 138–139 Logging, 227–228 Mapping configuring, 233–236 in Cocoon, 532 filtering in, 232–233 databases to objects, 193–209 formatting, 231, 239–241 filters in web.xml, 424 handlers for, 236–239 object-relational, 200–209 Java.util.logging package for, 228–229 servlets in web.xml, 425 levels in, 227, 230–232 Masks in form beans, 524 Log4J system. See Log4J logging system Master log filters, 233 messages, 229–230 MATCH CASEINDEPENDENT flag, 308 in OJB, 200 match method, 308 process, 230–232 MATCH SINGLELINE flag, 308 summary, 259 Matcher class, 310–311 Logic controllers, 126–127 matches method, 302, 318 Pekowsky-138003 book December 8, 2004 19:38

Index 573

MatchResult class, 302–303 newFileName method, 180, 183 maximumFileSize property, 247 newInstance method maybeShow tag, 467, 472, 481–482 in CalcImpl, 553–555 MBeans system, 463 in SampleOBJProxy, 555–556 MemoryRealm realm, 446 in SampleScriptProxy, 557–558 mergeArray method, 290 next method MergeCellsRecord class, 369 in searches, 339 message tag, 519 in TokenStream, 326 Messages, logging, 229–230 in WebTokenStream, 338 META-INF directory, 31 NodeIterator class, 158 Methods NodePointer class, 158 in Eclipse, 49, 53, 55 NodePointerFactory class, 158 invoking, 552 Nodes Microsoft Office. See Office documents in DOM, 95 Mime mappings, 425 in JXPath, 159–166 Minus signs (−) in OJB, 204–208 in Ant command line, 26 NONE logging level, 230 in CLI, 263 NoSuchElementException class, 188 in regular expressions, 300 NOT operator, 332, 334 in text searches, 334 NTEventLogAppenders, 251 Model/View/Controller model, 8–9 Null values in BasicDynaBean, 145 ModifiedUserDatabaseRealm class, 447–450 NullPointerException class, 375 Modifiers NumberRecord class, 360 in Eclipse, 52 Numbers in text searches, 334 in BeanShell, 401 Modularity in Java, 6–8 in JSP, 468 MultiCollection class, 153–154 prime, 405–408 MULTILINE MASK flag, 305 Multiple choices, tags for, 486–488 Object Data Management Group (ODMG), 225 MyClass class, 551 Object databases, 193 MyDemo class, 551 Object-level lazy evaluation, 218 MyInterface interface, 551–552 Object of Data Abstraction and Structures (Using Java) (Riley), 7 Name/value pairs Object-relational mapping in Ant, 16 defining, 200–209 in BeanUtils, 144 tools for, 193 Names Object stacks in Digester, 272 in certificates, 445 ObjectCreateRule method, 273, 283 in Eclipse, 56–57 Objects, mapping databases to, 193–209 for loggers, 228 Octothorps (#) in templates, 374 Namespaces in BeanShell, 403 ODMG (Object Data Management Group), 225 Negation in regular expressions, 300 Office documents, 347–348 Nesting Excel spreadsheets, 347, 357–369 beans, 133 creating, 369–372 properties, 139–140 formatting, 372–373 tags, 468 templating, 373–393 NetBeans IDE, 44–45 POIFS file system for, 348–357 NEUTRAL filters, 243 Word documents, 393 newContext method, 158, 160 OJB.properties file, 200 Pekowsky-138003 book December 8, 2004 19:38

574 Index

OJB tool Parsers mapping databases to objects in, in CLI, 263 193–209 regular expressions for, 398 queries in, 212–214 password field in Tomcat, 432 working with, 210–212 Passwords OJHandler class, 238 for certificates, 445–446 One-to-many relationships, 194–196, encrypting, 436 204–205 in keytool, 439, 444 One-to-one relationships, 195 in tomcat-users.xml, 461 One-way encryption mechanism, 436 pathelements element, 23 Open source, 2–5 Paths in Ant, 23–26 Open Source Initiative, 4 Pattern class, 310–311 OpenOffice, 347 PatternLayout class, 243 openProgram method, 256 PatternMatcher class, 302 openssl command, 441, 444 PatternMatcherInput class, 302 OptionBuilder class, 268–269, 271 Patterns Options in Ant filesets, 19–20 program for calculator output, 477–478 Jakarta CLI, 261–272 in JDKI.4, 309–311 Jakarta Digester, 272–294 in regular expressions, 298–301, 308 summary, 295 in XLST, 499 for templates, 376–380 peek method, 292 Options class, 262, 264, 268 perform method OR operator, 332, 334 in CalculatorAction, 514–516 orderby attribute, 205 in CalculatorAction2, 523 ORO regular expressions, 301–303 in CalculatorAction3, 525–526 greediness and reluctance in, 305–306 Perl5Substitution class, 307 subpatterns in, 301–303 Persistence, hiding from applications, substitutions in, 306–307 222–225 otherwise tag, 486–487, 498 PersistenceBroker class, 210, 222, 390 out tag, 472–477, 485, 489, 498–499 PersistentObject class, 222–225 Outline view in Eclipse, 53, 62 PhraseQuery class, 330 output method, 315, 317 Pipelines, 529, 533–535, 546 Plugins for Cactus, 115 Package-by-package logging levels, 229 Plus signs (+) Package Explorer in Eclipse, 49–51, 53 in BeanShell, 400 pageContext class, 475 in regular expressions, 299 Pages, web in text searches, 334 conditional sections in, 480–482 POI tool, 326, 347–348 iteration in, 478–480 for Excel spreadsheets, 347, 357–369 search indices for, 336–345 creating, 369–372 param tag, 491 formatting, 372–373 Parameters. See Arguments templating, 373–393 parens, 308 POIFS file system, 348–357 Parentheses () in regular expressions, summary, 394 300, 303 for Word documents, 393 parse method, 334 POIDump class, 349–352 parse tag, 497–498 POIFS file system, 348–357 Parser class, 263 POIFSDocumentPath class, 355 Pekowsky-138003 book December 8, 2004 19:38

Index 575

POIFSFileSystem class, 351 in Eclipse, 46–48 POIFSReader class, 352, 355 Properties POIFSReaderEvent class, 352 in Ant, 24–27 POIFSReaderListener class, 352, 355 in BeanUtils PoolableConnectionFactory class, 193 indexed, 137–138 Pooling database connections, 185–193 mapped, 138–139 PoolingDriver class, 190 nested, 139–140 popNextAlert method, 96 simple, 137 POSIX standard, 308 in hsqldb, 176 Prefabricated components, 2 in JUnit, 85 premium customer role, 428, 430–431 in OJB, 194 PreparedStatements, 193 rules for, 293–294 Primary keys in OJB, 194, 202, 211 in XPath, 150 Prime numbers script, 405–408 PropertyUtils class, 137, 386 PrimeInterface interface, 405–406 Proxies and proxy classes PrimeUser class, 406–407 in Digester, 284 Primitive types in JXPath, 155 dynamic, 551–558 print command, 401 Proxy class, 552 printHelp method, 271 publish method, 238–239 Printing log messages, 227–228 println statements, 227 Queries process-artist.html file, 547 database data, 212–216 process method in text searches, 330–336 in Cat3, 289–291 Query class, 329 for templates, 380–381, 383 query tag, 488–491, 542 processArgs method QueryByCriteria class, 215, 390 in Egrep, 315–317 QueryByIdentity class, 215–216 for templates, 378–380 QueryBySQL class, 216 in WebIndex, 342–343 QueryParser class, 334 processBlock method, 383–386, 389 QueryTool class, 175 processCell method, 387–389 Question marks (?) in regular expressions, 299 processExpression method, 397–398 Quotes (”,’) Processing rules in Digester, 272 in Java, 481 processPOIFSReaderEvent method, 352–355 in JSP, 468 processRecord method in HSSFDispatcher, 363–364 RangeQuery class, 331 in HSSFListener, 360 Ranges in SimpleReader, 361–362 in regular expressions, 300 processRow method, 386–387, 389 in text searches, 331, 334 Program arguments, rules for, 291–292 Rapid testing and development, 413 Program options Raymond, Eric S. (The Cathedral and the CLI, 261–272 Bazaar), 4 Digester, 272–294 rdbs2j tool, 219 summary, 295 read method ProgramHandler class, 283 in FileHandler, 282 Programmatic approach in DBCP, 187 in Readable, 279 Programming by contract, 7 Readable interface, 279, 282 Projects readFile method, 182–183 in Ant, 12–13 ReadSpreadsheet class, 358–360 Pekowsky-138003 book December 8, 2004 19:38

576 Index

Realm interface, 433 ResourceBundle class, 240 Realms in Tomcat, 432 ResourceLink class, 460 encrypting passwords in, 436 ResourceParams, 434 file-based, 433–434 Resources for Tomcat JDBC, 434–435 global, 456–461 Record class, 359, 362–363 nodes for, 434 RecordFormatException class, 372 resultlog file, 128 Records in Excel, 359 Retrieving database data, 212–219 Recursiveness of filesystems, 352 return keyword in BeanShell, 402 Redefining reverse-db tool, 219 Ant variables, 22 reverse-db2 tool, 219 classes, 409 reverse tags, 481 Redirectors in Cactus, 105–108, 111 Riley, David (The Object of Data Abstraction and reference-descriptor node in OJB, Structures (Using Java)), 7 207–208 Roles in Tomcat, 428–431 Referential integrity, 195 Rolling logs, 246–247 refid attribute, 22 RollingFileAppenders, 246–247 Reflection APIs, 134 Root directories in POIFS, 348–349 regex package, 309–311 Root nodes in web.xml, 423 Regexp tool, 307–309 RowRecord class, 360 RegexpLike class, 318–321 rt.jar file, 49 registerListener method, 355 Rule class, 291 Regular expressions, 297–300 Rules examples, 311–321 for program arguments, 291–292 greediness and reluctance in, 305–306 for properties, 293–294 JDKI.4 pattern matching classes for, 309–311 Run dialog in Eclipse, 60 ORO, 301–303 Run menu in Eclipse, 59 for parsers, 398 run method Regexp, 307–309 in RegexpLike, 320 subpatterns in, 303–305 in WebIndex, 342 substitutions in, 306–307 Run-time log configurations, 228 summary, 321 runForm method, 98–99 Relationships, 194–197, 204–206, 212 Running in Ant releaseConnection method, 187 external programs, 30 Reluctance in regular expressions, 305–306 Java programs, 32–33 replaceAll method, 311 Runtime arguments in Eclipse, 60–61 replaceFirst method, 311 Reporting errors in OJB, 209 Safety margins in JMeter tests, 129 Repositories in OJB, 201–203 Sample values in testing, 81–82 repository.xml file, 201 SampleBean class, 458–459 repository database.xml file, 201, 210, 221 SampleFunctions class, 177–179 repository internal.xml file, 203, 211, 221 SampleOBJProxy class, 555–556 repository user.xml file, 203, 221 Samplers for JMeter thread groups, request object, 545 121–122 RequestDispatcher interface, 99 SampleScriptProxy class, 556–558 Required validations in form beans, 524 save method, 223–224 requiresLayout method, 256–257 Saving log messages to databases, 236–239 Resource files for Web applications, 422 sayHello method, 551–552 Resource references in web.xml, 426–427 Scores in searches, 329 Pekowsky-138003 book December 8, 2004 19:38

Index 577

Scripting, 395–398 in web.xml, 424–425 BeanShell language, 398 ServletTestRunner servlet, 112–113 calling from Java, 411–412 ServletUnit utility, 99 components of, 399–402 Sessions in web.xml, 425 functions in, 402–405 set method in hsqldb, 176–177 for Ant tasks, 37 interface implementation for, 405–408 for indexed properties, 137–138 Java compatibility, 408–411 in Interpreter, 411 motivation for, 412–414 set tag, 476–477, 485 summary, 415 setAccessibility method, 452 in Tomcat, 419 setAlbum method, 135, 137, 198, 277 Searches, 323–324 setAlbums method, 198, 205 indices for setAnnotation method, 136 creating, 323–329 setArgs method, 340 for Web pages, 336–345 setArtistId method, 198 working with, 329–336 setAttribute method, 163 summary, 346 setBorder method, 373 Secure Sockets Layer (SSL), 437, 439 setCheese method, 471 security-constraint, 430 setClassName method Security constraints, 427, 430 in ClassFilter, 284–285 Security in Tomcat, 428–432 for templates, 378 Security roles, 428–429 setColor method, 471 Selecting data from XML documents, 497 setConstraints method, 378 Self-signed certificates, 437–438, 442 setContents method, 180, 183 Semantic validation, 507 setContentType method, 180 Semicolons (;) in BeanShell, 400 setDirectory method, 170 sequence-manager, 202, 204 setFactory method, 190 Serializers, 394, 534 setInputFileName method, 378 serializers tag, 535 setInValue method, 459 Server certificates, 443–444 setLiveShow method, 199 server directory, 420 setLiveShows method, 199 Server instances in Cactus, 108 setMessage method server.ks file, 446 in SampleBean, 459 Server mode in SimpleEchoTask, 38 Hsqldb in, 225 setModifiedTime method, 170 in JMeter, 125 setName method server.xml file, 419 in Album, 274 for certificates, 446–447 in Argument, 283 environment variables in, 457 in Artist, 135, 198, 274 for passwords, 436 in DirectoryBean, 170 for realms, 432–433 setNextRule method, 277 resources in, 456, 459 SetNextRules method, 273 for SSL, 439 setNum method Servers in Factorial, 58, 72 application. See Tomcat IllegalArgumentException with, 71 for SocketAppenders, 247 setNumber1 method ServletRunner.jar, 99–103 in Calculator, 510 Servlets, 7–8 in CalculatorForm, 511 in Cactus, 112 in CalculatorForm2, 522 Pekowsky-138003 book December 8, 2004 19:38

578 Index

setNumber2 method Simple properties in BeanUtils, 137 in Calculator, 510 SimpleDateFormat class, 247 in CalculatorForm, 511 SimpleEchoTask class, 38 in CalculatorForm2, 522 SimpleFormatter class, 231 SetObjectPropertyRule class, 293–294 SimpleIndex class, 327–329 setOpenEachTime method, 254 SimpleIterator class, 168 setOrderedAlbum method, 135, 137 SimpleLang class, 396 setOutputFileName method, 378 SimpleParser class, 268 setParameter method, 96–97 Simplepool class, 186–190 setPosition method SimpleReader class, 361–363 in FileSystemNodeIterator, 167 SimpleWebTest class, 89–90 in SimpleIterator, 168 SINGLELINE MASK flag, 301 setPrimer method, 406 sitemap.xmap file, 533 SetProgramArgRule class, 291–292 for actions, 546 setProgramName method, 254 definitions in, 534–536 SetPropertiesRules, 273 for transformers, 540–541, 545 setProperty method, 139–140, 285, 472 Slashes (/) setProperty tag, 477, 494, 505 in JXPath, 158 setRepeatCount method, 38 in XPath, 148–150 setRequest method, 484 SMTPAppenders, 250–251 Sets of files in Ant SocketAppenders class, 247–249 implicit, 31 SocketNode class, 249 including and excluding, 18–20 Sockets, Tomcat for, 417 patterns in, 19–20 sort attribute, 205 as task arguments, 16–18 Source code tools for, 20–21 in Eclipse, 49 setSave method, 222, 224 open source, 2–5 setSheetName method, 378 source method, 411, 413 setShoulderShow method, 471 sourcefiles attribute, 34 setSimpleProperty method, 141 sourcepath attribute, 34 setSum method, 510–511 sourcepathref attribute, 34 setTextField method, 471 Special characters in log files, 235 setTheFile method, 170 Speed of testing, 81 Setting values in JXPath, 155 Spiders, 339–340 setup method, 78, 108–109 split method, 311 setValue method, 155 Splitting tags, 481–482 in Argument, 283 Spoofing, 437 in FileSystemNodePointer, 163 Spreadsheets, 357–369 setValue1 method, 474 creating, 369–372 setValue2 method, 474 formatting, 372–373 setVenue method, 199 templating, 373–393 setVenues method, 198 SQL setYearReleased method, 275 and beans, 493–494 SEVERE logging level, 231–232 embedded, 542 severe method, 230 expression language in, 318 shared directory, 420 tags in, 488–494 show cds.jsp page, 490 sql:param tag, 491 showShowSize method, 39 sql:query tag, 488–491, 542 sids for Records, 362 sql:update tag, 491 simple-page2html.xsl file, 544 sql2html.xsl file, 543 Pekowsky-138003 book December 8, 2004 19:38

Index 579

SqlGeneratorDefaultImpl class, 200 suite method Squares, computing, 410 in CalcServletTest, 110 src attribute, 31 in JUnit, 79 src.jar file, 49 sunrsasign.jar file, 49 srdir attribute, 33 Superclasses in Eclipse, 52 SSL (Secure Sockets Layer), 437, 439 SWT (Standard Widget Toolkit), 45 SSTRecord class, 360 Syntactic errors in Eclipse, 53–55 StackKeyedObjectPoolFactory class, 193 Syntactic validation, 507 Stallman, Richard, 3–4 SyslogAppenders, 251–252 Stand-alone modes System.err file, 228, 232 in hsqldb, 174, 176 System.out file, 228, 232 in Tomcat, 419 Standard Widget Toolkit (SWT), 45 Tag library descriptors (tlds), 422 StandardAnalyzer class, 326, 336 taglibs for Web applications, 422 StandardTokenizer class, 326 tagMatchers, 339 Step into operation, 62, 64 tagPatterns, 338 Step over operation, 62 Tags and tag libraries, 465–466 Stop words in searches, 326 bean and html, 518 store method, 211 with bodies, 466–468 Stored fields for searches, 324 for browser detection, 483–485 Stress testing. See JMeter combining, 485–486 StringMatchFilter class, 245 for conditional page sections, 480–482 Strings for displaying expressions, 472–477 in BeanShell, 401 dynamic attributes in, 468–472 in JSP, 468 for iteration, 478–480 in regular expressions, 299 for multiple choices, 486–488 StringTokenizer class, 311 splitting, 481–482 Structures in JXPath, 155–158 SQL, 488–494 Struts, 505, 507–508 summary, 504 eliminating form beans, 524–526 in web.xml, 426 pros and cons of, 526–527 in XML, 495–503 summary, 527 target attribute, 28 working with, 508–520 Targets in Ant, 12, 14 struts-config.xml file, 520–521, 523–524 Task class, 36–37 StubFilter filters, 283 taskdef element, 18, 36 Styles, XSLT files for, 499–504 Tasks in Ant, 12, 14 sub method built-in, 27–28 in Calc, 396 AntCall, 28 in CalcInterface, 553–554 Copy, 28–29 Subdirectories in JXPath, 158 Delete, 29–30 Subgroups in pattern matching, 310 example, 35–36 submit method, 96 Exec, 30 Subnodes in XPath, 150 Get, 30–31 Subpatterns in regular expressions, 303–305 Jar, 31–32 subst method, 309 Java, 32–33 substitute method, 307 Javac, 33–34 Substitution interface, 307 Javadoc, 34–35 Substitutions in regular expressions, 306–307 creating, 36–41 success.xml file, 547–548 sets of files as arguments for, Successful tests in JMeter, 130 16–21 Pekowsky-138003 book December 8, 2004 19:38

580 Index

teardown method Tildes (∼)intext searches, 334 in Cactus, 108 Time in rolling log files, 247 in JUnit, 78 Time savings from testing, 81 TelnetAppenders, 249–250 time tag, 466 temp directory, 421 timeToString method, 325 template tag, 499 Tlds (tag library descriptors), 422 TemplateProcessor class, 376, 383, 392–393 TO keyword in text searches, 334 Templating spreadsheets, 373–393 todir attribute, 29 Term class, 330 tofile attribute, 29 TermQuery class, 330 toHexString method, 182–183 Test plans in JMeter, 119, 126–127 Tokens testAdditionOK method, 110–111 in searches, 325–326, 339 testCalc method, 555 in templates, 374 TestCase class, 74 TokenStream class, 326 testFact method tokenStream method, 326 in FactTest, 70–71 Tomcat, 5, 417 in FactUnit, 74 authentication in in JUnit, 79 certificate-based, 446–456 testFactNegative method operation of, 429–432 in Factorial, 73 client certificates in, 440–446 in FactUnit, 74–75 clusters for, 463 testGet method, 91 for creating Web applications, 421–428 Testing directories in, 418–421 forms, 102–103 encryption and server validation in, 437–440 with Jakarta Cactus, 105–109 global resources for, 456–461 browser tests with, 111–114 realms in, 432–436 with Eclipse, 114–117 security in, 428–432 summary, 118 starting, 418 writing and running tests in, 109–111 summary, 463 with JMeter. See JMeter tags for, 465 with JUnit. See JUnit class for web-based management and Web sites with HTTPUnit, 89–91 administration, 461–462 ServletRunner with, 99–103 TOMCAT HOME environment variable, 26 summary, 103 tomcat-users.xml file, 420, 433–436, 453, 461 Web-based calculator example, 91–99 Toolkits, 6 testPage method, 89–90 Tools, 1–2 testPage1 method, 94 Torque project, 203 testPage2 method, 96–98 Torvalds, Linus, 3 testStart method, 102 toString method testSubmit method, 102–103 for Excel, 360, 362 Text in SampleBean, 459 regular expressions. See Regular expressions toXML method, 277 searching. See Searches Track class, 136 Text method, 324 TrackConverter class, 142–144 text tag, 519 transaction tag, 492 this keyword, 403–404 transform tag, 501, 503 Threads and thread groups Transformations, XSLT files for, 499–504 in Eclipse, 62 for HTML, 537–539, 543–544 in JMeter, 121–123 for JUnitReport, 85 Pekowsky-138003 book December 8, 2004 19:38

Index 581

transformers tag, 535 ValueGenerator class, 409–411 Trapping events, 96 Values Traversing hierarchical data with JXPath. See in JXPath, 155 JXPath sample, 81–82 Trees Variables APIs for, 133 in Ant, 21–22 BeanUtils for. See BeanUtils in BeanShell Trigger interface, 184 declaring, 401 Triggers in hsqldb, 184–185 in functions, 402–403 tryForm method, 99 in Eclipse, 62–64 tryScript method, 98–99 in Tomcat, 456–457 Turing machines, 298 in web.xml, 426–427 Twips, 372 Vector class, 49 Verisign certificate authority, 437 UnIndexed method, 324 Vertical bars (|)inregular expressions, 300 Unix system and tools, 3, 11 Views Unstructured data in Eclipse, 45, 62–63 regular expressions. See Regular expressions in Model/View/Controller model, 8–9 searching. See Searches VM arguments in Eclipse, 60 update tag, 491 UpdateArtist action, 546 .war files, 422 URLs for bookmarks, 112–113 WARN logging level, 243 usage method WARNING logging level, 230, 232 in Cat, 265 web-app tags, 423 in Egrep, 314 WebApplication dialog, 115–116 for templates, 377, 380 Web applications in WebIndex, 341 creating, 421–428 useBean tag, 469, 472, 478–479, 494 Tomcat for, 417 User class, 455 Web-based calculator, 91–99 User information in certificates, 445 Web-based management and administration, UserDatabaseRealm realm, 433–434, 436, 447 461–462 Usernames in Tomcat, 432, 461 WEB-INF directory, 421–422 Util class, 307 Web pages Valid objects in DBCP, 188 conditional sections in, 480–482 validate flag for ActionServlet, 509 iteration in, 478–480 validate method search indices for, 336–345 in CalculatorForm, 512–513, 515–516, 519 web-resource-collection, 430 in ValidatorForm, 522 Web servers, Tomcat for. See Tomcat Validation Web sites, testing form beans, 520–524 with Cactus. See Cactus forms, 506 with HTTPUnit, 89–91 semantic and syntactic, 507 ServletRunner with, 99–103 server, 437–440 summary, 103 validation.xml file, 520 Web-based calculator example, 91–99 validations.xml file, 522 web.xml file, 419, 421–428 validator-rules.xml file, 520–521 for ActionServlet, 508 ValidatorForm class, 522 for Cocoon, 531–533 ValidatorPlugIn plug-in, 520 for environment variables, 457 value-of tag, 499 for resources, 460 Pekowsky-138003 book December 8, 2004 19:38

582 Index

WebAnalyzer class, 336–337, 339 Writeable interface, 282 webapp directory, 531 Writing to databases, 545–549 webapp plugin, 115 webapps directory, 421 x:choose tag, 498 WebConversation class x:forEach tag, 498 for HTTPUnit, 91 x:if tag, 498 in searches, 345 x:otherwise tags, 498 WebForm class, 95–96 x:out tag, 498–499 WebIndex class, 340–345 x:parse tag, 497–498 WebRequest class, 107–108 x:transform tag, 501, 503 WebResponse class, 345 x:when tag, 498 WebTest1 class, 91 xi namespace, 540 WebTokenizer class, 337, 339 xinclude, 540–541 WebTokenStream class, 337–338 XML (Extensible Markup Language) and XML Welcome files in web.xml, 426 documents when tag, 486–487, 498 in Ant builds, 12, 16 Where clauses, 215 as configuration language, 278–279 White-box testing, 82 formatting, 498–504 WildcardQuery class, 330–331, 334 indexing, 326 withArgName method, 269 for Log4J files, 243 withDescription method, 269 pipelines, 533–535 withLongOpt method, 269 selecting data from, 497–498 Word files tags in, 495–503 with Eclipse, 47 xml package, 497 with POI, 347, 393 XMLFormatter class, 231, 235 WordDocument class, 356 XPath language, 147–150 wordInput patterns, 339 xsl:apply-templates tag, 499–500 wordMatcher patterns, 339 xsl:template tag, 499 wordPatterns patterns, 338 xsl:value-of tag, 499 work directory, 421 XSLT (Extensible Stylesheet Transformation) Workbench in Eclipse, 45 files, 499–504 Writable interface, 279 for HTML, 537–539, 543–544 write method, 282 for JUnitReport, 85 Pekowsky-138003 book December 8, 2004 19:38 Pekowsky-138003 book December 8, 2004 19:38 Pekowsky-138003 book December 8, 2004 19:38 Pekowsky-138003 book December 8, 2004 19:38 Pekowsky-138003 book December 8, 2004 19:38 Pekowsky-138003 book December 8, 2004 19:38