├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── firstcup.xml ├── pom.xml ├── pr_doc_workflow.md ├── release.sh └── src └── main └── jbake ├── assets ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── _config.yml ├── _layouts │ └── default.html ├── assets │ ├── css │ │ ├── print.scss │ │ └── style.scss │ └── images │ │ ├── Oracle-logo.png │ │ ├── header-bkg.jpg │ │ └── logo.png ├── css │ └── style.css ├── img │ ├── firstcup-architecture.gif │ └── oracle.gif └── pr_doc_workflow.md ├── content ├── creating-example.adoc ├── creating-example001.adoc ├── creating-example002.adoc ├── intro.adoc ├── intro001.adoc ├── intro002.adoc ├── java-ee.adoc ├── java-ee001.adoc ├── java-ee002.adoc ├── next-steps.adoc ├── next-steps001.adoc ├── next-steps002.adoc ├── preface.adoc ├── title.adoc ├── toc.adoc ├── web-application.adoc ├── web-application001.adoc ├── web-application002.adoc ├── web-application003.adoc ├── web-application004.adoc ├── web-application005.adoc └── web-application006.adoc ├── jbake.properties └── templates ├── footer.ftl ├── header.ftl ├── menu.ftl └── page.ftl /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | #### :warning:This project is now part of the EE4J initiative. This repository has been archived as all activities are now happening in the [corresponding Eclipse repository](https://github.com/eclipse-ee4j/glassfish-firstcup). See [here](https://www.eclipse.org/ee4j/status.php) for the overall EE4J transition status. 2 | 3 | --- 4 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | ## COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1 5 | 6 | 1. Definitions. 7 | 8 | 1.1. "Contributor" means each individual or entity that creates or 9 | contributes to the creation of Modifications. 10 | 11 | 1.2. "Contributor Version" means the combination of the Original 12 | Software, prior Modifications used by a Contributor (if any), and 13 | the Modifications made by that particular Contributor. 14 | 15 | 1.3. "Covered Software" means (a) the Original Software, or (b) 16 | Modifications, or (c) the combination of files containing Original 17 | Software with files containing Modifications, in each case including 18 | portions thereof. 19 | 20 | 1.4. "Executable" means the Covered Software in any form other than 21 | Source Code. 22 | 23 | 1.5. "Initial Developer" means the individual or entity that first 24 | makes Original Software available under this License. 25 | 26 | 1.6. "Larger Work" means a work which combines Covered Software or 27 | portions thereof with code not governed by the terms of this License. 28 | 29 | 1.7. "License" means this document. 30 | 31 | 1.8. "Licensable" means having the right to grant, to the maximum 32 | extent possible, whether at the time of the initial grant or 33 | subsequently acquired, any and all of the rights conveyed herein. 34 | 35 | 1.9. "Modifications" means the Source Code and Executable form of 36 | any of the following: 37 | 38 | A. Any file that results from an addition to, deletion from or 39 | modification of the contents of a file containing Original Software 40 | or previous Modifications; 41 | 42 | B. Any new file that contains any part of the Original Software or 43 | previous Modification; or 44 | 45 | C. Any new file that is contributed or otherwise made available 46 | under the terms of this License. 47 | 48 | 1.10. "Original Software" means the Source Code and Executable form 49 | of computer software code that is originally released under this 50 | License. 51 | 52 | 1.11. "Patent Claims" means any patent claim(s), now owned or 53 | hereafter acquired, including without limitation, method, process, 54 | and apparatus claims, in any patent Licensable by grantor. 55 | 56 | 1.12. "Source Code" means (a) the common form of computer software 57 | code in which modifications are made and (b) associated 58 | documentation included in or with such code. 59 | 60 | 1.13. "You" (or "Your") means an individual or a legal entity 61 | exercising rights under, and complying with all of the terms of, 62 | this License. For legal entities, "You" includes any entity which 63 | controls, is controlled by, or is under common control with You. For 64 | purposes of this definition, "control" means (a) the power, direct 65 | or indirect, to cause the direction or management of such entity, 66 | whether by contract or otherwise, or (b) ownership of more than 67 | fifty percent (50%) of the outstanding shares or beneficial 68 | ownership of such entity. 69 | 70 | 2. License Grants. 71 | 72 | 2.1. The Initial Developer Grant. 73 | 74 | Conditioned upon Your compliance with Section 3.1 below and subject 75 | to third party intellectual property claims, the Initial Developer 76 | hereby grants You a world-wide, royalty-free, non-exclusive license: 77 | 78 | (a) under intellectual property rights (other than patent or 79 | trademark) Licensable by Initial Developer, to use, reproduce, 80 | modify, display, perform, sublicense and distribute the Original 81 | Software (or portions thereof), with or without Modifications, 82 | and/or as part of a Larger Work; and 83 | 84 | (b) under Patent Claims infringed by the making, using or selling of 85 | Original Software, to make, have made, use, practice, sell, and 86 | offer for sale, and/or otherwise dispose of the Original Software 87 | (or portions thereof). 88 | 89 | (c) The licenses granted in Sections 2.1(a) and (b) are effective on 90 | the date Initial Developer first distributes or otherwise makes the 91 | Original Software available to a third party under the terms of this 92 | License. 93 | 94 | (d) Notwithstanding Section 2.1(b) above, no patent license is 95 | granted: (1) for code that You delete from the Original Software, or 96 | (2) for infringements caused by: (i) the modification of the 97 | Original Software, or (ii) the combination of the Original Software 98 | with other software or devices. 99 | 100 | 2.2. Contributor Grant. 101 | 102 | Conditioned upon Your compliance with Section 3.1 below and subject 103 | to third party intellectual property claims, each Contributor hereby 104 | grants You a world-wide, royalty-free, non-exclusive license: 105 | 106 | (a) under intellectual property rights (other than patent or 107 | trademark) Licensable by Contributor to use, reproduce, modify, 108 | display, perform, sublicense and distribute the Modifications 109 | created by such Contributor (or portions thereof), either on an 110 | unmodified basis, with other Modifications, as Covered Software 111 | and/or as part of a Larger Work; and 112 | 113 | (b) under Patent Claims infringed by the making, using, or selling 114 | of Modifications made by that Contributor either alone and/or in 115 | combination with its Contributor Version (or portions of such 116 | combination), to make, use, sell, offer for sale, have made, and/or 117 | otherwise dispose of: (1) Modifications made by that Contributor (or 118 | portions thereof); and (2) the combination of Modifications made by 119 | that Contributor with its Contributor Version (or portions of such 120 | combination). 121 | 122 | (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective 123 | on the date Contributor first distributes or otherwise makes the 124 | Modifications available to a third party. 125 | 126 | (d) Notwithstanding Section 2.2(b) above, no patent license is 127 | granted: (1) for any code that Contributor has deleted from the 128 | Contributor Version; (2) for infringements caused by: (i) third 129 | party modifications of Contributor Version, or (ii) the combination 130 | of Modifications made by that Contributor with other software 131 | (except as part of the Contributor Version) or other devices; or (3) 132 | under Patent Claims infringed by Covered Software in the absence of 133 | Modifications made by that Contributor. 134 | 135 | 3. Distribution Obligations. 136 | 137 | 3.1. Availability of Source Code. 138 | 139 | Any Covered Software that You distribute or otherwise make available 140 | in Executable form must also be made available in Source Code form 141 | and that Source Code form must be distributed only under the terms 142 | of this License. You must include a copy of this License with every 143 | copy of the Source Code form of the Covered Software You distribute 144 | or otherwise make available. You must inform recipients of any such 145 | Covered Software in Executable form as to how they can obtain such 146 | Covered Software in Source Code form in a reasonable manner on or 147 | through a medium customarily used for software exchange. 148 | 149 | 3.2. Modifications. 150 | 151 | The Modifications that You create or to which You contribute are 152 | governed by the terms of this License. You represent that You 153 | believe Your Modifications are Your original creation(s) and/or You 154 | have sufficient rights to grant the rights conveyed by this License. 155 | 156 | 3.3. Required Notices. 157 | 158 | You must include a notice in each of Your Modifications that 159 | identifies You as the Contributor of the Modification. You may not 160 | remove or alter any copyright, patent or trademark notices contained 161 | within the Covered Software, or any notices of licensing or any 162 | descriptive text giving attribution to any Contributor or the 163 | Initial Developer. 164 | 165 | 3.4. Application of Additional Terms. 166 | 167 | You may not offer or impose any terms on any Covered Software in 168 | Source Code form that alters or restricts the applicable version of 169 | this License or the recipients' rights hereunder. You may choose to 170 | offer, and to charge a fee for, warranty, support, indemnity or 171 | liability obligations to one or more recipients of Covered Software. 172 | However, you may do so only on Your own behalf, and not on behalf of 173 | the Initial Developer or any Contributor. You must make it 174 | absolutely clear that any such warranty, support, indemnity or 175 | liability obligation is offered by You alone, and You hereby agree 176 | to indemnify the Initial Developer and every Contributor for any 177 | liability incurred by the Initial Developer or such Contributor as a 178 | result of warranty, support, indemnity or liability terms You offer. 179 | 180 | 3.5. Distribution of Executable Versions. 181 | 182 | You may distribute the Executable form of the Covered Software under 183 | the terms of this License or under the terms of a license of Your 184 | choice, which may contain terms different from this License, 185 | provided that You are in compliance with the terms of this License 186 | and that the license for the Executable form does not attempt to 187 | limit or alter the recipient's rights in the Source Code form from 188 | the rights set forth in this License. If You distribute the Covered 189 | Software in Executable form under a different license, You must make 190 | it absolutely clear that any terms which differ from this License 191 | are offered by You alone, not by the Initial Developer or 192 | Contributor. You hereby agree to indemnify the Initial Developer and 193 | every Contributor for any liability incurred by the Initial 194 | Developer or such Contributor as a result of any such terms You offer. 195 | 196 | 3.6. Larger Works. 197 | 198 | You may create a Larger Work by combining Covered Software with 199 | other code not governed by the terms of this License and distribute 200 | the Larger Work as a single product. In such a case, You must make 201 | sure the requirements of this License are fulfilled for the Covered 202 | Software. 203 | 204 | 4. Versions of the License. 205 | 206 | 4.1. New Versions. 207 | 208 | Oracle is the initial license steward and may publish revised and/or 209 | new versions of this License from time to time. Each version will be 210 | given a distinguishing version number. Except as provided in Section 211 | 4.3, no one other than the license steward has the right to modify 212 | this License. 213 | 214 | 4.2. Effect of New Versions. 215 | 216 | You may always continue to use, distribute or otherwise make the 217 | Covered Software available under the terms of the version of the 218 | License under which You originally received the Covered Software. If 219 | the Initial Developer includes a notice in the Original Software 220 | prohibiting it from being distributed or otherwise made available 221 | under any subsequent version of the License, You must distribute and 222 | make the Covered Software available under the terms of the version 223 | of the License under which You originally received the Covered 224 | Software. Otherwise, You may also choose to use, distribute or 225 | otherwise make the Covered Software available under the terms of any 226 | subsequent version of the License published by the license steward. 227 | 228 | 4.3. Modified Versions. 229 | 230 | When You are an Initial Developer and You want to create a new 231 | license for Your Original Software, You may create and use a 232 | modified version of this License if You: (a) rename the license and 233 | remove any references to the name of the license steward (except to 234 | note that the license differs from this License); and (b) otherwise 235 | make it clear that the license contains terms which differ from this 236 | License. 237 | 238 | 5. DISCLAIMER OF WARRANTY. 239 | 240 | COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, 241 | WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 242 | INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE 243 | IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR 244 | NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF 245 | THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE 246 | DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY 247 | OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, 248 | REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN 249 | ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS 250 | AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 251 | 252 | 6. TERMINATION. 253 | 254 | 6.1. This License and the rights granted hereunder will terminate 255 | automatically if You fail to comply with terms herein and fail to 256 | cure such breach within 30 days of becoming aware of the breach. 257 | Provisions which, by their nature, must remain in effect beyond the 258 | termination of this License shall survive. 259 | 260 | 6.2. If You assert a patent infringement claim (excluding 261 | declaratory judgment actions) against Initial Developer or a 262 | Contributor (the Initial Developer or Contributor against whom You 263 | assert such claim is referred to as "Participant") alleging that the 264 | Participant Software (meaning the Contributor Version where the 265 | Participant is a Contributor or the Original Software where the 266 | Participant is the Initial Developer) directly or indirectly 267 | infringes any patent, then any and all rights granted directly or 268 | indirectly to You by such Participant, the Initial Developer (if the 269 | Initial Developer is not the Participant) and all Contributors under 270 | Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice 271 | from Participant terminate prospectively and automatically at the 272 | expiration of such 60 day notice period, unless if within such 60 273 | day period You withdraw Your claim with respect to the Participant 274 | Software against such Participant either unilaterally or pursuant to 275 | a written agreement with Participant. 276 | 277 | 6.3. If You assert a patent infringement claim against Participant 278 | alleging that the Participant Software directly or indirectly 279 | infringes any patent where such claim is resolved (such as by 280 | license or settlement) prior to the initiation of patent 281 | infringement litigation, then the reasonable value of the licenses 282 | granted by such Participant under Sections 2.1 or 2.2 shall be taken 283 | into account in determining the amount or value of any payment or 284 | license. 285 | 286 | 6.4. In the event of termination under Sections 6.1 or 6.2 above, 287 | all end user licenses that have been validly granted by You or any 288 | distributor hereunder prior to termination (excluding licenses 289 | granted to You by any distributor) shall survive termination. 290 | 291 | 7. LIMITATION OF LIABILITY. 292 | 293 | UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT 294 | (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE 295 | INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF 296 | COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE 297 | TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR 298 | CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT 299 | LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER 300 | FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR 301 | LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE 302 | POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT 303 | APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH 304 | PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH 305 | LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR 306 | LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION 307 | AND LIMITATION MAY NOT APPLY TO YOU. 308 | 309 | 8. U.S. GOVERNMENT END USERS. 310 | 311 | The Covered Software is a "commercial item," as that term is defined 312 | in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer 313 | software" (as that term is defined at 48 C.F.R. § 314 | 252.227-7014(a)(1)) and "commercial computer software documentation" 315 | as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent 316 | with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 317 | (June 1995), all U.S. Government End Users acquire Covered Software 318 | with only those rights set forth herein. This U.S. Government Rights 319 | clause is in lieu of, and supersedes, any other FAR, DFAR, or other 320 | clause or provision that addresses Government rights in computer 321 | software under this License. 322 | 323 | 9. MISCELLANEOUS. 324 | 325 | This License represents the complete agreement concerning subject 326 | matter hereof. If any provision of this License is held to be 327 | unenforceable, such provision shall be reformed only to the extent 328 | necessary to make it enforceable. This License shall be governed by 329 | the law of the jurisdiction specified in a notice contained within 330 | the Original Software (except to the extent applicable law, if any, 331 | provides otherwise), excluding such jurisdiction's conflict-of-law 332 | provisions. Any litigation relating to this License shall be subject 333 | to the jurisdiction of the courts located in the jurisdiction and 334 | venue specified in a notice contained within the Original Software, 335 | with the losing party responsible for costs, including, without 336 | limitation, court costs and reasonable attorneys' fees and expenses. 337 | The application of the United Nations Convention on Contracts for 338 | the International Sale of Goods is expressly excluded. Any law or 339 | regulation which provides that the language of a contract shall be 340 | construed against the drafter shall not apply to this License. You 341 | agree that You alone are responsible for compliance with the United 342 | States export administration regulations (and the export control 343 | laws and regulation of any other countries) when You use, distribute 344 | or otherwise make available any Covered Software. 345 | 346 | 10. RESPONSIBILITY FOR CLAIMS. 347 | 348 | As between Initial Developer and the Contributors, each party is 349 | responsible for claims and damages arising, directly or indirectly, 350 | out of its utilization of rights under this License and You agree to 351 | work with Initial Developer and Contributors to distribute such 352 | responsibility on an equitable basis. Nothing herein is intended or 353 | shall be deemed to constitute any admission of liability. 354 | 355 | --- 356 | 357 | ## NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 358 | 359 | The code released under the CDDL shall be governed by the laws of the 360 | State of California (excluding conflict-of-law provisions). Any 361 | litigation relating to this License shall be subject to the jurisdiction 362 | of the Federal Courts of the Northern District of California and the 363 | state courts of the State of California, with venue lying in Santa Clara 364 | County, California. 365 | 366 | --- 367 | 368 | ## The GNU General Public License (GPL) Version 2, June 1991 369 | 370 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 371 | 51 Franklin Street, Fifth Floor 372 | Boston, MA 02110-1335 373 | USA 374 | 375 | Everyone is permitted to copy and distribute verbatim copies 376 | of this license document, but changing it is not allowed. 377 | 378 | Preamble 379 | 380 | The licenses for most software are designed to take away your freedom to 381 | share and change it. By contrast, the GNU General Public License is 382 | intended to guarantee your freedom to share and change free software--to 383 | make sure the software is free for all its users. This General Public 384 | License applies to most of the Free Software Foundation's software and 385 | to any other program whose authors commit to using it. (Some other Free 386 | Software Foundation software is covered by the GNU Library General 387 | Public License instead.) You can apply it to your programs, too. 388 | 389 | When we speak of free software, we are referring to freedom, not price. 390 | Our General Public Licenses are designed to make sure that you have the 391 | freedom to distribute copies of free software (and charge for this 392 | service if you wish), that you receive source code or can get it if you 393 | want it, that you can change the software or use pieces of it in new 394 | free programs; and that you know you can do these things. 395 | 396 | To protect your rights, we need to make restrictions that forbid anyone 397 | to deny you these rights or to ask you to surrender the rights. These 398 | restrictions translate to certain responsibilities for you if you 399 | distribute copies of the software, or if you modify it. 400 | 401 | For example, if you distribute copies of such a program, whether gratis 402 | or for a fee, you must give the recipients all the rights that you have. 403 | You must make sure that they, too, receive or can get the source code. 404 | And you must show them these terms so they know their rights. 405 | 406 | We protect your rights with two steps: (1) copyright the software, and 407 | (2) offer you this license which gives you legal permission to copy, 408 | distribute and/or modify the software. 409 | 410 | Also, for each author's protection and ours, we want to make certain 411 | that everyone understands that there is no warranty for this free 412 | software. If the software is modified by someone else and passed on, we 413 | want its recipients to know that what they have is not the original, so 414 | that any problems introduced by others will not reflect on the original 415 | authors' reputations. 416 | 417 | Finally, any free program is threatened constantly by software patents. 418 | We wish to avoid the danger that redistributors of a free program will 419 | individually obtain patent licenses, in effect making the program 420 | proprietary. To prevent this, we have made it clear that any patent must 421 | be licensed for everyone's free use or not licensed at all. 422 | 423 | The precise terms and conditions for copying, distribution and 424 | modification follow. 425 | 426 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 427 | 428 | 0. This License applies to any program or other work which contains a 429 | notice placed by the copyright holder saying it may be distributed under 430 | the terms of this General Public License. The "Program", below, refers 431 | to any such program or work, and a "work based on the Program" means 432 | either the Program or any derivative work under copyright law: that is 433 | to say, a work containing the Program or a portion of it, either 434 | verbatim or with modifications and/or translated into another language. 435 | (Hereinafter, translation is included without limitation in the term 436 | "modification".) Each licensee is addressed as "you". 437 | 438 | Activities other than copying, distribution and modification are not 439 | covered by this License; they are outside its scope. The act of running 440 | the Program is not restricted, and the output from the Program is 441 | covered only if its contents constitute a work based on the Program 442 | (independent of having been made by running the Program). Whether that 443 | is true depends on what the Program does. 444 | 445 | 1. You may copy and distribute verbatim copies of the Program's source 446 | code as you receive it, in any medium, provided that you conspicuously 447 | and appropriately publish on each copy an appropriate copyright notice 448 | and disclaimer of warranty; keep intact all the notices that refer to 449 | this License and to the absence of any warranty; and give any other 450 | recipients of the Program a copy of this License along with the Program. 451 | 452 | You may charge a fee for the physical act of transferring a copy, and 453 | you may at your option offer warranty protection in exchange for a fee. 454 | 455 | 2. You may modify your copy or copies of the Program or any portion of 456 | it, thus forming a work based on the Program, and copy and distribute 457 | such modifications or work under the terms of Section 1 above, provided 458 | that you also meet all of these conditions: 459 | 460 | a) You must cause the modified files to carry prominent notices 461 | stating that you changed the files and the date of any change. 462 | 463 | b) You must cause any work that you distribute or publish, that in 464 | whole or in part contains or is derived from the Program or any part 465 | thereof, to be licensed as a whole at no charge to all third parties 466 | under the terms of this License. 467 | 468 | c) If the modified program normally reads commands interactively 469 | when run, you must cause it, when started running for such 470 | interactive use in the most ordinary way, to print or display an 471 | announcement including an appropriate copyright notice and a notice 472 | that there is no warranty (or else, saying that you provide a 473 | warranty) and that users may redistribute the program under these 474 | conditions, and telling the user how to view a copy of this License. 475 | (Exception: if the Program itself is interactive but does not 476 | normally print such an announcement, your work based on the Program 477 | is not required to print an announcement.) 478 | 479 | These requirements apply to the modified work as a whole. If 480 | identifiable sections of that work are not derived from the Program, and 481 | can be reasonably considered independent and separate works in 482 | themselves, then this License, and its terms, do not apply to those 483 | sections when you distribute them as separate works. But when you 484 | distribute the same sections as part of a whole which is a work based on 485 | the Program, the distribution of the whole must be on the terms of this 486 | License, whose permissions for other licensees extend to the entire 487 | whole, and thus to each and every part regardless of who wrote it. 488 | 489 | Thus, it is not the intent of this section to claim rights or contest 490 | your rights to work written entirely by you; rather, the intent is to 491 | exercise the right to control the distribution of derivative or 492 | collective works based on the Program. 493 | 494 | In addition, mere aggregation of another work not based on the Program 495 | with the Program (or with a work based on the Program) on a volume of a 496 | storage or distribution medium does not bring the other work under the 497 | scope of this License. 498 | 499 | 3. You may copy and distribute the Program (or a work based on it, 500 | under Section 2) in object code or executable form under the terms of 501 | Sections 1 and 2 above provided that you also do one of the following: 502 | 503 | a) Accompany it with the complete corresponding machine-readable 504 | source code, which must be distributed under the terms of Sections 1 505 | and 2 above on a medium customarily used for software interchange; or, 506 | 507 | b) Accompany it with a written offer, valid for at least three 508 | years, to give any third party, for a charge no more than your cost 509 | of physically performing source distribution, a complete 510 | machine-readable copy of the corresponding source code, to be 511 | distributed under the terms of Sections 1 and 2 above on a medium 512 | customarily used for software interchange; or, 513 | 514 | c) Accompany it with the information you received as to the offer to 515 | distribute corresponding source code. (This alternative is allowed 516 | only for noncommercial distribution and only if you received the 517 | program in object code or executable form with such an offer, in 518 | accord with Subsection b above.) 519 | 520 | The source code for a work means the preferred form of the work for 521 | making modifications to it. For an executable work, complete source code 522 | means all the source code for all modules it contains, plus any 523 | associated interface definition files, plus the scripts used to control 524 | compilation and installation of the executable. However, as a special 525 | exception, the source code distributed need not include anything that is 526 | normally distributed (in either source or binary form) with the major 527 | components (compiler, kernel, and so on) of the operating system on 528 | which the executable runs, unless that component itself accompanies the 529 | executable. 530 | 531 | If distribution of executable or object code is made by offering access 532 | to copy from a designated place, then offering equivalent access to copy 533 | the source code from the same place counts as distribution of the source 534 | code, even though third parties are not compelled to copy the source 535 | along with the object code. 536 | 537 | 4. You may not copy, modify, sublicense, or distribute the Program 538 | except as expressly provided under this License. Any attempt otherwise 539 | to copy, modify, sublicense or distribute the Program is void, and will 540 | automatically terminate your rights under this License. However, parties 541 | who have received copies, or rights, from you under this License will 542 | not have their licenses terminated so long as such parties remain in 543 | full compliance. 544 | 545 | 5. You are not required to accept this License, since you have not 546 | signed it. However, nothing else grants you permission to modify or 547 | distribute the Program or its derivative works. These actions are 548 | prohibited by law if you do not accept this License. Therefore, by 549 | modifying or distributing the Program (or any work based on the 550 | Program), you indicate your acceptance of this License to do so, and all 551 | its terms and conditions for copying, distributing or modifying the 552 | Program or works based on it. 553 | 554 | 6. Each time you redistribute the Program (or any work based on the 555 | Program), the recipient automatically receives a license from the 556 | original licensor to copy, distribute or modify the Program subject to 557 | these terms and conditions. You may not impose any further restrictions 558 | on the recipients' exercise of the rights granted herein. You are not 559 | responsible for enforcing compliance by third parties to this License. 560 | 561 | 7. If, as a consequence of a court judgment or allegation of patent 562 | infringement or for any other reason (not limited to patent issues), 563 | conditions are imposed on you (whether by court order, agreement or 564 | otherwise) that contradict the conditions of this License, they do not 565 | excuse you from the conditions of this License. If you cannot distribute 566 | so as to satisfy simultaneously your obligations under this License and 567 | any other pertinent obligations, then as a consequence you may not 568 | distribute the Program at all. For example, if a patent license would 569 | not permit royalty-free redistribution of the Program by all those who 570 | receive copies directly or indirectly through you, then the only way you 571 | could satisfy both it and this License would be to refrain entirely from 572 | distribution of the Program. 573 | 574 | If any portion of this section is held invalid or unenforceable under 575 | any particular circumstance, the balance of the section is intended to 576 | apply and the section as a whole is intended to apply in other 577 | circumstances. 578 | 579 | It is not the purpose of this section to induce you to infringe any 580 | patents or other property right claims or to contest validity of any 581 | such claims; this section has the sole purpose of protecting the 582 | integrity of the free software distribution system, which is implemented 583 | by public license practices. Many people have made generous 584 | contributions to the wide range of software distributed through that 585 | system in reliance on consistent application of that system; it is up to 586 | the author/donor to decide if he or she is willing to distribute 587 | software through any other system and a licensee cannot impose that choice. 588 | 589 | This section is intended to make thoroughly clear what is believed to be 590 | a consequence of the rest of this License. 591 | 592 | 8. If the distribution and/or use of the Program is restricted in 593 | certain countries either by patents or by copyrighted interfaces, the 594 | original copyright holder who places the Program under this License may 595 | add an explicit geographical distribution limitation excluding those 596 | countries, so that distribution is permitted only in or among countries 597 | not thus excluded. In such case, this License incorporates the 598 | limitation as if written in the body of this License. 599 | 600 | 9. The Free Software Foundation may publish revised and/or new 601 | versions of the General Public License from time to time. Such new 602 | versions will be similar in spirit to the present version, but may 603 | differ in detail to address new problems or concerns. 604 | 605 | Each version is given a distinguishing version number. If the Program 606 | specifies a version number of this License which applies to it and "any 607 | later version", you have the option of following the terms and 608 | conditions either of that version or of any later version published by 609 | the Free Software Foundation. If the Program does not specify a version 610 | number of this License, you may choose any version ever published by the 611 | Free Software Foundation. 612 | 613 | 10. If you wish to incorporate parts of the Program into other free 614 | programs whose distribution conditions are different, write to the 615 | author to ask for permission. For software which is copyrighted by the 616 | Free Software Foundation, write to the Free Software Foundation; we 617 | sometimes make exceptions for this. Our decision will be guided by the 618 | two goals of preserving the free status of all derivatives of our free 619 | software and of promoting the sharing and reuse of software generally. 620 | 621 | NO WARRANTY 622 | 623 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO 624 | WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 625 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 626 | OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, 627 | EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 628 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE 629 | ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH 630 | YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL 631 | NECESSARY SERVICING, REPAIR OR CORRECTION. 632 | 633 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 634 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 635 | AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR 636 | DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL 637 | DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM 638 | (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED 639 | INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF 640 | THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR 641 | OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 642 | 643 | END OF TERMS AND CONDITIONS 644 | 645 | How to Apply These Terms to Your New Programs 646 | 647 | If you develop a new program, and you want it to be of the greatest 648 | possible use to the public, the best way to achieve this is to make it 649 | free software which everyone can redistribute and change under these terms. 650 | 651 | To do so, attach the following notices to the program. It is safest to 652 | attach them to the start of each source file to most effectively convey 653 | the exclusion of warranty; and each file should have at least the 654 | "copyright" line and a pointer to where the full notice is found. 655 | 656 | One line to give the program's name and a brief idea of what it does. 657 | Copyright (C) 658 | 659 | This program is free software; you can redistribute it and/or modify 660 | it under the terms of the GNU General Public License as published by 661 | the Free Software Foundation; either version 2 of the License, or 662 | (at your option) any later version. 663 | 664 | This program is distributed in the hope that it will be useful, but 665 | WITHOUT ANY WARRANTY; without even the implied warranty of 666 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 667 | General Public License for more details. 668 | 669 | You should have received a copy of the GNU General Public License 670 | along with this program; if not, write to the Free Software 671 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA 672 | 673 | Also add information on how to contact you by electronic and paper mail. 674 | 675 | If the program is interactive, make it output a short notice like this 676 | when it starts in an interactive mode: 677 | 678 | Gnomovision version 69, Copyright (C) year name of author 679 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type 680 | `show w'. This is free software, and you are welcome to redistribute 681 | it under certain conditions; type `show c' for details. 682 | 683 | The hypothetical commands `show w' and `show c' should show the 684 | appropriate parts of the General Public License. Of course, the commands 685 | you use may be called something other than `show w' and `show c'; they 686 | could even be mouse-clicks or menu items--whatever suits your program. 687 | 688 | You should also get your employer (if you work as a programmer) or your 689 | school, if any, to sign a "copyright disclaimer" for the program, if 690 | necessary. Here is a sample; alter the names: 691 | 692 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 693 | program `Gnomovision' (which makes passes at compilers) written by 694 | James Hacker. 695 | 696 | signature of Ty Coon, 1 April 1989 697 | Ty Coon, President of Vice 698 | 699 | This General Public License does not permit incorporating your program 700 | into proprietary programs. If your program is a subroutine library, you 701 | may consider it more useful to permit linking proprietary applications 702 | with the library. If this is what you want to do, use the GNU Library 703 | General Public License instead of this License. 704 | 705 | --- 706 | 707 | Certain source files distributed by Oracle America, Inc. and/or its 708 | affiliates are subject to the following clarification and special 709 | exception to the GPLv2, based on the GNU Project exception for its 710 | Classpath libraries, known as the GNU Classpath Exception, but only 711 | where Oracle has expressly included in the particular source file's 712 | header the words "Oracle designates this particular file as subject to 713 | the "Classpath" exception as provided by Oracle in the LICENSE file 714 | that accompanied this code." 715 | 716 | You should also note that Oracle includes multiple, independent 717 | programs in this software package. Some of those programs are provided 718 | under licenses deemed incompatible with the GPLv2 by the Free Software 719 | Foundation and others. For example, the package includes programs 720 | licensed under the Apache License, Version 2.0. Such programs are 721 | licensed to you under their original licenses. 722 | 723 | Oracle facilitates your further distribution of this package by adding 724 | the Classpath Exception to the necessary parts of its GPLv2 code, which 725 | permits you to use that code in combination with other independent 726 | modules not licensed under the GPLv2. However, note that this would 727 | not permit you to commingle code under an incompatible license with 728 | Oracle's GPLv2 licensed code by, for example, cutting and pasting such 729 | code into a file also containing Oracle's GPLv2 licensed code and then 730 | distributing the result. Additionally, if you were to remove the 731 | Classpath Exception from any of the files to which it applies and 732 | distribute the result, you would likely be required to license some or 733 | all of the other code in that distribution under the GPLv2 as well, and 734 | since the GPLv2 is incompatible with the license terms of some items 735 | included in the distribution by Oracle, removing the Classpath 736 | Exception could therefore effectively compromise your ability to 737 | further distribute the package. 738 | 739 | Proceed with caution and we recommend that you obtain the advice of a 740 | lawyer skilled in open source matters before removing the Classpath 741 | Exception or making modifications to this package which may 742 | subsequently be redistributed and/or involve the use of third party 743 | software. 744 | 745 | CLASSPATH EXCEPTION 746 | Linking this library statically or dynamically with other modules is 747 | making a combined work based on this library. Thus, the terms and 748 | conditions of the GNU General Public License version 2 cover the whole 749 | combination. 750 | 751 | As a special exception, the copyright holders of this library give you 752 | permission to link this library with independent modules to produce an 753 | executable, regardless of the license terms of these independent 754 | modules, and to copy and distribute the resulting executable under 755 | terms of your choice, provided that you also meet, for each linked 756 | independent module, the terms and conditions of the license of that 757 | module. An independent module is a module which is not derived from or 758 | based on this library. If you modify this library, you may extend this 759 | exception to your version of the library, but you are not obligated to 760 | do so. If you do not wish to do so, delete this exception statement 761 | from your version. 762 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #### :warning:This project is now part of the EE4J initiative. This repository has been archived as all activities are now happening in the [corresponding Eclipse repository](https://github.com/eclipse-ee4j/glassfish-firstcup). See [here](https://www.eclipse.org/ee4j/status.php) for the overall EE4J transition status. 2 | 3 | --- 4 | # First Cup of Java EE Tutorial 5 | 6 | This repository contains the source files that are used to build the [_Java Platform, Enterprise Edition (Java EE) 8 7 | Your First Cup: An Introduction to the Java EE Platform_](https://javaee.github.io/tutorial/). The source files are 8 | authored in [AsciiDoc](http://asciidoc.org/). AsciiDoc is similar to original markdown but is particularly suited for 9 | user documentation. This project also uses [JBake](http://jbake.org/). JBake is a static site generator that is 10 | inspired from Jekyll and written in Java. JBake uses templates for the structure of the page and the body of the 11 | page is generated from AsciiDoc content. 12 | 13 | Note that the First Cup Tutorial code examples are located in the 14 | [javaee/firstcup-examples](https://github.com/javaee/firstcup-examples) repository. 15 | 16 | ## Contributing 17 | The easiest way to contribute is by opening an [issue](https://github.com/javaee/firstcup/issues) that contains 18 | feedback and review comments. All issues will be addressed as soon as possible. 19 | 20 | The First Cup Tutorial project is also open for contributions and your help is greatly appreciated. If you have an idea 21 | for the tutorial and want to add a section or update an existing section, then review the following links: 22 | 23 | * [Contribute](CONTRIBUTING.md) 24 | * [Pull Request Acceptance Workflow](pr_doc_workflow.md) 25 | * [License](LICENSE.md) 26 | 27 | ## Building the First Cup Tutorial 28 | 29 | The following directions explain how to do local builds of the tutorial. Note that any changes that are pushed to the 30 | master branch automatically trigger a build of the site files and tutorial sources. The results are automatically 31 | pushed to the gh-pages branch. You can view the published site at https://javaee.github.io/firstcup/. 32 | 33 | ### Pre-Requisites 34 | 35 | - Maven 36 | - JDK8+ 37 | 38 | Note that manually deploying the site requires password-less authentication. This is done by exporting your SSH public 39 | key into your GitHub account. 40 | 41 | ### Build the Site Locally 42 | 43 | The site is generated under `target/staging`. Open `file:///PATH_TO_PROJECT_DIR/target/staging` in a browser to view 44 | the output. 45 | 46 | ``` 47 | mvn generate-resources 48 | ``` 49 | 50 | You can also invoke the JBake plugin directly: 51 | 52 | ``` 53 | mvn jbake:build 54 | ``` 55 | 56 | #### Rebuild the Site on Changes 57 | 58 | The following command builds the site and, if kept running, detects changes to the sources and incrementally renders 59 | the site. This is convenient when writing content. 60 | 61 | ``` 62 | mvn jbake:watch 63 | ``` 64 | 65 | #### Serve the Site locally 66 | 67 | If a web server is required (for example, absolute paths are used), you can use the following command to start a 68 | Jetty web server at `http://localhost:8820`. The command also watches for changes and rebuilds incrementally. 69 | 70 | ``` 71 | mvn jbake:serve 72 | ``` 73 | 74 | 75 | ### Deploy the Site to Github Pages 76 | 77 | If you want to manually push a build to the gh-pages branch, use: 78 | 79 | ``` 80 | mvn deploy -Ppublish-site 81 | ``` 82 | 83 | ### Produce a Zip File for Download 84 | 85 | To produce a zip file containing the generated HTML files, use: 86 | 87 | ``` 88 | mvn package 89 | ``` 90 | 91 | When making a release on GitHub, this zip file should be added to the release. 92 | 93 | ## Links 94 | 95 | - [JBake maven plugin documentation](https://github.com/Blazebit/jbake-maven-plugin) 96 | - [JBake documentation](http://jbake.org/docs/2.5.1) 97 | - [Freemarker documentation](http://freemarker.org/docs) 98 | - [AsciiDoc User Guide](http://asciidoc.org/userguide.html) 99 | - [Asciidoctor quick reference](http://asciidoctor.org/docs/asciidoc-syntax-quick-reference) 100 | -------------------------------------------------------------------------------- /firstcup.xml: -------------------------------------------------------------------------------- 1 | 2 | 43 | 44 | 45 | firstcup 46 | 47 | zip 48 | 49 | firstcup 50 | 51 | 52 | target/staging 53 | doc 54 | 55 | _config.yml 56 | _layouts/** 57 | assets/** 58 | *.md 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 43 | 44 | 4.0.0 45 | 46 | net.java 47 | jvnet-parent 48 | 5 49 | 50 | org.glassfish.docs 51 | firstcup 52 | pom 53 | 8.1-SNAPSHOT 54 | First Cup of Java EE Tutorial 55 | 56 | 57 | ${project.build.directory}/staging 58 | true 59 | 60 | 61 | scm:git:git@github.com:javaee/firstcup.git 62 | scm:git:git@github.com:javaee/firstcup.git 63 | https://github.com/javaee/firstcup 64 | HEAD 65 | 66 | 67 | 68 | scm:git:git@github.com:javaee/firstcup.git 69 | 70 | 71 | 72 | package 73 | 74 | 75 | org.apache.maven.plugins 76 | maven-enforcer-plugin 77 | 1.4.1 78 | 79 | 80 | enforce-versions 81 | 82 | enforce 83 | 84 | 85 | 86 | 87 | [1.8.0,1.9.0) 88 | You need JDK8 or lower 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | com.blazebit 97 | jbake-maven-plugin 98 | 1.0.0 99 | 100 | ${site.output.dir} 101 | 102 | 103 | 104 | build-site 105 | generate-resources 106 | 107 | build 108 | 109 | 110 | 111 | 112 | 113 | org.asciidoctor 114 | asciidoctorj 115 | 1.5.5 116 | 117 | 118 | org.asciidoctor 119 | asciidoctorj-diagram 120 | 1.5.4 121 | 122 | 123 | 124 | 125 | org.apache.maven.plugins 126 | maven-release-plugin 127 | 2.5.2 128 | 129 | forked-path 130 | false 131 | ${release.arguments} 132 | 133 | 134 | 135 | org.apache.maven.scm 136 | maven-scm-provider-gitexe 137 | 1.9.4 138 | 139 | 140 | 141 | 142 | 145 | 146 | maven-assembly-plugin 147 | false 148 | 149 | 150 | package 151 | 152 | single 153 | 154 | 155 | 156 | firstcup.xml 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | org.apache.maven.plugins 168 | maven-assembly-plugin 169 | 2.4 170 | 171 | 172 | 173 | 174 | 175 | 176 | publish-site 177 | 178 | ${project.build.directory}/staging 179 | true 180 | true 181 | 182 | 183 | 184 | 185 | org.apache.maven.plugins 186 | maven-scm-publish-plugin 187 | 1.1 188 | 189 | 190 | deploy-site 191 | deploy 192 | 193 | publish-scm 194 | 195 | 196 | gh-pages 197 | false 198 | Update site 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | -------------------------------------------------------------------------------- /pr_doc_workflow.md: -------------------------------------------------------------------------------- 1 | # Documentation Pull Request Acceptance Workflow 2 | 3 | ## Prerequisite 4 | To contribute to the documentation, you first need to sign the 5 | [Oracle Contributor Agreement](http://www.oracle.com/technetwork/community/oca-486395.html). 6 | When filling the OCA make sure to include your GitHub username. If you signed the OCA previously and your GitHub 7 | username wasn't included, just ping [David Delabassee](mailto:david.delabassee(@)oracle.com) to fix this. 8 | Once your OCA has been approved, you'll be able to work directly with the respective project/module owners or 9 | reviewers to get your Pull Request reviewed and approved. The OCA process doesn't apply to Oracle employees. 10 | 11 | ## One Time Setup 12 | * [Fork](https://help.github.com/articles/fork-a-repo/) the [firstcup](https://github.com/javaee/firstcup/) repository. 13 | * [Clone](https://help.github.com/articles/cloning-a-repository/) your forked repository. 14 | ``` 15 | $ git clone https://github.com/javaee/firstcup.git 16 | ``` 17 | * [Configure](https://help.github.com/articles/configuring-a-remote-for-a-fork/) the remote for your fork. 18 | ``` 19 | $ git remote add upstream https://github.com/javaee/firstcup.git 20 | $ git remote -v 21 | origin https://github.com/your-githubid/firstcup.git (fetch) 22 | origin https://github.com/your-githubid/firstcup.git (push) 23 | upstream https://github.com/javaee/firstcup.git (fetch) 24 | upstream https://github.com/javaee/firstcup.git (push) 25 | ``` 26 | ## Raising a Pull Request 27 | * Sync the master of your fork with upstream master. 28 | ``` 29 | $ git fetch upstream 30 | $ git checkout master 31 | $ git merge upstream/master 32 | $ git push origin master #push local master to github fork. 33 | ``` 34 | * Create a local topic branch in your fork from your master. 35 | ``` 36 | $ git checkout -b doc_update 37 | ``` 38 | * Do the development in your branch. 39 | * Commit all the changes. 40 | ``` 41 | $ git add src/main/jbake/content/my.adoc 42 | $ git commit -m "my commit message" 43 | ``` 44 | * Push your changes in a remote branch of your fork. 45 | ``` 46 | $ git push origin doc_update 47 | ``` 48 | * Before raising a Pull Request, please raise an [issue](https://github.com/javaee/firstcup/issues) if it doesn't 49 | exist. We would like every Pull Request to be associated with an issue. Submit the Pull Request referring to the issue 50 | number. 51 | * Raise a [Pull Request](https://github.com/javaee/firstcup/pulls). 52 | * Make sure you put a proper 'title' for the Pull Request. The title of the Pull Request would become the commit 53 | message. Instead of giving 'title' like "Iss xxxx" or "Fixes #xxxxx", consider giving a proper one line 'title' for 54 | the Pull Request like "Fixes xxx : " 55 | * In the Pull Request description (body), please mention "Fixes #xxxxx" in order to link the Pull Request with the 56 | Issue you are fixing. 57 | * If you have signed the OCA, one of the GlassFish team members will review your Pull Request. If you have not signed 58 | an OCA, see [Prerequisite](#pre). 59 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 4 | # 5 | # Copyright (c) 2010-2013 Oracle and/or its affiliates. All rights reserved. 6 | # 7 | # The contents of this file are subject to the terms of either the GNU 8 | # General Public License Version 2 only ("GPL") or the Common Development 9 | # and Distribution License("CDDL") (collectively, the "License"). You 10 | # may not use this file except in compliance with the License. You can 11 | # obtain a copy of the License at 12 | # https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html 13 | # or packager/legal/LICENSE.txt. See the License for the specific 14 | # language governing permissions and limitations under the License. 15 | # 16 | # When distributing the software, include this License Header Notice in each 17 | # file and include the License file at packager/legal/LICENSE.txt. 18 | # 19 | # GPL Classpath Exception: 20 | # Oracle designates this particular file as subject to the "Classpath" 21 | # exception as provided by Oracle in the GPL Version 2 section of the License 22 | # file that accompanied this code. 23 | # 24 | # Modifications: 25 | # If applicable, add the following below the License Header, with the fields 26 | # enclosed by brackets [] replaced by your own identifying information: 27 | # "Portions Copyright [year] [name of copyright owner]" 28 | # 29 | # Contributor(s): 30 | # If you wish your version of this file to be governed by only the CDDL or 31 | # only the GPL Version 2, indicate your decision by adding "[Contributor] 32 | # elects to include this software in this distribution under the [CDDL or GPL 33 | # Version 2] license." If you don't indicate a single choice of license, a 34 | # recipient has the option to distribute your version of this file under 35 | # either the CDDL, the GPL Version 2 or to extend the choice of license to 36 | # its licensees as provided above. However, if you add GPL Version 2 code 37 | # and therefore, elected the GPL Version 2 license, then the option applies 38 | # only if the new code is made subject to such option by the copyright 39 | # holder. 40 | # 41 | 42 | #------------------------------------------------------ 43 | #-- BE SURE TO HAVE THE FOLLOWING IN YOUR SETTINGS.XML 44 | #------------------------------------------------------ 45 | # 46 | # 47 | # 48 | # jvnet-nexus-staging 49 | # jvnet_id 50 | # password 51 | # 52 | # 53 | # website.java.net 54 | # jvnet 55 | # password 56 | # 57 | # 58 | # 59 | # 60 | # release 61 | # 62 | # jvnet_id 63 | # -Dhttps.proxyHost=www-proxy.us.oracle.com -Dhttps.proxyPort=80 -Dgpg.passphrase=glassfish 64 | # 65 | # 66 | # false 67 | # 68 | # 69 | # 70 | 71 | # see the following URL for gpg issues 72 | # https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven#HowToGeneratePGPSignaturesWithMaven-GenerateaKeyPair 73 | 74 | # login to nexus at maven.java.net, using your jvnet crendentials, and release (Close) the artifact 75 | # https://maven.java.net/index.html#stagingRepositories 76 | 77 | # More information: 78 | # https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8.ReleaseIt 79 | # http://aseng-wiki.us.oracle.com/asengwiki/display/GlassFish/Migrating+Maven+deployment+to+maven.java.net 80 | 81 | # Note: the release process may use ssh key to interact with the SCM. If so, it will use your user.name as define in the release profile of your settings.xml. 82 | # Be sure to have your ssh public key exported in your java.net account. 83 | 84 | ARGS=" $*" 85 | # everything supplied as argument will be provided to every maven command. 86 | # e.g to supply -Dmaven.skip.test or -Dmaven.repo.local=/path/to/repo 87 | 88 | mvn -B -e release:prepare -DpreparationGoals="'install' $ARGS" $ARGS -Pjvnet-release,release 89 | mvn -B -e release:perform -Dgoals="'deploy' $ARGS" $ARGS -Pjvnet-release,release 90 | -------------------------------------------------------------------------------- /src/main/jbake/assets/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | --- 4 | 5 | # Source Code Submissions 6 | We welcome your contributions and look forward to collaborating with you. We can only accept source code repository 7 | submissions from users who have signed and returned the Oracle 8 | Contributor Agreement. You will find details and the agreement to sign at this OTN web page: 9 | [Oracle Contributor Agreement](http://www.oracle.com/technetwork/community/oca-486395.html). 10 | 11 | # Other Contributions 12 | For all project Submissions other than source code repository contributions, the following also applies: Oracle does 13 | not claim ownership of Your Submissions. However, in order to fulfill 14 | the purposes of this project, You must give Oracle and all Users 15 | the right to post, access, discuss, use, publish, disseminate, and refine 16 | Your Submissions. 17 | 18 | In legalese: *You hereby grant to Oracle and all 19 | Users a royalty-free, perpetual, irrevocable, worldwide, non-exclusive, 20 | and fully sub-licensable right and license, under Your intellectual 21 | property rights, to reproduce, modify, adapt, publish, translate, create 22 | derivative works from, distribute, perform, display, and use Your 23 | Submissions (in whole or part) and to incorporate or implement them in 24 | other works in any form, media, or technology now known or later 25 | developed, all subject to the obligation to retain any copyright notices 26 | included in Your Submissions. All Users, Oracle, and their 27 | sublicensees are responsible for any modifications they make to the 28 | Submissions of others.* 29 | 30 | Copyright © 2017 Oracle and/or its affiliates. All rights reserved. 31 | -------------------------------------------------------------------------------- /src/main/jbake/assets/LICENSE.md: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | ## COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1 5 | 6 | 1. Definitions. 7 | 8 | 1.1. "Contributor" means each individual or entity that creates or 9 | contributes to the creation of Modifications. 10 | 11 | 1.2. "Contributor Version" means the combination of the Original 12 | Software, prior Modifications used by a Contributor (if any), and 13 | the Modifications made by that particular Contributor. 14 | 15 | 1.3. "Covered Software" means (a) the Original Software, or (b) 16 | Modifications, or (c) the combination of files containing Original 17 | Software with files containing Modifications, in each case including 18 | portions thereof. 19 | 20 | 1.4. "Executable" means the Covered Software in any form other than 21 | Source Code. 22 | 23 | 1.5. "Initial Developer" means the individual or entity that first 24 | makes Original Software available under this License. 25 | 26 | 1.6. "Larger Work" means a work which combines Covered Software or 27 | portions thereof with code not governed by the terms of this License. 28 | 29 | 1.7. "License" means this document. 30 | 31 | 1.8. "Licensable" means having the right to grant, to the maximum 32 | extent possible, whether at the time of the initial grant or 33 | subsequently acquired, any and all of the rights conveyed herein. 34 | 35 | 1.9. "Modifications" means the Source Code and Executable form of 36 | any of the following: 37 | 38 | A. Any file that results from an addition to, deletion from or 39 | modification of the contents of a file containing Original Software 40 | or previous Modifications; 41 | 42 | B. Any new file that contains any part of the Original Software or 43 | previous Modification; or 44 | 45 | C. Any new file that is contributed or otherwise made available 46 | under the terms of this License. 47 | 48 | 1.10. "Original Software" means the Source Code and Executable form 49 | of computer software code that is originally released under this 50 | License. 51 | 52 | 1.11. "Patent Claims" means any patent claim(s), now owned or 53 | hereafter acquired, including without limitation, method, process, 54 | and apparatus claims, in any patent Licensable by grantor. 55 | 56 | 1.12. "Source Code" means (a) the common form of computer software 57 | code in which modifications are made and (b) associated 58 | documentation included in or with such code. 59 | 60 | 1.13. "You" (or "Your") means an individual or a legal entity 61 | exercising rights under, and complying with all of the terms of, 62 | this License. For legal entities, "You" includes any entity which 63 | controls, is controlled by, or is under common control with You. For 64 | purposes of this definition, "control" means (a) the power, direct 65 | or indirect, to cause the direction or management of such entity, 66 | whether by contract or otherwise, or (b) ownership of more than 67 | fifty percent (50%) of the outstanding shares or beneficial 68 | ownership of such entity. 69 | 70 | 2. License Grants. 71 | 72 | 2.1. The Initial Developer Grant. 73 | 74 | Conditioned upon Your compliance with Section 3.1 below and subject 75 | to third party intellectual property claims, the Initial Developer 76 | hereby grants You a world-wide, royalty-free, non-exclusive license: 77 | 78 | (a) under intellectual property rights (other than patent or 79 | trademark) Licensable by Initial Developer, to use, reproduce, 80 | modify, display, perform, sublicense and distribute the Original 81 | Software (or portions thereof), with or without Modifications, 82 | and/or as part of a Larger Work; and 83 | 84 | (b) under Patent Claims infringed by the making, using or selling of 85 | Original Software, to make, have made, use, practice, sell, and 86 | offer for sale, and/or otherwise dispose of the Original Software 87 | (or portions thereof). 88 | 89 | (c) The licenses granted in Sections 2.1(a) and (b) are effective on 90 | the date Initial Developer first distributes or otherwise makes the 91 | Original Software available to a third party under the terms of this 92 | License. 93 | 94 | (d) Notwithstanding Section 2.1(b) above, no patent license is 95 | granted: (1) for code that You delete from the Original Software, or 96 | (2) for infringements caused by: (i) the modification of the 97 | Original Software, or (ii) the combination of the Original Software 98 | with other software or devices. 99 | 100 | 2.2. Contributor Grant. 101 | 102 | Conditioned upon Your compliance with Section 3.1 below and subject 103 | to third party intellectual property claims, each Contributor hereby 104 | grants You a world-wide, royalty-free, non-exclusive license: 105 | 106 | (a) under intellectual property rights (other than patent or 107 | trademark) Licensable by Contributor to use, reproduce, modify, 108 | display, perform, sublicense and distribute the Modifications 109 | created by such Contributor (or portions thereof), either on an 110 | unmodified basis, with other Modifications, as Covered Software 111 | and/or as part of a Larger Work; and 112 | 113 | (b) under Patent Claims infringed by the making, using, or selling 114 | of Modifications made by that Contributor either alone and/or in 115 | combination with its Contributor Version (or portions of such 116 | combination), to make, use, sell, offer for sale, have made, and/or 117 | otherwise dispose of: (1) Modifications made by that Contributor (or 118 | portions thereof); and (2) the combination of Modifications made by 119 | that Contributor with its Contributor Version (or portions of such 120 | combination). 121 | 122 | (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective 123 | on the date Contributor first distributes or otherwise makes the 124 | Modifications available to a third party. 125 | 126 | (d) Notwithstanding Section 2.2(b) above, no patent license is 127 | granted: (1) for any code that Contributor has deleted from the 128 | Contributor Version; (2) for infringements caused by: (i) third 129 | party modifications of Contributor Version, or (ii) the combination 130 | of Modifications made by that Contributor with other software 131 | (except as part of the Contributor Version) or other devices; or (3) 132 | under Patent Claims infringed by Covered Software in the absence of 133 | Modifications made by that Contributor. 134 | 135 | 3. Distribution Obligations. 136 | 137 | 3.1. Availability of Source Code. 138 | 139 | Any Covered Software that You distribute or otherwise make available 140 | in Executable form must also be made available in Source Code form 141 | and that Source Code form must be distributed only under the terms 142 | of this License. You must include a copy of this License with every 143 | copy of the Source Code form of the Covered Software You distribute 144 | or otherwise make available. You must inform recipients of any such 145 | Covered Software in Executable form as to how they can obtain such 146 | Covered Software in Source Code form in a reasonable manner on or 147 | through a medium customarily used for software exchange. 148 | 149 | 3.2. Modifications. 150 | 151 | The Modifications that You create or to which You contribute are 152 | governed by the terms of this License. You represent that You 153 | believe Your Modifications are Your original creation(s) and/or You 154 | have sufficient rights to grant the rights conveyed by this License. 155 | 156 | 3.3. Required Notices. 157 | 158 | You must include a notice in each of Your Modifications that 159 | identifies You as the Contributor of the Modification. You may not 160 | remove or alter any copyright, patent or trademark notices contained 161 | within the Covered Software, or any notices of licensing or any 162 | descriptive text giving attribution to any Contributor or the 163 | Initial Developer. 164 | 165 | 3.4. Application of Additional Terms. 166 | 167 | You may not offer or impose any terms on any Covered Software in 168 | Source Code form that alters or restricts the applicable version of 169 | this License or the recipients' rights hereunder. You may choose to 170 | offer, and to charge a fee for, warranty, support, indemnity or 171 | liability obligations to one or more recipients of Covered Software. 172 | However, you may do so only on Your own behalf, and not on behalf of 173 | the Initial Developer or any Contributor. You must make it 174 | absolutely clear that any such warranty, support, indemnity or 175 | liability obligation is offered by You alone, and You hereby agree 176 | to indemnify the Initial Developer and every Contributor for any 177 | liability incurred by the Initial Developer or such Contributor as a 178 | result of warranty, support, indemnity or liability terms You offer. 179 | 180 | 3.5. Distribution of Executable Versions. 181 | 182 | You may distribute the Executable form of the Covered Software under 183 | the terms of this License or under the terms of a license of Your 184 | choice, which may contain terms different from this License, 185 | provided that You are in compliance with the terms of this License 186 | and that the license for the Executable form does not attempt to 187 | limit or alter the recipient's rights in the Source Code form from 188 | the rights set forth in this License. If You distribute the Covered 189 | Software in Executable form under a different license, You must make 190 | it absolutely clear that any terms which differ from this License 191 | are offered by You alone, not by the Initial Developer or 192 | Contributor. You hereby agree to indemnify the Initial Developer and 193 | every Contributor for any liability incurred by the Initial 194 | Developer or such Contributor as a result of any such terms You offer. 195 | 196 | 3.6. Larger Works. 197 | 198 | You may create a Larger Work by combining Covered Software with 199 | other code not governed by the terms of this License and distribute 200 | the Larger Work as a single product. In such a case, You must make 201 | sure the requirements of this License are fulfilled for the Covered 202 | Software. 203 | 204 | 4. Versions of the License. 205 | 206 | 4.1. New Versions. 207 | 208 | Oracle is the initial license steward and may publish revised and/or 209 | new versions of this License from time to time. Each version will be 210 | given a distinguishing version number. Except as provided in Section 211 | 4.3, no one other than the license steward has the right to modify 212 | this License. 213 | 214 | 4.2. Effect of New Versions. 215 | 216 | You may always continue to use, distribute or otherwise make the 217 | Covered Software available under the terms of the version of the 218 | License under which You originally received the Covered Software. If 219 | the Initial Developer includes a notice in the Original Software 220 | prohibiting it from being distributed or otherwise made available 221 | under any subsequent version of the License, You must distribute and 222 | make the Covered Software available under the terms of the version 223 | of the License under which You originally received the Covered 224 | Software. Otherwise, You may also choose to use, distribute or 225 | otherwise make the Covered Software available under the terms of any 226 | subsequent version of the License published by the license steward. 227 | 228 | 4.3. Modified Versions. 229 | 230 | When You are an Initial Developer and You want to create a new 231 | license for Your Original Software, You may create and use a 232 | modified version of this License if You: (a) rename the license and 233 | remove any references to the name of the license steward (except to 234 | note that the license differs from this License); and (b) otherwise 235 | make it clear that the license contains terms which differ from this 236 | License. 237 | 238 | 5. DISCLAIMER OF WARRANTY. 239 | 240 | COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, 241 | WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 242 | INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE 243 | IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR 244 | NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF 245 | THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE 246 | DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY 247 | OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, 248 | REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN 249 | ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS 250 | AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 251 | 252 | 6. TERMINATION. 253 | 254 | 6.1. This License and the rights granted hereunder will terminate 255 | automatically if You fail to comply with terms herein and fail to 256 | cure such breach within 30 days of becoming aware of the breach. 257 | Provisions which, by their nature, must remain in effect beyond the 258 | termination of this License shall survive. 259 | 260 | 6.2. If You assert a patent infringement claim (excluding 261 | declaratory judgment actions) against Initial Developer or a 262 | Contributor (the Initial Developer or Contributor against whom You 263 | assert such claim is referred to as "Participant") alleging that the 264 | Participant Software (meaning the Contributor Version where the 265 | Participant is a Contributor or the Original Software where the 266 | Participant is the Initial Developer) directly or indirectly 267 | infringes any patent, then any and all rights granted directly or 268 | indirectly to You by such Participant, the Initial Developer (if the 269 | Initial Developer is not the Participant) and all Contributors under 270 | Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice 271 | from Participant terminate prospectively and automatically at the 272 | expiration of such 60 day notice period, unless if within such 60 273 | day period You withdraw Your claim with respect to the Participant 274 | Software against such Participant either unilaterally or pursuant to 275 | a written agreement with Participant. 276 | 277 | 6.3. If You assert a patent infringement claim against Participant 278 | alleging that the Participant Software directly or indirectly 279 | infringes any patent where such claim is resolved (such as by 280 | license or settlement) prior to the initiation of patent 281 | infringement litigation, then the reasonable value of the licenses 282 | granted by such Participant under Sections 2.1 or 2.2 shall be taken 283 | into account in determining the amount or value of any payment or 284 | license. 285 | 286 | 6.4. In the event of termination under Sections 6.1 or 6.2 above, 287 | all end user licenses that have been validly granted by You or any 288 | distributor hereunder prior to termination (excluding licenses 289 | granted to You by any distributor) shall survive termination. 290 | 291 | 7. LIMITATION OF LIABILITY. 292 | 293 | UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT 294 | (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE 295 | INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF 296 | COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE 297 | TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR 298 | CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT 299 | LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER 300 | FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR 301 | LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE 302 | POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT 303 | APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH 304 | PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH 305 | LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR 306 | LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION 307 | AND LIMITATION MAY NOT APPLY TO YOU. 308 | 309 | 8. U.S. GOVERNMENT END USERS. 310 | 311 | The Covered Software is a "commercial item," as that term is defined 312 | in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer 313 | software" (as that term is defined at 48 C.F.R. § 314 | 252.227-7014(a)(1)) and "commercial computer software documentation" 315 | as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent 316 | with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 317 | (June 1995), all U.S. Government End Users acquire Covered Software 318 | with only those rights set forth herein. This U.S. Government Rights 319 | clause is in lieu of, and supersedes, any other FAR, DFAR, or other 320 | clause or provision that addresses Government rights in computer 321 | software under this License. 322 | 323 | 9. MISCELLANEOUS. 324 | 325 | This License represents the complete agreement concerning subject 326 | matter hereof. If any provision of this License is held to be 327 | unenforceable, such provision shall be reformed only to the extent 328 | necessary to make it enforceable. This License shall be governed by 329 | the law of the jurisdiction specified in a notice contained within 330 | the Original Software (except to the extent applicable law, if any, 331 | provides otherwise), excluding such jurisdiction's conflict-of-law 332 | provisions. Any litigation relating to this License shall be subject 333 | to the jurisdiction of the courts located in the jurisdiction and 334 | venue specified in a notice contained within the Original Software, 335 | with the losing party responsible for costs, including, without 336 | limitation, court costs and reasonable attorneys' fees and expenses. 337 | The application of the United Nations Convention on Contracts for 338 | the International Sale of Goods is expressly excluded. Any law or 339 | regulation which provides that the language of a contract shall be 340 | construed against the drafter shall not apply to this License. You 341 | agree that You alone are responsible for compliance with the United 342 | States export administration regulations (and the export control 343 | laws and regulation of any other countries) when You use, distribute 344 | or otherwise make available any Covered Software. 345 | 346 | 10. RESPONSIBILITY FOR CLAIMS. 347 | 348 | As between Initial Developer and the Contributors, each party is 349 | responsible for claims and damages arising, directly or indirectly, 350 | out of its utilization of rights under this License and You agree to 351 | work with Initial Developer and Contributors to distribute such 352 | responsibility on an equitable basis. Nothing herein is intended or 353 | shall be deemed to constitute any admission of liability. 354 | 355 | --- 356 | 357 | ## NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) 358 | 359 | The code released under the CDDL shall be governed by the laws of the 360 | State of California (excluding conflict-of-law provisions). Any 361 | litigation relating to this License shall be subject to the jurisdiction 362 | of the Federal Courts of the Northern District of California and the 363 | state courts of the State of California, with venue lying in Santa Clara 364 | County, California. 365 | 366 | --- 367 | 368 | ## The GNU General Public License (GPL) Version 2, June 1991 369 | 370 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 371 | 51 Franklin Street, Fifth Floor 372 | Boston, MA 02110-1335 373 | USA 374 | 375 | Everyone is permitted to copy and distribute verbatim copies 376 | of this license document, but changing it is not allowed. 377 | 378 | Preamble 379 | 380 | The licenses for most software are designed to take away your freedom to 381 | share and change it. By contrast, the GNU General Public License is 382 | intended to guarantee your freedom to share and change free software--to 383 | make sure the software is free for all its users. This General Public 384 | License applies to most of the Free Software Foundation's software and 385 | to any other program whose authors commit to using it. (Some other Free 386 | Software Foundation software is covered by the GNU Library General 387 | Public License instead.) You can apply it to your programs, too. 388 | 389 | When we speak of free software, we are referring to freedom, not price. 390 | Our General Public Licenses are designed to make sure that you have the 391 | freedom to distribute copies of free software (and charge for this 392 | service if you wish), that you receive source code or can get it if you 393 | want it, that you can change the software or use pieces of it in new 394 | free programs; and that you know you can do these things. 395 | 396 | To protect your rights, we need to make restrictions that forbid anyone 397 | to deny you these rights or to ask you to surrender the rights. These 398 | restrictions translate to certain responsibilities for you if you 399 | distribute copies of the software, or if you modify it. 400 | 401 | For example, if you distribute copies of such a program, whether gratis 402 | or for a fee, you must give the recipients all the rights that you have. 403 | You must make sure that they, too, receive or can get the source code. 404 | And you must show them these terms so they know their rights. 405 | 406 | We protect your rights with two steps: (1) copyright the software, and 407 | (2) offer you this license which gives you legal permission to copy, 408 | distribute and/or modify the software. 409 | 410 | Also, for each author's protection and ours, we want to make certain 411 | that everyone understands that there is no warranty for this free 412 | software. If the software is modified by someone else and passed on, we 413 | want its recipients to know that what they have is not the original, so 414 | that any problems introduced by others will not reflect on the original 415 | authors' reputations. 416 | 417 | Finally, any free program is threatened constantly by software patents. 418 | We wish to avoid the danger that redistributors of a free program will 419 | individually obtain patent licenses, in effect making the program 420 | proprietary. To prevent this, we have made it clear that any patent must 421 | be licensed for everyone's free use or not licensed at all. 422 | 423 | The precise terms and conditions for copying, distribution and 424 | modification follow. 425 | 426 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 427 | 428 | 0. This License applies to any program or other work which contains a 429 | notice placed by the copyright holder saying it may be distributed under 430 | the terms of this General Public License. The "Program", below, refers 431 | to any such program or work, and a "work based on the Program" means 432 | either the Program or any derivative work under copyright law: that is 433 | to say, a work containing the Program or a portion of it, either 434 | verbatim or with modifications and/or translated into another language. 435 | (Hereinafter, translation is included without limitation in the term 436 | "modification".) Each licensee is addressed as "you". 437 | 438 | Activities other than copying, distribution and modification are not 439 | covered by this License; they are outside its scope. The act of running 440 | the Program is not restricted, and the output from the Program is 441 | covered only if its contents constitute a work based on the Program 442 | (independent of having been made by running the Program). Whether that 443 | is true depends on what the Program does. 444 | 445 | 1. You may copy and distribute verbatim copies of the Program's source 446 | code as you receive it, in any medium, provided that you conspicuously 447 | and appropriately publish on each copy an appropriate copyright notice 448 | and disclaimer of warranty; keep intact all the notices that refer to 449 | this License and to the absence of any warranty; and give any other 450 | recipients of the Program a copy of this License along with the Program. 451 | 452 | You may charge a fee for the physical act of transferring a copy, and 453 | you may at your option offer warranty protection in exchange for a fee. 454 | 455 | 2. You may modify your copy or copies of the Program or any portion of 456 | it, thus forming a work based on the Program, and copy and distribute 457 | such modifications or work under the terms of Section 1 above, provided 458 | that you also meet all of these conditions: 459 | 460 | a) You must cause the modified files to carry prominent notices 461 | stating that you changed the files and the date of any change. 462 | 463 | b) You must cause any work that you distribute or publish, that in 464 | whole or in part contains or is derived from the Program or any part 465 | thereof, to be licensed as a whole at no charge to all third parties 466 | under the terms of this License. 467 | 468 | c) If the modified program normally reads commands interactively 469 | when run, you must cause it, when started running for such 470 | interactive use in the most ordinary way, to print or display an 471 | announcement including an appropriate copyright notice and a notice 472 | that there is no warranty (or else, saying that you provide a 473 | warranty) and that users may redistribute the program under these 474 | conditions, and telling the user how to view a copy of this License. 475 | (Exception: if the Program itself is interactive but does not 476 | normally print such an announcement, your work based on the Program 477 | is not required to print an announcement.) 478 | 479 | These requirements apply to the modified work as a whole. If 480 | identifiable sections of that work are not derived from the Program, and 481 | can be reasonably considered independent and separate works in 482 | themselves, then this License, and its terms, do not apply to those 483 | sections when you distribute them as separate works. But when you 484 | distribute the same sections as part of a whole which is a work based on 485 | the Program, the distribution of the whole must be on the terms of this 486 | License, whose permissions for other licensees extend to the entire 487 | whole, and thus to each and every part regardless of who wrote it. 488 | 489 | Thus, it is not the intent of this section to claim rights or contest 490 | your rights to work written entirely by you; rather, the intent is to 491 | exercise the right to control the distribution of derivative or 492 | collective works based on the Program. 493 | 494 | In addition, mere aggregation of another work not based on the Program 495 | with the Program (or with a work based on the Program) on a volume of a 496 | storage or distribution medium does not bring the other work under the 497 | scope of this License. 498 | 499 | 3. You may copy and distribute the Program (or a work based on it, 500 | under Section 2) in object code or executable form under the terms of 501 | Sections 1 and 2 above provided that you also do one of the following: 502 | 503 | a) Accompany it with the complete corresponding machine-readable 504 | source code, which must be distributed under the terms of Sections 1 505 | and 2 above on a medium customarily used for software interchange; or, 506 | 507 | b) Accompany it with a written offer, valid for at least three 508 | years, to give any third party, for a charge no more than your cost 509 | of physically performing source distribution, a complete 510 | machine-readable copy of the corresponding source code, to be 511 | distributed under the terms of Sections 1 and 2 above on a medium 512 | customarily used for software interchange; or, 513 | 514 | c) Accompany it with the information you received as to the offer to 515 | distribute corresponding source code. (This alternative is allowed 516 | only for noncommercial distribution and only if you received the 517 | program in object code or executable form with such an offer, in 518 | accord with Subsection b above.) 519 | 520 | The source code for a work means the preferred form of the work for 521 | making modifications to it. For an executable work, complete source code 522 | means all the source code for all modules it contains, plus any 523 | associated interface definition files, plus the scripts used to control 524 | compilation and installation of the executable. However, as a special 525 | exception, the source code distributed need not include anything that is 526 | normally distributed (in either source or binary form) with the major 527 | components (compiler, kernel, and so on) of the operating system on 528 | which the executable runs, unless that component itself accompanies the 529 | executable. 530 | 531 | If distribution of executable or object code is made by offering access 532 | to copy from a designated place, then offering equivalent access to copy 533 | the source code from the same place counts as distribution of the source 534 | code, even though third parties are not compelled to copy the source 535 | along with the object code. 536 | 537 | 4. You may not copy, modify, sublicense, or distribute the Program 538 | except as expressly provided under this License. Any attempt otherwise 539 | to copy, modify, sublicense or distribute the Program is void, and will 540 | automatically terminate your rights under this License. However, parties 541 | who have received copies, or rights, from you under this License will 542 | not have their licenses terminated so long as such parties remain in 543 | full compliance. 544 | 545 | 5. You are not required to accept this License, since you have not 546 | signed it. However, nothing else grants you permission to modify or 547 | distribute the Program or its derivative works. These actions are 548 | prohibited by law if you do not accept this License. Therefore, by 549 | modifying or distributing the Program (or any work based on the 550 | Program), you indicate your acceptance of this License to do so, and all 551 | its terms and conditions for copying, distributing or modifying the 552 | Program or works based on it. 553 | 554 | 6. Each time you redistribute the Program (or any work based on the 555 | Program), the recipient automatically receives a license from the 556 | original licensor to copy, distribute or modify the Program subject to 557 | these terms and conditions. You may not impose any further restrictions 558 | on the recipients' exercise of the rights granted herein. You are not 559 | responsible for enforcing compliance by third parties to this License. 560 | 561 | 7. If, as a consequence of a court judgment or allegation of patent 562 | infringement or for any other reason (not limited to patent issues), 563 | conditions are imposed on you (whether by court order, agreement or 564 | otherwise) that contradict the conditions of this License, they do not 565 | excuse you from the conditions of this License. If you cannot distribute 566 | so as to satisfy simultaneously your obligations under this License and 567 | any other pertinent obligations, then as a consequence you may not 568 | distribute the Program at all. For example, if a patent license would 569 | not permit royalty-free redistribution of the Program by all those who 570 | receive copies directly or indirectly through you, then the only way you 571 | could satisfy both it and this License would be to refrain entirely from 572 | distribution of the Program. 573 | 574 | If any portion of this section is held invalid or unenforceable under 575 | any particular circumstance, the balance of the section is intended to 576 | apply and the section as a whole is intended to apply in other 577 | circumstances. 578 | 579 | It is not the purpose of this section to induce you to infringe any 580 | patents or other property right claims or to contest validity of any 581 | such claims; this section has the sole purpose of protecting the 582 | integrity of the free software distribution system, which is implemented 583 | by public license practices. Many people have made generous 584 | contributions to the wide range of software distributed through that 585 | system in reliance on consistent application of that system; it is up to 586 | the author/donor to decide if he or she is willing to distribute 587 | software through any other system and a licensee cannot impose that choice. 588 | 589 | This section is intended to make thoroughly clear what is believed to be 590 | a consequence of the rest of this License. 591 | 592 | 8. If the distribution and/or use of the Program is restricted in 593 | certain countries either by patents or by copyrighted interfaces, the 594 | original copyright holder who places the Program under this License may 595 | add an explicit geographical distribution limitation excluding those 596 | countries, so that distribution is permitted only in or among countries 597 | not thus excluded. In such case, this License incorporates the 598 | limitation as if written in the body of this License. 599 | 600 | 9. The Free Software Foundation may publish revised and/or new 601 | versions of the General Public License from time to time. Such new 602 | versions will be similar in spirit to the present version, but may 603 | differ in detail to address new problems or concerns. 604 | 605 | Each version is given a distinguishing version number. If the Program 606 | specifies a version number of this License which applies to it and "any 607 | later version", you have the option of following the terms and 608 | conditions either of that version or of any later version published by 609 | the Free Software Foundation. If the Program does not specify a version 610 | number of this License, you may choose any version ever published by the 611 | Free Software Foundation. 612 | 613 | 10. If you wish to incorporate parts of the Program into other free 614 | programs whose distribution conditions are different, write to the 615 | author to ask for permission. For software which is copyrighted by the 616 | Free Software Foundation, write to the Free Software Foundation; we 617 | sometimes make exceptions for this. Our decision will be guided by the 618 | two goals of preserving the free status of all derivatives of our free 619 | software and of promoting the sharing and reuse of software generally. 620 | 621 | NO WARRANTY 622 | 623 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO 624 | WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 625 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 626 | OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, 627 | EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 628 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE 629 | ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH 630 | YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL 631 | NECESSARY SERVICING, REPAIR OR CORRECTION. 632 | 633 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 634 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 635 | AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR 636 | DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL 637 | DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM 638 | (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED 639 | INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF 640 | THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR 641 | OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 642 | 643 | END OF TERMS AND CONDITIONS 644 | 645 | How to Apply These Terms to Your New Programs 646 | 647 | If you develop a new program, and you want it to be of the greatest 648 | possible use to the public, the best way to achieve this is to make it 649 | free software which everyone can redistribute and change under these terms. 650 | 651 | To do so, attach the following notices to the program. It is safest to 652 | attach them to the start of each source file to most effectively convey 653 | the exclusion of warranty; and each file should have at least the 654 | "copyright" line and a pointer to where the full notice is found. 655 | 656 | One line to give the program's name and a brief idea of what it does. 657 | Copyright (C) 658 | 659 | This program is free software; you can redistribute it and/or modify 660 | it under the terms of the GNU General Public License as published by 661 | the Free Software Foundation; either version 2 of the License, or 662 | (at your option) any later version. 663 | 664 | This program is distributed in the hope that it will be useful, but 665 | WITHOUT ANY WARRANTY; without even the implied warranty of 666 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 667 | General Public License for more details. 668 | 669 | You should have received a copy of the GNU General Public License 670 | along with this program; if not, write to the Free Software 671 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA 672 | 673 | Also add information on how to contact you by electronic and paper mail. 674 | 675 | If the program is interactive, make it output a short notice like this 676 | when it starts in an interactive mode: 677 | 678 | Gnomovision version 69, Copyright (C) year name of author 679 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type 680 | `show w'. This is free software, and you are welcome to redistribute 681 | it under certain conditions; type `show c' for details. 682 | 683 | The hypothetical commands `show w' and `show c' should show the 684 | appropriate parts of the General Public License. Of course, the commands 685 | you use may be called something other than `show w' and `show c'; they 686 | could even be mouse-clicks or menu items--whatever suits your program. 687 | 688 | You should also get your employer (if you work as a programmer) or your 689 | school, if any, to sign a "copyright disclaimer" for the program, if 690 | necessary. Here is a sample; alter the names: 691 | 692 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 693 | program `Gnomovision' (which makes passes at compilers) written by 694 | James Hacker. 695 | 696 | signature of Ty Coon, 1 April 1989 697 | Ty Coon, President of Vice 698 | 699 | This General Public License does not permit incorporating your program 700 | into proprietary programs. If your program is a subroutine library, you 701 | may consider it more useful to permit linking proprietary applications 702 | with the library. If this is what you want to do, use the GNU Library 703 | General Public License instead of this License. 704 | 705 | --- 706 | 707 | Certain source files distributed by Oracle America, Inc. and/or its 708 | affiliates are subject to the following clarification and special 709 | exception to the GPLv2, based on the GNU Project exception for its 710 | Classpath libraries, known as the GNU Classpath Exception, but only 711 | where Oracle has expressly included in the particular source file's 712 | header the words "Oracle designates this particular file as subject to 713 | the "Classpath" exception as provided by Oracle in the LICENSE file 714 | that accompanied this code." 715 | 716 | You should also note that Oracle includes multiple, independent 717 | programs in this software package. Some of those programs are provided 718 | under licenses deemed incompatible with the GPLv2 by the Free Software 719 | Foundation and others. For example, the package includes programs 720 | licensed under the Apache License, Version 2.0. Such programs are 721 | licensed to you under their original licenses. 722 | 723 | Oracle facilitates your further distribution of this package by adding 724 | the Classpath Exception to the necessary parts of its GPLv2 code, which 725 | permits you to use that code in combination with other independent 726 | modules not licensed under the GPLv2. However, note that this would 727 | not permit you to commingle code under an incompatible license with 728 | Oracle's GPLv2 licensed code by, for example, cutting and pasting such 729 | code into a file also containing Oracle's GPLv2 licensed code and then 730 | distributing the result. Additionally, if you were to remove the 731 | Classpath Exception from any of the files to which it applies and 732 | distribute the result, you would likely be required to license some or 733 | all of the other code in that distribution under the GPLv2 as well, and 734 | since the GPLv2 is incompatible with the license terms of some items 735 | included in the distribution by Oracle, removing the Classpath 736 | Exception could therefore effectively compromise your ability to 737 | further distribute the package. 738 | 739 | Proceed with caution and we recommend that you obtain the advice of a 740 | lawyer skilled in open source matters before removing the Classpath 741 | Exception or making modifications to this package which may 742 | subsequently be redistributed and/or involve the use of third party 743 | software. 744 | 745 | CLASSPATH EXCEPTION 746 | Linking this library statically or dynamically with other modules is 747 | making a combined work based on this library. Thus, the terms and 748 | conditions of the GNU General Public License version 2 cover the whole 749 | combination. 750 | 751 | As a special exception, the copyright holders of this library give you 752 | permission to link this library with independent modules to produce an 753 | executable, regardless of the license terms of these independent 754 | modules, and to copy and distribute the resulting executable under 755 | terms of your choice, provided that you also meet, for each linked 756 | independent module, the terms and conditions of the license of that 757 | module. An independent module is a module which is not derived from or 758 | based on this library. If you modify this library, you may extend this 759 | exception to your version of the library, but you are not obligated to 760 | do so. If you do not wish to do so, delete this exception statement 761 | from your version. 762 | -------------------------------------------------------------------------------- /src/main/jbake/assets/README.md: -------------------------------------------------------------------------------- 1 | # About this Project 2 | 3 | The {{site.title}} Project is the official site for the _Java Platform, Enterprise Edition (Java EE) 8 4 | Your First Cup: An Introduction to the Java EE Platform_ tutorial that is delivered with the Java EE 8 SDK. The 5 | {{site.title}} teaches and demonstrates Java EE basics and is intended for beginners. 6 | 7 | [View the First Cup of Java EE Tutorial](toc.html) 8 | 9 | 10 | The latest build of the {{site.title}} is automatically published to this site as HTML. The tutorial is authored in 11 | [AsciiDoc](http://asciidoc.org/). AsciiDoc is similar to original markdown but is particularly suited for user 12 | documentation. If you are interested in forking the tutorial source files or building the tutorials locally, then see 13 | the [javaee/firstcup](https://github.com/javaee/firstcup) repository. 14 | 15 | # Related Projects 16 | 17 | * [javaee/firstcup-examples](https://github.com/javaee/firstcup-examples): this repository contains the example code that 18 | is used in the {{site.title}}. 19 | 20 | * [Java EE Tutorial](https://javaee.github.io/tutorial/): the Java EE Tutorial teaches and demonstrates the Java 21 | EE features that are used to develop enterprise applications. This tutorial is also included in the Java EE 8 SDK. 22 | 23 | * [javaee/tutorial-examples](https://github.com/javaee/tutorial-examples): this repository contains the example code that 24 | is used in the Java EE Tutorial. 25 | 26 | * [GlassFish Samples](https://github.com/javaee/glassfish-samples): this repository contains the sample applications 27 | that are delivered with the Java EE 8 SDK. 28 | 29 | 30 | # How-to Contribute 31 | The easiest way to contribute is by opening an [issue](https://github.com/javaee/firstcup/issues) that contains 32 | feedback and review comments. All issues will be addressed as soon as possible. 33 | 34 | 35 | The {{site.title}} is open for contributions and your help is greatly appreciated. If you have an idea for the 36 | tutorial and want to add a section or update an existing section, then review the following links: 37 | 38 | * [Contribute](CONTRIBUTING.md) 39 | * [Pull Request Acceptance Workflow](pr_doc_workflow.md) 40 | * [License](LICENSE.md) -------------------------------------------------------------------------------- /src/main/jbake/assets/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-architect 2 | 3 | title: [First Cup of Java EE Tutorial] 4 | description: [First Cup of Java EE Tutorial Project] 5 | 6 | # sidebar links url 7 | links: 8 | source: https://github.com/javaee/firstcup 9 | download: https://github.com/javaee/firstcup/releases 10 | #mailinglist: https://javaee.groups.io/g/tutorial 11 | #javadocs: 12 | docs: https://javaee.github.io/firstcup/toc.html 13 | #faq: 14 | 15 | -------------------------------------------------------------------------------- /src/main/jbake/assets/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | {{ site.title | default: site.github.repository_name }} 17 | 18 | 19 | 20 |
21 |
22 | 23 |

{{ site.title | default: site.github.repository_name }}

24 |
25 |

{{ site.description | default: site.github.project_tagline }}

26 | {% if site.github.is_project_page %} 27 | 28 | {% endif %} 29 |
30 |
31 | 32 |
33 |
34 |
35 | {{ content }} 36 | 37 |
38 | 39 | 84 |
85 |
86 | 87 | 88 | 89 | {% if site.google_analytics %} 90 | 94 | 100 | {% endif %} 101 | 102 | 103 | -------------------------------------------------------------------------------- /src/main/jbake/assets/assets/css/print.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import "{{ site.theme }}"; 5 | h1 { 6 | font-size: 1.8em; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/jbake/assets/assets/css/style.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import "{{ site.theme }}"; 5 | 6 | header { 7 | padding-top: 16px; 8 | padding-bottom: 40px; 9 | font-family: 'Mukta Vaani', 'Open Sans', 'Helvetica Neue', Helvetica, Arial, serif; 10 | background: url(../images/header-bkg.jpg) 0 0 repeat-x; 11 | border-bottom: solid 1px #E0E0E0; 12 | } 13 | 14 | header h1 { 15 | padding-top: 14px; 16 | font-size: 2em; 17 | font-weight: 200; 18 | line-height: 1.4; 19 | color: #FFFFFF; 20 | letter-spacing: 0px; 21 | border-bottom: 0px; 22 | } 23 | 24 | header h2 { 25 | font-size: 1.2em; 26 | margin-top: 0; 27 | margin-bottom: 0; 28 | font-weight: 200; 29 | line-height: .8; 30 | color: #ec7D11; // orange 31 | //color: #2879d0; // blue 32 | letter-spacing: 0; 33 | } 34 | 35 | header a.button { 36 | background: transparent url(../images/logo.png) 0 0 no-repeat; 37 | padding-left: 32px; 38 | } 39 | 40 | header a:hover { 41 | text-decoration: none; 42 | } 43 | 44 | a { 45 | font-weight: 300; 46 | color: #2879d0; 47 | } 48 | 49 | a:hover { 50 | text-decoration: underline; 51 | } 52 | 53 | #sidebar p { 54 | font-size: 1em; 55 | margin-bottom: 1em; 56 | } 57 | 58 | .highlight { 59 | background-color: #ffffff; 60 | } 61 | 62 | .sponsor { 63 | float: left; 64 | padding-top: 20px; 65 | padding-left: 18px; 66 | } 67 | 68 | .moveright30{ 69 | padding-left: 30px; 70 | } 71 | 72 | .moveright{ 73 | padding-left: 40px; 74 | } 75 | 76 | .moveright50{ 77 | padding-left: 50px; 78 | } 79 | 80 | a.oraclelogo { 81 | position: absolute; 82 | background: transparent url(../images/Oracle-logo.png) 0 0 no-repeat; 83 | background-position: 2px -2px; 84 | background-size: 100% ; 85 | width: 96px; 86 | height: 62px; 87 | padding-top: 2px; 88 | padding-right: 20px; 89 | } 90 | 91 | aside#sidebar { 92 | padding-top: 40px; 93 | line-height: 1.2; 94 | } 95 | 96 | hr { 97 | border:none; 98 | height: 10px; 99 | width: 75%; 100 | height: 50px; 101 | margin-top: 0; 102 | border-bottom: 1px solid #cccccc; 103 | box-shadow: 0 20px 20px -20px #aaa; 104 | margin: -48px auto 10px; 105 | } 106 | 107 | table { 108 | margin-bottom: 20px; 109 | } 110 | 111 | th, td { 112 | padding: .2em; 113 | } 114 | 115 | td { 116 | font-weight: 400; 117 | } 118 | 119 | ul { 120 | font-size: 1em; 121 | margin-left: 12px; 122 | } 123 | 124 | ol { 125 | list-style-position: inside; 126 | list-style: decimal; 127 | margin-left: 26px; 128 | } 129 | 130 | blockquote { 131 | padding: 0 0 0 10px; 132 | margin-left: 14px; 133 | margin-bottom: 2px; 134 | font-size: 1em; 135 | border-left: 4px solid #ddd; 136 | } 137 | 138 | #main-content h1 { 139 | padding-top: .6em; 140 | font-family: 'Mukta Vaani', 'Open Sans', 'Helvetica Neue', Helvetica, Arial, serif; 141 | font-size: 1.6em; 142 | font-weight: 500; 143 | color : #666; 144 | text-indent: 16px; 145 | letter-spacing: 0px; 146 | border-bottom:1px solid #cccccc; 147 | padding-bottom:1px; 148 | line-height: 1.2; 149 | //margin: .6em 0; 150 | margin-bottom: .6em; 151 | } 152 | 153 | #main-content h1:before { 154 | //padding-right: 0.3em; 155 | margin-left: -1em; 156 | content: ""; 157 | } 158 | 159 | #main-content h2 { 160 | margin-bottom: 8px; 161 | font-family: 'Mukta Vaani', 'Open Sans', 'Helvetica Neue', Helvetica, Arial, serif; 162 | font-size: 1.4em; 163 | font-weight: 400; 164 | //color: #474747; 165 | color: #3c657b; // blue 166 | text-indent: 4px; 167 | } 168 | 169 | #main-content h2:before { 170 | padding-right: 1.3em; 171 | margin-left: -1.5em; 172 | content: ""; 173 | font-weight: 700; 174 | } 175 | 176 | #main-content h3 { 177 | text-indent: 24px; 178 | margin-bottom: 8px; 179 | font-family: 'Mukta Vaani', 'Open Sans', 'Helvetica Neue', Helvetica, Arial, serif; 180 | font-size: 1.2em; 181 | font-weight: 500; 182 | color: #3c657b; 183 | text-indent: 4px; 184 | } 185 | 186 | #main-content h3:before { 187 | content: ""; 188 | margin-left: -0.3em; 189 | padding-right: 0.1em; 190 | } 191 | 192 | #main-content h4 { 193 | margin-bottom: 8px; 194 | font-family: 'Mukta Vaani', 'Open Sans', 'Helvetica Neue', Helvetica, Arial, serif; 195 | font-size: 1.2em; 196 | font-weight: 500; 197 | color: #3c657b; 198 | text-indent: 4px; 199 | } 200 | 201 | #main-content h4:before { 202 | content: ""; 203 | margin-left: -0.3em; 204 | padding-right: 0.1em; 205 | } 206 | 207 | #main-content p { 208 | font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, serif; 209 | font-weight: normal; 210 | font-size: 1em; 211 | margin-bottom: 2px; 212 | padding-bottom: .3em 213 | } 214 | 215 | .footer { 216 | position: fixed; 217 | bottom: 0; 218 | left: 0; 219 | right: 0; 220 | height: 6px; 221 | background-color: #f0f0f0; 222 | //padding: 1rem; 223 | padding-top: 4px; 224 | padding-bottom: 14px; 225 | font-size: 0.8em; 226 | text-align: center; 227 | } 228 | 229 | .oracle { 230 | color: #666; 231 | font-weight: 400; 232 | } 233 | 234 | .oracle:hover { 235 | text-decoration: none; 236 | color: #FF0000; 237 | } 238 | 239 | .fullpage { 240 | //float: center; 241 | color: FF0000; 242 | width: 900px; 243 | } -------------------------------------------------------------------------------- /src/main/jbake/assets/assets/images/Oracle-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/firstcup/f84a6afa9b288f6319363b53d78a75a9831ddf92/src/main/jbake/assets/assets/images/Oracle-logo.png -------------------------------------------------------------------------------- /src/main/jbake/assets/assets/images/header-bkg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/firstcup/f84a6afa9b288f6319363b53d78a75a9831ddf92/src/main/jbake/assets/assets/images/header-bkg.jpg -------------------------------------------------------------------------------- /src/main/jbake/assets/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/firstcup/f84a6afa9b288f6319363b53d78a75a9831ddf92/src/main/jbake/assets/assets/images/logo.png -------------------------------------------------------------------------------- /src/main/jbake/assets/css/style.css: -------------------------------------------------------------------------------- 1 | /* CSS */ 2 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */ 3 | /** 1. Set default font family to sans-serif. 2. Prevent iOS text size adjust after orientation change, without disabling user zoom. */ 4 | html { font-family: sans-serif; /* 1 */ -ms-text-size-adjust: 100%; /* 2 */ -webkit-text-size-adjust: 100%; /* 2 */ } 5 | 6 | /* HTML5 display definitions ========================================================================== */ 7 | /** Correct `block` display not defined for any HTML5 element in IE 8/9. Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox. Correct `block` display not defined for `main` in IE 11. */ 8 | article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; } 9 | 10 | /** 1. Correct `inline-block` display not defined in IE 8/9. 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. */ 11 | audio, canvas, progress, video { display: inline-block; /* 1 */ vertical-align: baseline; /* 2 */ } 12 | 13 | /** Prevent modern browsers from displaying `audio` without controls. Remove excess height in iOS 5 devices. */ 14 | audio:not([controls]) { display: none; height: 0; } 15 | 16 | /** Address `[hidden]` styling not present in IE 8/9/10. Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. */ 17 | [hidden], template { display: none; } 18 | 19 | /* Links ========================================================================== */ 20 | /** Remove the gray background color from active links in IE 10. */ 21 | a { background-color: transparent; } 22 | 23 | /** Improve readability when focused and also mouse hovered in all browsers. */ 24 | a:active, a:hover { outline: 0; } 25 | 26 | /* Text-level semantics ========================================================================== */ 27 | /** Address styling not present in IE 8/9/10/11, Safari, and Chrome. */ 28 | abbr[title] { border-bottom: 1px dotted; } 29 | 30 | /** Address style set to `bolder` in Firefox 4+, Safari, and Chrome. */ 31 | b, strong { font-weight: bold; } 32 | 33 | /** Address styling not present in Safari and Chrome. */ 34 | dfn { font-style: italic; } 35 | 36 | /** Address variable `h1` font-size and margin within `section` and `article` contexts in Firefox 4+, Safari, and Chrome. */ 37 | h1 { font-size: 2em; margin: 0.67em 0; } 38 | 39 | /** Address styling not present in IE 8/9. */ 40 | mark { background: #ff0; color: #000; } 41 | 42 | /** Address inconsistent and variable font size in all browsers. */ 43 | small { font-size: 80%; } 44 | 45 | /** Prevent `sub` and `sup` affecting `line-height` in all browsers. */ 46 | sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } 47 | 48 | sup { top: -0.5em; } 49 | 50 | sub { bottom: -0.25em; } 51 | 52 | /* Embedded content ========================================================================== */ 53 | /** Remove border when inside `a` element in IE 8/9/10. */ 54 | img { border: 0; } 55 | 56 | /** Correct overflow not hidden in IE 9/10/11. */ 57 | svg:not(:root) { overflow: hidden; } 58 | 59 | /* Grouping content ========================================================================== */ 60 | /** Address margin not present in IE 8/9 and Safari. */ 61 | figure { margin: 1em 40px; } 62 | 63 | /** Address differences between Firefox and other browsers. */ 64 | hr { box-sizing: content-box; height: 0; } 65 | 66 | /** Contain overflow in all browsers. */ 67 | pre { overflow: auto; } 68 | 69 | /** Address odd `em`-unit font size rendering in all browsers. */ 70 | code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } 71 | 72 | /* Forms ========================================================================== */ 73 | /** Known limitation: by default, Chrome and Safari on OS X allow very limited styling of `select`, unless a `border` property is set. */ 74 | /** 1. Correct color not being inherited. Known issue: affects color of disabled elements. 2. Correct font properties not being inherited. 3. Address margins set differently in Firefox 4+, Safari, and Chrome. */ 75 | button, input, optgroup, select, textarea { color: inherit; /* 1 */ font: inherit; /* 2 */ margin: 0; /* 3 */ } 76 | 77 | /** Address `overflow` set to `hidden` in IE 8/9/10/11. */ 78 | button { overflow: visible; } 79 | 80 | /** Address inconsistent `text-transform` inheritance for `button` and `select`. All other form control elements do not inherit `text-transform` values. Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. Correct `select` style inheritance in Firefox. */ 81 | button, select { text-transform: none; } 82 | 83 | /** 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` and `video` controls. 2. Correct inability to style clickable `input` types in iOS. 3. Improve usability and consistency of cursor style between image-type `input` and others. */ 84 | button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; /* 2 */ cursor: pointer; /* 3 */ } 85 | 86 | /** Re-set default cursor for disabled elements. */ 87 | button[disabled], html input[disabled] { cursor: default; } 88 | 89 | /** Remove inner padding and border in Firefox 4+. */ 90 | button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } 91 | 92 | /** Address Firefox 4+ setting `line-height` on `input` using `!important` in the UA stylesheet. */ 93 | input { line-height: normal; } 94 | 95 | /** It's recommended that you don't attempt to style these elements. Firefox's implementation doesn't respect box-sizing, padding, or width. 1. Address box sizing set to `content-box` in IE 8/9/10. 2. Remove excess padding in IE 8/9/10. */ 96 | input[type="checkbox"], input[type="radio"] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ } 97 | 98 | /** Fix the cursor style for Chrome's increment/decrement buttons. For certain `font-size` values of the `input`, it causes the cursor style of the decrement button to change from `default` to `text`. */ 99 | input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; } 100 | 101 | /** 1. Address `appearance` set to `searchfield` in Safari and Chrome. 2. Address `box-sizing` set to `border-box` in Safari and Chrome (include `-moz` to future-proof). */ 102 | input[type="search"] { -webkit-appearance: textfield; /* 1 */ /* 2 */ box-sizing: content-box; } 103 | 104 | /** Remove inner padding and search cancel button in Safari and Chrome on OS X. Safari (but not Chrome) clips the cancel button when the search input has padding (and `textfield` appearance). */ 105 | input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } 106 | 107 | /** Define consistent border, margin, and padding. */ 108 | fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } 109 | 110 | /** 1. Correct `color` not being inherited in IE 8/9/10/11. 2. Remove padding so people aren't caught out if they zero out fieldsets. */ 111 | legend { border: 0; /* 1 */ padding: 0; /* 2 */ } 112 | 113 | /** Remove default vertical scrollbar in IE 8/9/10/11. */ 114 | textarea { overflow: auto; } 115 | 116 | /** Don't inherit the `font-weight` (applied by a rule above). NOTE: the default cannot safely be changed in Chrome and Safari on OS X. */ 117 | optgroup { font-weight: bold; } 118 | 119 | /* Tables ========================================================================== */ 120 | /** Remove most spacing between table cells. */ 121 | table { border-collapse: collapse; border-spacing: 0; } 122 | 123 | td, th { padding: 0; } 124 | 125 | /* LAYOUT STYLES */ 126 | 127 | p { margin-top: 0; } 128 | 129 | code, pre { margin-bottom: 30px; font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace; font-size: 13px; color: #222; } 130 | 131 | code { padding: 0 3px; background-color: #f2f8fc; border: solid 1px #dbe7f3; } 132 | 133 | pre { padding: 20px; overflow: auto; text-shadow: none; background: #fff; border: solid 1px #f2f2f2; } 134 | 135 | pre code { padding: 0; color: #2879d0; background-color: #fff; border: none; } 136 | 137 | ul, ol, dl { margin-bottom: 20px; } 138 | 139 | /* COMMON STYLES */ 140 | 141 | td.halign-right { text-align: right; } 142 | 143 | td.halign-center { text-align: center; } 144 | 145 | form { padding: 20px; background: #f2f2f2; } 146 | 147 | h2 { 148 | font-size: 2em; 149 | line-height: 1.2em; 150 | font-weight: 200; 151 | letter-spacing: 0; 152 | } 153 | 154 | h3 { 155 | font-size: 1.4em; 156 | line-height: 1.2em; 157 | font-weight: normal; 158 | letter-spacing: 0; 159 | } 160 | 161 | .sect1 { 162 | margin-left: 4%; 163 | margin-right: 4%; 164 | font: 13px/20px Arial, Helvetica, sans-serif 165 | } 166 | 167 | a:link { 168 | text-decoration: none; 169 | color: #09569d; 170 | } 171 | 172 | #preamble hr{ 173 | margin-left: 0%; 174 | margin-right: 0%; 175 | } 176 | 177 | #preamble .sectionbody table { 178 | font-weight: 200; 179 | margin-left: 4%; 180 | margin-right: 4%; 181 | } 182 | 183 | hr { 184 | margin-bottom: 12px; 185 | } 186 | 187 | table.tableblock.frame-all.grid-all.spread { 188 | font-size: 12px; 189 | } 190 | 191 | code { 192 | font-size:.9em; 193 | border: 1px solid #eaeaea; 194 | background-color: #f6f6f6; 195 | border-radius: 3px; 196 | padding: 1px; 197 | padding-left:2px; 198 | padding-right:2px; 199 | } 200 | 201 | pre.prettyprint.highlight { 202 | border: 1px solid #eaeaea; 203 | background-color: #f6f6f6; 204 | border-radius: 4px; 205 | padding: 8px; 206 | padding-top:4px; 207 | padding-bottom:4px; 208 | } 209 | 210 | .language-oac_no_warn { 211 | font-size:.9em; 212 | color:#222; 213 | background-color: transparent; 214 | } 215 | 216 | #doc-title { 217 | margin-left: 4%; 218 | } 219 | 220 | #top-nav { 221 | margin-left: 4%; 222 | font-size: 12px; 223 | } 224 | 225 | #bottom-nav { 226 | margin-left: 4%; 227 | font-size: 12px; 228 | } 229 | 230 | .vector-font { 231 | color:grey; 232 | font-size: 20px; 233 | } 234 | 235 | #copyright { 236 | padding-top: 10px; 237 | padding-bottom: 4px; 238 | display: table; 239 | margin:0 auto; 240 | color: grey; 241 | font-size: 12px; 242 | } 243 | 244 | .beta {color: #FF0000} 245 | 246 | /* GENERAL ELEMENT TYPE STYLES */ 247 | 248 | /* #Media Queries 249 | ================================================== */ 250 | /* Smaller than standard 960 (devices and browsers) */ 251 | /* Tablet Portrait size to standard 960 (devices and browsers) */ 252 | @media only screen and (min-width: 768px) and (max-width: 959px) { .inner { width: 740px; } 253 | header h1, header h2 { width: 340px; } 254 | header h1 { font-size: 60px; } 255 | header h2 { font-size: 30px; } 256 | } 257 | /* All Mobile Sizes (devices and browser) */ 258 | @media only screen and (max-width: 767px) { .inner { width: 93%; } 259 | header { padding: 20px 0; } 260 | header .inner { position: relative; } 261 | header h1, header h2 { width: 100%; } 262 | header h1 { font-size: 48px; } 263 | header h2 { font-size: 24px; } 264 | header a.button { position: relative; display: inline-block; width: auto; height: auto; padding: 5px 10px; margin-top: 15px; font-size: 13px; line-height: 1; color: #2879d0; text-align: center; background-color: #9ddcff; background-image: none; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } 265 | header a.button small { display: inline; font-size: 13px; } 266 | } 267 | /* Mobile Landscape Size to Tablet Portrait (devices and browsers) */ 268 | /* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */ 269 | 270 | header h1 { padding-top: 14px; font-size: 2em; font-weight: 200; line-height: 1.4; color: #FFFFFF; letter-spacing: 0px; border-bottom: 0px; } 271 | 272 | header h2 { font-size: 1.2em; margin-top: 0; margin-bottom: 0; font-weight: 200; line-height: .8; color: #ec7D11; letter-spacing: 0; } 273 | 274 | header a.button { background: transparent url(../images/logo.png) 0 0 no-repeat; padding-left: 32px; } 275 | 276 | header a:hover { text-decoration: none; } 277 | -------------------------------------------------------------------------------- /src/main/jbake/assets/img/firstcup-architecture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/firstcup/f84a6afa9b288f6319363b53d78a75a9831ddf92/src/main/jbake/assets/img/firstcup-architecture.gif -------------------------------------------------------------------------------- /src/main/jbake/assets/img/oracle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/firstcup/f84a6afa9b288f6319363b53d78a75a9831ddf92/src/main/jbake/assets/img/oracle.gif -------------------------------------------------------------------------------- /src/main/jbake/assets/pr_doc_workflow.md: -------------------------------------------------------------------------------- 1 | # Documentation Pull Request Acceptance Workflow 2 | 3 | ## Prerequisite 4 | To contribute to the documentation, you first need to sign the 5 | [Oracle Contributor Agreement](http://www.oracle.com/technetwork/community/oca-486395.html). 6 | When filling the OCA make sure to include your GitHub username. If you signed the OCA previously and your GitHub 7 | username wasn't included, just ping [David Delabassee](mailto:david.delabassee(@)oracle.com) to fix this. 8 | Once your OCA has been approved, you'll be able to work directly with the respective project/module owners or 9 | reviewers to get your Pull Request reviewed and approved. The OCA process doesn't apply to Oracle employees. 10 | 11 | ## One Time Setup 12 | * [Fork](https://help.github.com/articles/fork-a-repo/) the [Firstcup](https://github.com/javaee/firstcup/) repository. 13 | * [Clone](https://help.github.com/articles/cloning-a-repository/) your forked repository. 14 | ``` 15 | $ git clone https://github.com/javaee/firstcup.git 16 | ``` 17 | * [Configure](https://help.github.com/articles/configuring-a-remote-for-a-fork/) the remote for your fork. 18 | ``` 19 | $ git remote add upstream https://github.com/javaee/firstcup.git 20 | $ git remote -v 21 | origin https://github.com/your-githubid/firstcup.git (fetch) 22 | origin https://github.com/your-githubid/firstcup.git (push) 23 | upstream https://github.com/javaee/firstcup.git (fetch) 24 | upstream https://github.com/javaee/firstcup.git (push) 25 | ``` 26 | ## Raising a Pull Request 27 | * Sync the master of your fork with upstream master. 28 | ``` 29 | $ git fetch upstream 30 | $ git checkout master 31 | $ git merge upstream/master 32 | $ git push origin master #push local master to github fork. 33 | ``` 34 | * Create a local topic branch in your fork from your master. 35 | ``` 36 | $ git checkout -b doc_update 37 | ``` 38 | * Do the development in your branch. 39 | * Commit all the changes. 40 | ``` 41 | $ git add src/main/jbake/content/my.adoc 42 | $ git commit -m "my commit message" 43 | ``` 44 | * Push your changes in a remote branch of your fork. 45 | ``` 46 | $ git push origin doc_update 47 | ``` 48 | * Before raising a Pull Request, please raise an [issue](https://github.com/javaee/firstcup/issues) if it doesn't 49 | exist. We would like every Pull Request to be associated with an issue. Submit the Pull Request referring to the issue 50 | number. 51 | * Raise a [Pull Request](https://github.com/javaee/firstcup/pulls). 52 | * Make sure you put a proper 'title' for the Pull Request. The title of the Pull Request would become the commit 53 | message. Instead of giving 'title' like "Iss xxxx" or "Fixes #xxxxx", consider giving a proper one line 'title' for 54 | the Pull Request like "Fixes xxx : " 55 | * In the Pull Request description (body), please mention "Fixes #xxxxx" in order to link the Pull Request with the 56 | Issue you are fixing. 57 | * If you have signed the OCA, one of the GlassFish team members will review your Pull Request. If you have not signed 58 | an OCA, see [Prerequisite](#pre). 59 | -------------------------------------------------------------------------------- /src/main/jbake/content/creating-example.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Creating Your First Java EE Application 4 | next=creating-example001.html 5 | prev=java-ee002.html 6 | ~~~~~~ 7 | = Creating Your First Java EE Application 8 | 9 | 10 | [[GCRKP]][[creating-your-first-java-ee-application]] 11 | 12 | 3 Creating Your First Java EE Application 13 | ----------------------------------------- 14 | 15 | This chapter gives an overview of the example applications and 16 | step-by-step instructions on coding and running the `dukes-age` web 17 | service example application. 18 | -------------------------------------------------------------------------------- /src/main/jbake/content/creating-example001.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Architecture of the Example Applications 4 | next=creating-example002.html 5 | prev=creating-example.html 6 | ~~~~~~ 7 | = Architecture of the Example Applications 8 | 9 | 10 | [[GKHQT]][[architecture-of-the-example-applications]] 11 | 12 | Architecture of the Example Applications 13 | ---------------------------------------- 14 | 15 | The example applications consist of four main components: 16 | `DukesAgeResource`, a JAX-RS RESTful web service; `DukesBirthdayBean`, 17 | an enterprise bean; `FirstcupUser`, a Java Persistence API entity; and 18 | `firstcup-war`, a web application created with JavaServer Faces Facelets 19 | technology. 20 | 21 | [[GJBEW]] 22 | 23 | .*Figure 3-1 Architecture of the First Cup Example Applications* 24 | image:img/firstcup-architecture.gif[ 25 | "Architecture of First Cup example applications."] 26 | 27 | `DukesAgeResource` is a JAX-RS resource that calculates the age of Duke, 28 | the Java mascot. Duke was born May 23, 1995, when the first demo of Java 29 | technology was publicly released. 30 | 31 | `DukesBirthdayBean` is a local, no-interface view stateless session bean 32 | that calculates the difference between the user's age and Duke's age and 33 | stores the user-submitted data in a Java Persistence API entity. 34 | 35 | `FirstcupUser` is a Java Persistence API entity that represents a 36 | particular user's birthday. It is stored in an Apache Derby table and 37 | managed by the `DukesBirthdayBean` business methods. 38 | 39 | The `firstcup-war` web application is a JavaServer Faces Facelets 40 | application that accesses `DukesAgeResource` to display Duke's age, 41 | reads in a date provided by the user, accesses `DukesBirthdayBean` to 42 | calculate who is older, and then displays the difference in years 43 | between the user and Duke and the average age difference of all users. 44 | 45 | The `firstcup-war` web application consists of the following: 46 | 47 | * `greeting.xhtml`: A Facelets-enabled XHTML page, which is a page that 48 | uses the JavaServer Faces Facelets tag libraries. Users can type their 49 | birth date in a field and submit it for comparison against Duke's birth 50 | date. 51 | * `response.xhtml`: A Facelets-enabled XHTML page that tells the user 52 | whether he or she is older or younger than Duke, based on the date the 53 | user entered in the `greeting.xhtml` page, and displays the average age 54 | difference of all users. 55 | * `DukesBDay.java`: A CDI managed bean that defines properties to hold 56 | the user's birth date, uses the JAX-RS Client API to get Duke's current 57 | age from the `DukesAgeResource` web service, and calculates the age 58 | difference between the user and Duke from the enterprise bean. 59 | * `web.xml`: The web application's deployment descriptor, which is used 60 | to configure certain aspects of a web application when it is installed. 61 | In this case, it is used to provide a mapping to the application's 62 | `FacesServlet` instance, which accepts incoming requests, passes them to 63 | the life cycle for processing, and initializes resources. It also 64 | specifies `greeting.xhtml` as the welcome file for the application. 65 | * `WebMessages.properties` and `WebMessages_es.properties`: Java 66 | programming language properties files that contain the localized strings 67 | used in `greeting.xhtml` and `response.xhtml`. By default, the English 68 | language strings in `WebMessages.properties` are used, but Spanish 69 | language strings are also provided in `WebMessages_es.properties`. 70 | * `DukesBirthdayBean.java`: as described above, the enterprise bean 71 | packaged within the `firstcup-war` application. `DukesBirthdayBean` 72 | calculates the difference between the user's birthday and Duke's 73 | birthday. 74 | 75 | [[GCRLR]][[tiers-in-the-example-applications]] 76 | 77 | Tiers in the Example Applications 78 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 79 | 80 | The example applications have a web tier component (the `firstcup-war` 81 | web client), three business tier components (the `DukesAgeResource` web 82 | service, the `FirstcupUser` entity, and the `DukesBirthdayBean` 83 | enterprise bean), and an enterprise information system (EIS) tier (the 84 | data in the Apache Derby database table). The user's web browser is the 85 | client tier component, as it accesses the rest of the application 86 | through the web tier. 87 | 88 | [[GCRLU]][[java-ee-technologies-used-in-the-example-applications]] 89 | 90 | Java EE Technologies Used in the Example Applications 91 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 92 | 93 | The `DukesAgeResource` web service is a JAX-RS resource. The 94 | `DukesBirthdayBean` enterprise bean is a stateless session bean. The 95 | `FirstcupUser` entity is a Java Persistence API entity. The `DukesBDay` 96 | CDI managed bean uses the JAX-RS client API to access the 97 | `DukesAgeResource` web service. The `firstcup-war` web client is a 98 | JavaServer Faces application that runs in the web container of the Java 99 | EE server. 100 | -------------------------------------------------------------------------------- /src/main/jbake/content/creating-example002.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Coding the dukes-age Example Application 4 | next=web-application.html 5 | prev=creating-example001.html 6 | ~~~~~~ 7 | = Coding the dukes-age Example Application 8 | 9 | 10 | [[GCRKM]][[coding-the-dukes-age-example-application]] 11 | 12 | Coding the dukes-age Example Application 13 | ---------------------------------------- 14 | 15 | This section describes how to code the `dukes-age` example application, 16 | a web application containing a JAX-RS RESTful web service endpoint. 17 | 18 | [[GCSKG]][[getting-started]] 19 | 20 | Getting Started 21 | ~~~~~~~~~~~~~~~ 22 | 23 | Before you start coding the example, you need to perform some 24 | configuration tasks: 25 | 26 | 1. Register the server with your NetBeans IDE as described in 27 | link:intro002.html#GIOEW[Add GlassFish Server as a Server in NetBeans 28 | IDE]. 29 | 2. Install the Maven archetypes used to create the example 30 | applications. 31 | 32 | [[GCSKJ]][[install-the-maven-archetypes]] 33 | 34 | Install the Maven Archetypes 35 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 36 | 37 | Maven archetypes are templates that create the structure of a particular 38 | application. There are two archetypes included in the example, 39 | `dukes-age-archetype` and `firstcup-war-archetype`. These archetypes 40 | create Java EE 8 web applications that you will then edit and deploy. 41 | 42 | Before you can create applications based on the archetypes, you must 43 | first install the archetypes and supporting projects to your local Maven 44 | repository by following these steps: 45 | 46 | 1. In NetBeans IDE select *File*, then *Open Project*, navigate to the 47 | location where you installed the tutorial (usually 48 | `glassfish5/docs/firstcup`), select `example`, deselect the *Open 49 | Required Projects* check box, and click *Open Project*. 50 | 2. Right-click the `firstcup` project in the Projects pane and select 51 | *Build*. 52 | 53 | The required projects, including the archetypes, will be built. 54 | 55 | [[GCRKN]][[creating-the-web-service]] 56 | 57 | Creating the Web Service 58 | ~~~~~~~~~~~~~~~~~~~~~~~~ 59 | 60 | The `DukesAgeResource` endpoint is a simple RESTful web service. REST 61 | stands for _representational state transfer_, and software architectures 62 | that conform to the principles of REST are referred to as _RESTful_. 63 | RESTful web services are web-based applications that use the HTTP 64 | protocol to access, modify, or delete information contained within a 65 | _resource_. A RESTful web service resource is a source of specific 66 | information identifiable by a uniform resource identifier (URI), for 67 | example `http://example.com/someResource`, and may be manipulated by 68 | calling the HTTP protocol's methods, for example GET or POST. 69 | 70 | Web services are designed to be independent of their clients. Typically 71 | RESTful web services are publicly available to a wide variety of 72 | clients, and the clients are located throughout the Internet. This is 73 | called "loose coupling", because the clients and servers are connected only 74 | by the standard HTTP-based requests and responses, and do not need to 75 | know each other's implementation details. For this reason, `dukes-age` 76 | will be developed in its own application module and deployed separately 77 | from the `DukesBirthdayBean` enterprise bean and `firstcup-war` web 78 | client. The `dukes-age` web application could be deployed on a completely different machine 79 | without affecting the functionality of the `firstcup-war` web client. 80 | 81 | [[GCROM]][[jax-rs-resources]] 82 | 83 | JAX-RS Resources 84 | ^^^^^^^^^^^^^^^^ 85 | 86 | The `DukesAgeResource` class is a JAX-RS resource class that responds to HTTP GET 87 | requests and returns a `String` representing the age of Duke at the time 88 | of the request. 89 | 90 | The basic `DukesAgeResource` resource class is generated from the 91 | `dukes-age-archetype` Maven archetype. This class is annotated with the 92 | `javax.ws.rs.Path` annotation, which specifies the URL suffix to which 93 | the resource will respond. The `DukesAgeResource` class has a single method, 94 | `getText`, annotated with the `javax.ws.rs.GET` and 95 | `javax.ws.rs.Produces` annotations. The `@GET` annotation marks the method as a 96 | responder to HTTP GET requests, and `@Produces` specifies the MIME-type 97 | of the response sent back from `getText` to clients. In this case, the 98 | MIME-type is `text/plain`. 99 | 100 | [[GCROI]][[creating-the-dukes-age-application-using-the-maven-archetype]] 101 | 102 | Creating the dukes-age Application Using the Maven Archetype 103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 104 | 105 | In NetBeans IDE, create a new web project using the 106 | `dukes-age-archetype` Maven archetype. 107 | 108 | Create the Project in NetBeans IDE  109 | 110 | 1. From the *File* menu, select *New Project*. 111 | 2. Under *Categories*, select *Maven*. 112 | 3. Under *Projects*, select *Project from Archetype*. 113 | 4. Click *Next*. 114 | 5. In the *Search* field, enter `dukes-age`. 115 | 6. In the *Known Archetypes* field, select `dukes-age-archetype`. 116 | 7. Click *Next*. 117 | 8. In the *Project Name* field, enter `dukes-age`. 118 | 9. In the *Package* field, enter `firstcup.dukesage.resource`. 119 | 10. Click *Finish*. 120 | + 121 | You should now see the module you created in the Projects tab. The 122 | project is created in the `NetBeansProjects` directory under your home 123 | directory. 124 | 125 | The `dukes-age-archetype` archetype creates the structure of the JAX-RS 126 | endpoint application, including: 127 | 128 | * The `DukesAgeResource` resource class 129 | * The `web.xml` deployment descriptor 130 | 131 | After you create the basic application structure with the archetype, you 132 | will configure how the application will run, implement the functionality 133 | of the resource class, and then deploy the application. 134 | 135 | Configure the dukes-age Web Application 136 | 137 | Set the default URL that is brought up in a web browser when you run 138 | `dukes-age`. 139 | 140 | 1. In the *Projects* tab, right-click the `dukes-age` project and select 141 | *Properties*. 142 | 2. Under *Categories*, click *Run*. 143 | 3. Under *Server*, select the GlassFish Server instance you configured. 144 | 4. Under *Relative URL* enter `/webapi/dukesAge`. 145 | 5. Click *OK*. 146 | 147 | Implement the getText Method 148 | 149 | Add code to `DukesAgeResource.getText` that calculates Duke's age at the 150 | time of the request. To do this, use the `java.util.Calendar` and 151 | `java.util.GregorianCalendar` classes to create an object representing 152 | the date May 23, 1995, Duke's birthday. Then create another `Calendar` 153 | object representing today's date, and subtract today's year from Duke's 154 | birth year. If today's date falls before May 23, subtract a year from 155 | this result. Then return the result as a `String` representation. 156 | 157 | 1. Expand the *Source Packages* node, expand the 158 | `firstcup.dukesage.resource` node, then double-click the 159 | `DukesAgeResource.java` file to open it in the editor window. 160 | 2. Highlight the current code in `getText` and replace it with the 161 | following code: 162 | + 163 | [source,oac_no_warn] 164 | ---- 165 | // Create a new Calendar for Duke's birthday 166 | Calendar dukesBirthday = new GregorianCalendar(1995, Calendar.MAY, 23); 167 | // Create a new Calendar for today 168 | Calendar now = GregorianCalendar.getInstance(); 169 | 170 | // Subtract today's year from Duke's birth year, 1995 171 | int dukesAge = now.get(Calendar.YEAR) - dukesBirthday.get(Calendar.YEAR); 172 | dukesBirthday.add(Calendar.YEAR, dukesAge); 173 | 174 | // If today's date is before May 23, subtract a year from Duke's age 175 | if (now.before(dukesBirthday)) { 176 | dukesAge--; 177 | } 178 | // Return a String representation of Duke's age 179 | return "" + dukesAge; 180 | ---- 181 | 3. In the editor window, right-click and select *Format*. 182 | 4. From the *File* menu, select *Save* to save the file. 183 | 184 | [[sthref9]][[starting-glassfish-server-and-the-database-server]] 185 | 186 | Starting GlassFish Server and the Database Server 187 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 188 | 189 | Follow these steps to start GlassFish Server and Apache Derby. 190 | 191 | 1. Click the *Services* tab. 192 | 2. Expand *Servers*. 193 | 3. Right-click the GlassFish Server instance and select *Start*. 194 | + 195 | Both the database server and the GlassFish Server instance will start. 196 | In the tab where the GlassFish Server instance is running, you can see 197 | the contents of the server log. 198 | 199 | [[GCTOZ]][[building-and-deploying-the-web-service-endpoint]] 200 | 201 | Building and Deploying the Web Service Endpoint 202 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 203 | 204 | Build `dukes-age.war`, the JAX-RS web application, and deploy it to your 205 | GlassFish Server instance. 206 | 207 | In the *Projects* tab, right-click `dukes-age` and select *Run*. 208 | 209 | After `dukes-age.war` deploys successfully to GlassFish Server, a web 210 | browser will load the URL of the `DukesAgeResource` path, and you'll see 211 | the returned `String` representing Duke's age. 212 | 213 | At this point, you've successfully created, deployed, and run your first 214 | Java EE application. Now you will create a web application that uses 215 | this web service data. 216 | -------------------------------------------------------------------------------- /src/main/jbake/content/intro.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Introduction 4 | next=intro001.html 5 | prev=preface.html 6 | ~~~~~~ 7 | = Introduction 8 | 9 | 10 | [[GCQYB]] 11 | 12 | [[introduction]] 13 | 1 Introduction 14 | -------------- 15 | 16 | This chapter outlines the goals and the prerequisites for completing 17 | this tutorial. 18 | -------------------------------------------------------------------------------- /src/main/jbake/content/intro001.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Goals of This Tutorial 4 | next=intro002.html 5 | prev=intro.html 6 | ~~~~~~ 7 | = Goals of This Tutorial 8 | 9 | 10 | [[GCQYJ]][[goals-of-this-tutorial]] 11 | 12 | Goals of This Tutorial 13 | ---------------------- 14 | 15 | At the completion of this tutorial, you will: 16 | 17 | * Understand the basics of tiered applications 18 | * Understand the basics of the Java EE platform 19 | * Have created a multitiered Java EE application 20 | * Have deployed and run your application on a Java EE server 21 | * Know where to go next for more information on the Java EE platform 22 | -------------------------------------------------------------------------------- /src/main/jbake/content/intro002.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Prerequisite Tasks for Completing This Tutorial 4 | next=java-ee.html 5 | prev=intro001.html 6 | ~~~~~~ 7 | = Prerequisite Tasks for Completing This Tutorial 8 | 9 | 10 | [[GCQZL]][[prerequisite-tasks-for-completing-this-tutorial]] 11 | 12 | Prerequisite Tasks for Completing This Tutorial 13 | ----------------------------------------------- 14 | 15 | To complete this tutorial, you need to complete the following tasks 16 | first: 17 | 18 | * link:#software-compatibility[See the software compatibility notice] 19 | * link:#get-the-java-ee-8-sdk[Get the Java EE 8 SDK] 20 | * link:#install-the-netbeans-ide-distribution-for-java-ee[Install the NetBeans IDE distribution for Java EE] 21 | * link:#add-glassfish-server-as-a-server-in-netbeans-ide[Add GlassFish Server as a server in NetBeans IDE] 22 | //// 23 | * link:#get-the-latest-updates-to-this-tutorial[Get the latest updates to this tutorial] 24 | //// 25 | 26 | [[software-compatibility]] 27 | 28 | Software Compatibility Notice 29 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 30 | 31 | This tutorial is compatible with the following software: 32 | 33 | [width="55%",cols="30%,60%"] 34 | |======================================================================= 35 | |*Software* |*Version* 36 | |link:http://www.oracle.com/technetwork/java/javase/downloads/index.html[Java Development Kit (JDK)] | 8 update 144 (8u144) or greater 37 | |link:https://javaee.github.io/glassfish/[GlassFish Server] | 5.0 or greater 38 | |link:https://netbeans.org/[NetBeans IDE] | 8.2 or greater 39 | |link:https://eclipse.org/ide/[Eclipse IDE] | 4.7.0 or greater 40 | 41 | |======================================================================= 42 | 43 | [[GCRNX]][[get-the-java-ee-8-sdk]] 44 | 45 | Get the Java EE 8 SDK 46 | ~~~~~~~~~~~~~~~~~~~~~ 47 | 48 | To get the Java EE 8 SDK, go to 49 | `http://www.oracle.com/technetwork/java/javaee/downloads/`. Download and 50 | install the SDK. The location where you install it is typically 51 | `glassfish5` in your home directory, but you can change this. 52 | 53 | The tutorial is installed in the `docs/firstcup` directory of your SDK 54 | installation. 55 | 56 | [[GCRNU]][[install-the-netbeans-ide-distribution-for-java-ee]] 57 | 58 | Install the NetBeans IDE Distribution for Java EE 59 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | 61 | To get NetBeans IDE, go to `https://netbeans.org/downloads/` and 62 | download the Java EE distribution. Install this distribution. 63 | 64 | [[GIOEW]][[add-glassfish-server-as-a-server-in-netbeans-ide]] 65 | 66 | Add GlassFish Server as a Server in NetBeans IDE 67 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | 69 | Once you have all the necessary downloads, you must configure NetBeans 70 | IDE and get the latest tutorial updates. 71 | 72 | To run this tutorial in NetBeans IDE, you must register your GlassFish 73 | Server installation as a NetBeans server instance. Follow these 74 | instructions to register the GlassFish Server in NetBeans IDE. 75 | 76 | 1. From the *Tools* menu, select *Servers*. 77 | 2. In the Servers dialog, click *Add Server*. 78 | 3. Under *Choose Server*, select *GlassFish Server* and click *Next*. 79 | 4. Under *Server Location*, browse to or enter the location of your 80 | GlassFish Server installation. 81 | 5. Click *Next*. 82 | 6. Under *Domain Location*, select the default domain, `domain1`. 83 | 7. Click *Finish*. 84 | 85 | //// 86 | [[GIMVN]][[get-the-latest-updates-to-this-tutorial]] 87 | 88 | Get the Latest Updates to this Tutorial 89 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 90 | 91 | Check for any updates to this tutorial by using the Update Center 92 | included with the Java EE 8 SDK. 93 | 94 | 1. In NetBeans IDE, select the *Services* tab and expand the *Servers* 95 | node. 96 | 2. Right-click the GlassFish Server instance and select *View Domain 97 | Update Center* to display the Update Tool. 98 | 3. In the tree, select *Available Updates* to display a list of updated 99 | packages. 100 | 4. Look for updates to the First Cup for Java EE 8 101 | (`javaee-firstcup-tutorial`) package. 102 | 5. If there is an updated version, select First Cup for Java EE 8 103 | (`javaee-firstcup-tutorial`) and click *Install*. 104 | //// 105 | -------------------------------------------------------------------------------- /src/main/jbake/content/java-ee.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Understanding Java Platform, Enterprise Edition 4 | next=java-ee001.html 5 | prev=intro002.html 6 | ~~~~~~ 7 | = Understanding Java Platform, Enterprise Edition 8 | 9 | 10 | [[GCRLO]][[understanding-java-platform-enterprise-edition]] 11 | 12 | 2 Understanding Java Platform, Enterprise Edition 13 | ------------------------------------------------- 14 | 15 | This chapter describes the basic concepts behind enterprise application 16 | development and examines how an application server is the sum of its 17 | Java EE containers. 18 | -------------------------------------------------------------------------------- /src/main/jbake/content/java-ee001.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Overview of Enterprise Applications 4 | next=java-ee002.html 5 | prev=java-ee.html 6 | ~~~~~~ 7 | = Overview of Enterprise Applications 8 | 9 | 10 | [[GCRKY]][[overview-of-enterprise-applications]] 11 | 12 | Overview of Enterprise Applications 13 | ----------------------------------- 14 | 15 | This section describes enterprise applications and how they are designed 16 | and developed. 17 | 18 | As stated above, the Java EE platform is designed to help developers 19 | create large-scale, multitiered, scalable, reliable, and secure network 20 | applications. A shorthand name for such applications is *enterprise 21 | applications*, so called because these applications are designed to 22 | solve the problems encountered by large enterprises. Enterprise 23 | applications are not only useful for large corporations, agencies, and 24 | governments, however. The benefits of an enterprise application are 25 | helpful, even essential, for individual developers and small 26 | organizations in an increasingly networked world. 27 | 28 | The features that make enterprise applications powerful, like security 29 | and reliability, often make these applications complex. The Java EE 30 | platform reduces the complexity of enterprise application development by 31 | providing a development model, API, and runtime environment that allow 32 | developers to concentrate on functionality. 33 | 34 | [[GCRKR]][[tiered-applications]] 35 | 36 | Tiered Applications 37 | ~~~~~~~~~~~~~~~~~~~ 38 | 39 | In a multitiered application, the functionality of the application is 40 | separated into isolated functional areas, called tiers. Typically, 41 | multitiered applications have a client tier, a middle tier, and a data 42 | tier (often called the enterprise information systems tier). The client 43 | tier consists of a client program that makes requests to the middle 44 | tier. The middle tier is divided into a web tier and a business tier, 45 | which handle client requests and process application data, storing it in 46 | a permanent data store in the data tier. 47 | 48 | Java EE application development concentrates on the middle tier to make 49 | enterprise application management easier, more robust, and more secure. 50 | 51 | [[GCRLA]][[the-client-tier]] 52 | 53 | The Client Tier 54 | ^^^^^^^^^^^^^^^ 55 | 56 | The client tier consists of application clients that access a Java EE 57 | server and that are usually located on a different machine from the 58 | server. The clients make requests to the server. The server processes 59 | the requests and returns a response back to the client. Many different 60 | types of applications can be Java EE clients, and they are not always, 61 | or even often, Java applications. Clients can be a web browser, a 62 | standalone application, or other servers, and they run on a different 63 | machine from the Java EE server. 64 | 65 | [[GCRNL]][[the-web-tier]] 66 | 67 | The Web Tier 68 | ^^^^^^^^^^^^ 69 | 70 | The web tier consists of components that handle the interaction between 71 | clients and the business tier. Its primary tasks are the following: 72 | 73 | * Dynamically generate content in various formats for the client 74 | * Collect input from users of the client interface and return 75 | appropriate results from the components in the business tier 76 | * Control the flow of screens or pages on the client 77 | * Maintain the state of data for a user's session 78 | * Perform some basic logic and hold some data temporarily in managed 79 | beans 80 | 81 | link:#GCTOG[Table 2-1] lists some of the main Java EE technologies that 82 | are used in the web tier in Java EE applications. 83 | 84 | [[sthref6]][[GCTOG]] 85 | 86 | Table 2-1 Web-Tier Java EE Technologies 87 | 88 | [width="80%",cols="25%,74%"] 89 | |======================================================================= 90 | |*Technology* |*Purpose* 91 | |JavaServer Faces technology |A user interface component framework for 92 | web applications that allows you to include UI components (such as 93 | fields and buttons) on a XHTML page, called a Facelets page; convert and 94 | validate UI component data; save UI component data to server-side data 95 | stores; and maintain component state 96 | 97 | |Expression Language |A set of standard tags used in Facelets pages to 98 | refer to Java EE components 99 | 100 | |Servlets |Java programming language classes that dynamically process 101 | requests and construct responses, usually for HTML pages 102 | 103 | |Contexts and Dependency Injection for Java EE |A set of contextual 104 | services that make it easy for developers to use enterprise beans along 105 | with JavaServer Faces technology in web applications 106 | |======================================================================= 107 | 108 | 109 | [[GCRLS]][[the-business-tier]] 110 | 111 | The Business Tier 112 | ^^^^^^^^^^^^^^^^^ 113 | 114 | The business tier consists of components that provide the business logic 115 | for an application. Business logic is code that provides functionality 116 | to a particular business domain, like the financial industry, or an 117 | e-commerce site. In a properly designed enterprise application, the core 118 | functionality exists in the business tier components. 119 | 120 | The following Java EE technologies are among those that are used in the 121 | business tier in Java EE applications: 122 | 123 | * Enterprise JavaBeans (enterprise bean) components 124 | * JAX-RS RESTful web services 125 | * Java Persistence API entities 126 | 127 | [[GCRKW]][[the-enterprise-information-systems-tier]] 128 | 129 | The Enterprise Information Systems Tier 130 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 131 | 132 | The enterprise information systems (EIS) tier consists of database 133 | servers, enterprise resource planning systems, and other legacy data 134 | sources, like mainframes. These resources typically are located on a 135 | separate machine from the Java EE server, and are accessed by components 136 | on the business tier. 137 | 138 | The following Java EE technologies are used to access the EIS tier in 139 | Java EE applications: 140 | 141 | * The Java Database Connectivity API (JDBC) 142 | * The Java Persistence API 143 | * The Java EE Connector Architecture 144 | * The Java Transaction API (JTA) 145 | -------------------------------------------------------------------------------- /src/main/jbake/content/java-ee002.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Java EE Servers and Containers 4 | next=creating-example.html 5 | prev=java-ee001.html 6 | ~~~~~~ 7 | = Java EE Servers and Containers 8 | 9 | 10 | [[GCRKQ]][[java-ee-servers-and-containers]] 11 | 12 | Java EE Servers and Containers 13 | ------------------------------ 14 | 15 | A Java EE server is a server application that implements the Java EE 16 | platform APIs and provides standard Java EE services. Java EE servers 17 | are sometimes called application servers, because they allow you to 18 | serve application data to clients, much as web servers serve web pages 19 | to web browsers. 20 | 21 | Java EE servers host several application component types that correspond 22 | to the tiers in a multitiered application. The Java EE server provides 23 | services to these components in the form of a container. 24 | 25 | Java EE containers are the interface between the component and the 26 | lower-level functionality provided by the platform to support that 27 | component. The functionality of the container is defined by the platform 28 | and is different for each component type. Nonetheless, the server allows 29 | the different component types to work together to provide functionality 30 | in an enterprise application. 31 | 32 | [[GCRMB]][[the-web-container]] 33 | 34 | The Web Container 35 | ~~~~~~~~~~~~~~~~~ 36 | 37 | The web container is the interface between web components and the web 38 | server. A web component can be a servlet or a JavaServer Faces Facelets 39 | page. The container manages the component's life cycle, dispatches 40 | requests to application components, and provides interfaces to context 41 | data, such as information about the current request. 42 | 43 | [[GCRMA]][[the-ejb-container]] 44 | 45 | The EJB Container 46 | ~~~~~~~~~~~~~~~~~ 47 | 48 | The EJB container is the interface between enterprise beans, which 49 | provide the business logic in a Java EE application, and the Java EE 50 | server. The EJB container runs on the Java EE server and manages the 51 | execution of an application's enterprise beans. 52 | 53 | [[GCRLJ]][[the-application-client-container]] 54 | 55 | The Application Client Container 56 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57 | 58 | The application client container is the interface between Java EE 59 | application clients (special Java SE applications that use Java EE 60 | server components) and the Java EE server. The application client 61 | container runs on the client machine and is the gateway between the 62 | client application and the Java EE server components that the client 63 | uses. 64 | -------------------------------------------------------------------------------- /src/main/jbake/content/next-steps.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Next Steps 4 | next=next-steps001.html 5 | prev=web-application006.html 6 | ~~~~~~ 7 | = Next Steps 8 | 9 | 10 | [[GCRLL]][[next-steps]] 11 | 12 | 5 Next Steps 13 | ------------ 14 | 15 | This chapter provides additional resources for learning more about 16 | enterprise application architecture, the Java EE platform, and GlassFish 17 | Server. 18 | -------------------------------------------------------------------------------- /src/main/jbake/content/next-steps001.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=The Java EE Tutorial 4 | next=next-steps002.html 5 | prev=next-steps.html 6 | ~~~~~~ 7 | = The Java EE Tutorial 8 | 9 | 10 | [[GCRLH]][[the-java-ee-tutorial]] 11 | 12 | The Java EE Tutorial 13 | -------------------- 14 | 15 | The https://javaee.github.io/tutorial[Java EE Tutorial] documents the 16 | technologies that make up the Java EE platform. The Java EE Tutorial 17 | describes each piece of the platform in detail, and includes code 18 | examples that demonstrate how to use each piece of the platform. 19 | -------------------------------------------------------------------------------- /src/main/jbake/content/next-steps002.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=More Information on the Java EE Platform 4 | prev=next-steps001.html 5 | ~~~~~~ 6 | = More Information on the Java EE Platform 7 | 8 | 9 | [[GKHRA]][[more-information-on-the-java-ee-platform]] 10 | 11 | More Information on the Java EE Platform 12 | ---------------------------------------- 13 | 14 | For more information on the Java EE platform, see these resources: 15 | 16 | * The GlassFish project (`https://javaee.github.io/glassfish/`) 17 | * The Aquarium (`http://blogs.oracle.com/theaquarium/`), a blog about 18 | GlassFish Server and open-source Java EE projects 19 | -------------------------------------------------------------------------------- /src/main/jbake/content/preface.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Preface 4 | next=intro.html 5 | prev=title.html 6 | ~~~~~~ 7 | = Preface 8 | 9 | 10 | [[GCQYW]][[preface]] 11 | 12 | Preface 13 | ------- 14 | 15 | This is Your First Cup: An Introduction to Java Platform, Enterprise 16 | Edition, a short tutorial for beginning Java EE programmers. This 17 | tutorial is designed to give you a hands-on lesson on developing an 18 | enterprise application from initial coding to deployment. 19 | 20 | [[sthref2]][[audience]] 21 | 22 | Audience 23 | ~~~~~~~~ 24 | 25 | This tutorial is intended for novice Java EE developers. You should be 26 | familiar with the Java programming language, particularly the features 27 | introduced in Java Platform, Standard Edition 8. While familiarity with 28 | enterprise development and Java EE technologies is helpful, this 29 | tutorial assumes you are new to developing Java EE applications. 30 | 31 | [[sthref3]][[documentation-accessibility]] 32 | 33 | Documentation Accessibility 34 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 35 | 36 | For information about Oracle's commitment to accessibility, visit the 37 | Oracle Accessibility Program website at 38 | `http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc`. 39 | 40 | [[sthref4]] 41 | 42 | Access to Oracle Support 43 | 44 | Oracle customers that have purchased support have access to electronic 45 | support through My Oracle Support. For information, visit 46 | `http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info` or visit 47 | `http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs` if you are 48 | hearing impaired. 49 | 50 | [[GCQYU]][[before-you-read-this-book]] 51 | 52 | Before You Read This Book 53 | ~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | 55 | Before you start this tutorial, you should: 56 | 57 | * Be familiar with the Java programming language 58 | * Be able to install software on your work machine 59 | * Have a modern web browser installed on your work machine 60 | 61 | [[GCQXV]][[related-books-and-projects]] 62 | 63 | Related Books and Projects 64 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 65 | 66 | The following books and projects may be helpful to you in understanding 67 | this tutorial: 68 | 69 | * The https://javaee.github.io/tutorial[Java EE Tutorial] 70 | * The GlassFish Server Open Source Edition documentation set 71 | * The NetBeans IDE documentation 72 | 73 | [[sthref5]][[conventions]] 74 | 75 | Conventions 76 | ~~~~~~~~~~~ 77 | 78 | The following table describes the typographic conventions that are used 79 | in this book. 80 | 81 | [width="75%",cols="20%,39%,39%"] 82 | |======================================================================= 83 | |*Convention* |*Meaning* |*Example* 84 | |*Boldface* |Boldface type indicates graphical user interface elements 85 | associated with an action, or terms defined in text. a| 86 | From the *File* menu, select *New Project*. 87 | 88 | A *cache* is a copy that is stored locally. 89 | 90 | |`Monospace` |Monospace type indicates the names of files and 91 | directories, commands within a paragraph, URLs, code in examples, text 92 | that appears on the screen, or text that you enter. a| 93 | Edit your `.login` file. 94 | 95 | Use `ls -a` to list all files. 96 | 97 | `_machine_name_% you have mail.` 98 | 99 | |_Italic_ |Italic type indicates book titles, emphasis, or placeholder 100 | variables for which you supply particular values. a| 101 | The command to remove a file is `rm _filename_`. 102 | 103 | Read Chapter 6 in the _User's Guide_. 104 | 105 | Do _not_ save the file. 106 | 107 | |======================================================================= 108 | -------------------------------------------------------------------------------- /src/main/jbake/content/title.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Java Platform, Enterprise Edition Your First Cup: An Introduction to the Java EE Platform, Release 8 4 | next=preface.html 5 | prev=toc.html 6 | ~~~~~~ 7 | = Java Platform, Enterprise Edition Your First Cup: An Introduction to the Java EE Platform, Release 8 8 | 9 | 10 | [[java-platform-enterprise-edition]] 11 | Java Platform, Enterprise Edition 12 | --------------------------------- 13 | 14 | Your First Cup: An Introduction to the Java EE Platform 15 | 16 | Release 8 17 | 18 | September 2017 19 | 20 | [[sthref1]] 21 | 22 | ''''' 23 | 24 | Java Platform, Enterprise Edition Your First Cup: An Introduction to the 25 | Java EE Platform, Release 8 26 | 27 | 28 | Copyright © 2017, 2019 Oracle and/or its affiliates. All rights reserved. 29 | 30 | This software and related documentation are provided under a license 31 | agreement containing restrictions on use and disclosure and are 32 | protected by intellectual property laws. Except as expressly permitted 33 | in your license agreement or allowed by law, you may not use, copy, 34 | reproduce, translate, broadcast, modify, license, transmit, distribute, 35 | exhibit, perform, publish, or display any part, in any form, or by any 36 | means. Reverse engineering, disassembly, or decompilation of this 37 | software, unless required by law for interoperability, is prohibited. 38 | 39 | The information contained herein is subject to change without notice 40 | and is not warranted to be error-free. If you find any errors, please 41 | report them to us in writing. 42 | 43 | If this is software or related documentation that is delivered to the 44 | U.S. Government or anyone licensing it on behalf of the U.S. Government, 45 | then the following notice is applicable: 46 | 47 | U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, 48 | integrated software, any programs installed on the hardware, and/or 49 | documentation, delivered to U.S. Government end users are "commercial 50 | computer software" pursuant to the applicable Federal Acquisition Regulation 51 | and agency-specific supplemental regulations. As such, use, duplication, 52 | disclosure, modification, and adaptation of the programs, including any 53 | operating system, integrated software, any programs installed on the hardware, 54 | and/or documentation, shall be subject to license terms and license 55 | restrictions applicable to the programs. No other rights are granted to the 56 | U.S. Government. 57 | 58 | This software or hardware is developed for general use in a variety of 59 | information management applications. It is not developed or intended for use 60 | in any inherently dangerous applications, including applications that may 61 | create a risk of personal injury. If you use this software or hardware in 62 | dangerous applications, then you shall be responsible to take all appropriate 63 | fail-safe, backup, redundancy, and other measures to ensure its safe use. 64 | Oracle Corporation and its affiliates disclaim any liability for any damages 65 | caused by use of this software or hardware in dangerous applications. 66 | 67 | Oracle and Java are registered trademarks of Oracle and/or its affiliates. 68 | Other names may be trademarks of their respective owners. 69 | 70 | Intel and Intel Xeon are trademarks or registered trademarks of Intel 71 | Corporation. All SPARC trademarks are used under license and are trademarks 72 | or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD 73 | logo, and the AMD Opteron logo are trademarks or registered trademarks of 74 | Advanced Micro Devices. UNIX is a registered trademark of The Open Group. 75 | 76 | This software or hardware and documentation may provide access to or 77 | information about content, products, and services from third parties. 78 | Oracle Corporation and its affiliates are not responsible for and expressly 79 | disclaim all warranties of any kind with respect to third-party content, 80 | products, and services unless otherwise set forth in an applicable agreement 81 | between you and Oracle. Oracle Corporation and its affiliates will not be 82 | responsible for any loss, costs, or damages incurred due to your access to or 83 | use of third-party content, products, or services, except as set forth in an 84 | applicable agreement between you and Oracle. 85 | 86 | This documentation is in prerelease status and is intended for 87 | demonstration and preliminary use only. It may not be specific to the 88 | hardware on which you are using the software. Oracle Corporation and 89 | its affiliates are not responsible for and expressly disclaim all 90 | warranties of any kind with respect to this documentation and will not 91 | be responsible for any loss, costs, or damages incurred due to the use 92 | of this documentation. 93 | -------------------------------------------------------------------------------- /src/main/jbake/content/toc.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Java Platform, Enterprise Edition Your First Cup: An Introduction to the Java EE Platform Java Platform, Enterprise Edition, Release 8 4 | next=title.html 5 | ~~~~~~ 6 | Java Platform, Enterprise Edition Your First Cup: An Introduction to the Java EE Platform Java Platform, Enterprise Edition, Release 8 7 | ====================================================================================================================================== 8 | 9 | [[contents]] 10 | = Contents 11 | 12 | 13 | [[title-and-copyright-information]] 14 | link:title.html[Title and Copyright Information] 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 | 17 | [[preface]] 18 | link:preface.html#GCQYW[Preface] 19 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 20 | 21 | * link:preface.html#sthref2[Audience] 22 | * link:preface.html#sthref3[Documentation Accessibility] 23 | * link:preface.html#GCQYU[Before You Read This Book] 24 | * link:preface.html#GCQXV[Related Books and Projects] 25 | * link:preface.html#sthref5[Conventions] 26 | 27 | [[introduction]] 28 | link:intro.html#GCQYB[1 Introduction] 29 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 30 | 31 | * link:intro001.html#GCQYJ[Goals of This Tutorial] 32 | * link:intro002.html#GCQZL[Prerequisite Tasks for Completing This 33 | Tutorial] 34 | 35 | ** link:intro002.html#software-compatibility[Software Compatibility Notice] 36 | 37 | ** link:intro002.html#GCRNX[Get the Java EE 8 SDK] 38 | 39 | ** link:intro002.html#GCRNU[Install the NetBeans IDE Distribution for 40 | Java EE] 41 | 42 | ** link:intro002.html#GIOEW[Add GlassFish Server as a Server in NetBeans 43 | IDE] 44 | 45 | //// 46 | ** link:intro002.html#GIMVN[Get the Latest Updates to this Tutorial] 47 | //// 48 | 49 | [[understanding-java-platform-enterprise-edition]] 50 | link:java-ee.html#GCRLO[2 Understanding Java Platform, Enterprise Edition] 51 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 52 | 53 | * link:java-ee001.html#GCRKY[Overview of Enterprise Applications] 54 | 55 | ** link:java-ee001.html#GCRKR[Tiered Applications] 56 | *** link:java-ee001.html#GCRLA[The Client Tier] 57 | *** link:java-ee001.html#GCRNL[The Web Tier] 58 | *** link:java-ee001.html#GCRLS[The Business Tier] 59 | *** link:java-ee001.html#GCRKW[The Enterprise Information Systems Tier] 60 | * link:java-ee002.html#GCRKQ[Java EE Servers and Containers] 61 | 62 | ** link:java-ee002.html#GCRMB[The Web Container] 63 | 64 | ** link:java-ee002.html#GCRMA[The EJB Container] 65 | 66 | ** link:java-ee002.html#GCRLJ[The Application Client Container] 67 | 68 | [[creating-your-first-java-ee-application]] 69 | link:creating-example.html#GCRKP[3 Creating Your First Java EE Application] 70 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | 72 | * link:creating-example001.html#GKHQT[Architecture of the Example 73 | Applications] 74 | 75 | ** link:creating-example001.html#GCRLR[Tiers in the Example Applications] 76 | 77 | ** link:creating-example001.html#GCRLU[Java EE Technologies Used in the 78 | Example Applications] 79 | * link:creating-example002.html#GCRKM[Coding the dukes-age Example 80 | Application] 81 | 82 | ** link:creating-example002.html#GCSKG[Getting Started] 83 | *** link:creating-example002.html#GCSKJ[Install the Maven Archetypes] 84 | 85 | ** link:creating-example002.html#GCRKN[Creating the Web Service] 86 | *** link:creating-example002.html#GCROM[JAX-RS Resources] 87 | *** link:creating-example002.html#GCROI[Creating the dukes-age 88 | Application Using the Maven Archetype] 89 | *** link:creating-example002.html#sthref9[Starting GlassFish Server and 90 | the Database Server] 91 | *** link:creating-example002.html#GCTOZ[Building and Deploying the Web 92 | Service Endpoint] 93 | 94 | [[creating-your-second-web-application]] 95 | link:web-application.html#GLCFC[4 Creating Your Second Web Application] 96 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 97 | 98 | * link:web-application001.html#GJBCA[The firstcup-war Project] 99 | * link:web-application002.html#GIMNT[Creating the Web Application Project 100 | Using the Archetype] 101 | * link:web-application003.html#GJBCS[Modifying the Java Persistence API 102 | Entity] 103 | 104 | ** link:web-application003.html#GKKNN[Edit the Constructor of the 105 | FirstcupUser Entity] 106 | 107 | ** link:web-application003.html#GJBCM[Add a Named Query to the 108 | FirstcupUser Entity] 109 | * link:web-application004.html#GCRLX[Modifying the Enterprise Bean] 110 | 111 | ** link:web-application004.html#GJBCU[Implement a Business Method to 112 | DukesBirthdayBean that Gets the Average Age Difference of firstcup-war 113 | Users] 114 | 115 | ** link:web-application004.html#GKGOT[Implement a Business Method for 116 | Calculating the Age Difference Between Duke and the User] 117 | * link:web-application005.html#GCRLT[Modifying the Web Client] 118 | 119 | ** link:web-application005.html#GCRQX[Modify the DukesBDay Managed Bean 120 | Class] 121 | *** link:web-application005.html#sthref10[Call the dukes-age Web Service 122 | to Retrieve Duke's Current Age] 123 | *** link:web-application005.html#GCRSA[Get the Age Difference from the 124 | DukesBirthdayBean Enterprise Bean] 125 | 126 | ** link:web-application005.html#GIMVD[Creating the Facelets Client] 127 | *** link:web-application005.html#GIMUG[Resource Libraries in 128 | firstcup-war] 129 | *** link:web-application005.html#GIMTW[The inputDate Composite Component] 130 | *** link:web-application005.html#GIMWV[Implement the inputDate Composite 131 | Component] 132 | *** link:web-application005.html#GIMUM[The Facelets Web Interface] 133 | *** link:web-application005.html#GIMTA[Add the Form to greeting.xhtml] 134 | *** link:web-application005.html#GIMVW[Add the Form to response.html] 135 | * link:web-application006.html#GCTNX[Building, Packaging, Deploying, and 136 | Running the firstcup-war Web Application] 137 | 138 | ** link:web-application006.html#GCTOJ[Build, Package, and Deploy the 139 | firstcup-war Web Application] 140 | 141 | ** link:web-application006.html#GCTQC[Run the firstcup-war Application] 142 | 143 | [[next-steps]] 144 | link:next-steps.html#GCRLL[5 Next Steps] 145 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 146 | 147 | * link:next-steps001.html#GCRLH[The Java EE Tutorial] 148 | * link:next-steps002.html#GKHRA[More Information on the Java EE Platform] 149 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Creating Your Second Web Application 4 | next=web-application001.html 5 | prev=creating-example002.html 6 | ~~~~~~ 7 | = Creating Your Second Web Application 8 | 9 | 10 | [[GLCFC]][[creating-your-second-web-application]] 11 | 12 | 4 Creating Your Second Web Application 13 | -------------------------------------- 14 | 15 | This chapter gives step-by-step instructions on coding and running the 16 | `firstcup-war` web application, which uses the `dukes-age` web service 17 | described in link:creating-example.html#GCRKP[Chapter 3, "Creating Your 18 | First Java EE Application"]. The `firstcup-war` web application is a 19 | more complicated application that uses several different Java EE APIs. 20 | 21 | * link:web-application001.html#GJBCA[The firstcup-war Project] 22 | * link:web-application002.html#GIMNT[Creating the Web Application Project 23 | Using the Archetype] 24 | * link:web-application003.html#GJBCS[Modifying the Java Persistence API 25 | Entity] 26 | * link:web-application004.html#GCRLX[Modifying the Enterprise Bean] 27 | * link:web-application005.html#GCRLT[Modifying the Web Client] 28 | * link:web-application006.html#GCTNX[Building, Packaging, Deploying, and 29 | Running the firstcup-war Web Application] 30 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application001.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=The firstcup-war Project 4 | next=web-application002.html 5 | prev=web-application.html 6 | ~~~~~~ 7 | = The firstcup-war Project 8 | 9 | 10 | [[GJBCA]][[the-firstcup-war-project]] 11 | 12 | The firstcup-war Project 13 | ------------------------ 14 | 15 | The `firstcup-war` web application project consists of the Java 16 | Persistence API entity, the enterprise bean, and the JavaServer Faces 17 | web front end. 18 | 19 | The `firstcup-war` example application consumes the data from the 20 | `dukes-age` web service using the JAX-RS client API. A JavaServer Faces 21 | web front end asks users to enter their birthdays to find out who is 22 | older, the user or Duke. This data is stored in an Apache Derby database table 23 | using the Java Persistence API. The business logic, which provides the 24 | core functionality of the application, is handled by an enterprise bean. 25 | 26 | All the tiers described in link:java-ee001.html#GCRKR[Tiered 27 | Applications] are present in the `firstcup-war` web application. The web 28 | or client tier is the JavaServer Faces front end. The enterprise 29 | information systems, or EIS, tier is the Derby database. The business 30 | tier is the enterprise bean. 31 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application002.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Creating the Web Application Project Using the Archetype 4 | next=web-application003.html 5 | prev=web-application001.html 6 | ~~~~~~ 7 | = Creating the Web Application Project Using the Archetype 8 | 9 | 10 | [[GIMNT]][[creating-the-web-application-project-using-the-archetype]] 11 | 12 | Creating the Web Application Project Using the Archetype 13 | -------------------------------------------------------- 14 | 15 | Follow these steps to create a new web application project using the 16 | `firstcup-war-archetype` in NetBeans IDE. 17 | 18 | 1. From the *File* menu, select *New Project*. 19 | 2. Under *Projects*, select *Project from Archetype*. 20 | 3. Click *Next*. 21 | 4. In the *Search* field, enter `firstcup`. 22 | 5. In the *Known Archetypes* field, select `firstcup-war-archetype`. 23 | 6. Click *Next*. 24 | 7. In the *Project Name* field, enter `firstcup-war`. 25 | 8. In the *Package* field, enter `firstcup`. 26 | 9. Click *Finish*. 27 | + 28 | You should now see the module you created in the *Projects* tab. 29 | 30 | The `firstcup-war-archetype` archetype creates the structure of the web 31 | application, including the following: 32 | 33 | * Basic entity classes 34 | * Basic enterprise bean classes 35 | * Basic backing bean classes 36 | * Basic Facelets XHTML components and views 37 | * The `web.xml`, `faces-config.xml`, and `persistence.xml` deployment 38 | descriptors 39 | 40 | After you create the basic application structure with the archetype, you 41 | will configure how the application will run, implement the functionality 42 | of the classes, implement the Facelets views, and then deploy the 43 | application. 44 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application003.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Modifying the Java Persistence API Entity 4 | next=web-application004.html 5 | prev=web-application002.html 6 | ~~~~~~ 7 | = Modifying the Java Persistence API Entity 8 | 9 | 10 | [[GJBCS]][[modifying-the-java-persistence-api-entity]] 11 | 12 | Modifying the Java Persistence API Entity 13 | ----------------------------------------- 14 | 15 | The Java Persistence API allows you to create and use Java programming 16 | language classes that represent data in a database table. A Java 17 | Persistence API _entity_ is a lightweight, persistent Java programming 18 | language object that represents data in a data store. To create or 19 | modify entities, or to remove them from the data store, call the 20 | operations of the Java Persistence API _entity manager_. To query 21 | entities, or to query the data encapsulated by the persistent fields or 22 | properties of a entity, use the Java Persistence Query Language (JPQL), 23 | a language similar to SQL that operates on entities. 24 | 25 | In `firstcup-war`, there is a single entity that defines one query. 26 | 27 | [[GKKNN]][[edit-the-constructor-of-the-firstcupuser-entity]] 28 | 29 | Edit the Constructor of the FirstcupUser Entity 30 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 | 32 | Add code to the constructor for `FirstcupUser`. 33 | 34 | 1. Expand the *Source Packages* node, expand the `firstcup.entity` node, 35 | then double-click the `FirstcupUser.java` file to open it in the editor 36 | window. 37 | 2. Below the field definitions in the `FirstcupUser` class, add the 38 | following code in bold to the second, two-argument constructor: 39 | + 40 | [source,oac_no_warn,subs=+quotes] 41 | ---- 42 | public FirstcupUser(Date date, int difference) { 43 | *Calendar cal = new GregorianCalendar(); 44 | cal.setTime(date); 45 | birthday = cal; 46 | ageDifference = difference;* 47 | } 48 | ---- 49 | 3. Right-click in the editor window and select *Format*. 50 | 51 | [[GJBCM]][[add-a-named-query-to-the-firstcupuser-entity]] 52 | 53 | Add a Named Query to the FirstcupUser Entity 54 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | 56 | Add a JPQL named query to the `FirstcupUser` entity that returns the 57 | average age difference of all `firstcup-war` users. 58 | 59 | This query uses the `AVG` aggregate function to return the average of 60 | all the values of the `ageDifference` property of the `FirstcupUser` 61 | entities. 62 | 63 | 1. Directly before the class definition, copy and paste in the 64 | following code: 65 | + 66 | [source,oac_no_warn] 67 | ---- 68 | @NamedQuery(name="findAverageAgeDifferenceOfAllFirstcupUsers", 69 | query="SELECT AVG(u.ageDifference) FROM FirstcupUser u") 70 | ---- 71 | + 72 | The `@NamedQuery` annotation appears just before the class definition of 73 | the entity and has two required attributes: `name`, with the unique name 74 | for this query; and `query`, the JPQL query definition. 75 | 2. Right-click in the editor window and select *Format*. 76 | 3. From the *File* menu, select *Save*. 77 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application004.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Modifying the Enterprise Bean 4 | next=web-application005.html 5 | prev=web-application003.html 6 | ~~~~~~ 7 | = Modifying the Enterprise Bean 8 | 9 | 10 | [[GCRLX]][[modifying-the-enterprise-bean]] 11 | 12 | Modifying the Enterprise Bean 13 | ----------------------------- 14 | 15 | `DukesBirthdayBean` is a _stateless session bean_. Stateless session beans 16 | are enterprise beans that do not maintain a conversational state with a 17 | client. With stateless session beans, the client makes isolated requests 18 | that do not depend on any previous state or requests. If an application 19 | requires conversational state, use _stateful session beans_. 20 | 21 | `DukesBirthdayBean` is a local enterprise bean that uses a no-interface 22 | view: 23 | 24 | * A _local enterprise bean_ is visible only within the application in 25 | which it is deployed. 26 | * Enterprise beans with a _no-interface_ view do not need a separate 27 | business interface that the enterprise bean class implements. The 28 | enterprise bean class is the only coding artifact needed to create a 29 | local, no-interface enterprise bean. 30 | 31 | `DukesBirthdayBean` will be packaged within the same WAR file as the 32 | Facelets web front end. 33 | 34 | [[GJBCU]][[implement-a-business-method-to-dukesbirthdaybean-that-gets-the-average-age-difference-of-firstcup-war-users]] 35 | 36 | Implement a Business Method to DukesBirthdayBean that Gets the Average Age Difference of firstcup-war Users 37 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 | 39 | Add code to a business method to the `DukesBirthdayBean` session bean to 40 | call the `findAverageAgeDifferenceOfAllFirstcupUsers` named query in 41 | `FirstcupUser` that returns the average age difference of all users. 42 | 43 | 1. Expand the *Source Packages* node, expand the `firstcup.ejb` node, 44 | then double-click the `DukesBirthdayBean.java` file to open it in the 45 | editor window. 46 | 2. Find the business method called `getAverageAgeDifference` and add 47 | the following code in bold by copying and pasting: 48 | + 49 | [source,oac_no_warn,subs=+quotes] 50 | ---- 51 | public Double getAverageAgeDifference() { 52 | *Double avgAgeDiff = (Double) 53 | em.createNamedQuery("findAverageAgeDifferenceOfAllFirstcupUsers") 54 | .getSingleResult(); 55 | logger.log(Level.INFO, "Average age difference is: {0}", avgAgeDiff); 56 | return avgAgeDiff;* 57 | } 58 | ---- 59 | + 60 | The named query in `FirstcupUser` is called by using the `createNamedQuery` method 61 | in `EntityManager`. Because this query returns 62 | a single number, the `getSingleResult` method is called on the returned 63 | `Query` object. The query returns a `Double`. 64 | 3. Right-click in the editor window and select *Format*. 65 | 66 | [[GKGOT]][[implement-a-business-method-for-calculating-the-age-difference-between-duke-and-the-user]] 67 | 68 | Implement a Business Method for Calculating the Age Difference Between Duke and the User 69 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | 71 | Add code to a business method that calculates the difference in age in 72 | years between Duke and the user and creates a new `FirstcupUser` entity. 73 | 74 | 1. Find the `getAgeDifference` business method and add the following 75 | code in bold: 76 | + 77 | [source,oac_no_warn,subs=+quotes] 78 | ---- 79 | public int getAgeDifference(Date date) { 80 | *int ageDifference; 81 | 82 | Calendar theirBirthday = new GregorianCalendar(); 83 | Calendar dukesBirthday = new GregorianCalendar(1995, Calendar.MAY, 23); 84 | 85 | // Set the Calendar object to the passed-in Date 86 | theirBirthday.setTime(date); 87 | 88 | // Subtract the user's age from Duke's age 89 | ageDifference = dukesBirthday.get(Calendar.YEAR) 90 | - theirBirthday.get(Calendar.YEAR); 91 | logger.log(Level.INFO, "Raw ageDifference is: {0}", ageDifference); 92 | // Check to see if Duke's birthday occurs before the user's. If so, 93 | // subtract one from the age difference 94 | if (dukesBirthday.before(theirBirthday) && (ageDifference> 0)) { 95 | ageDifference--; 96 | } 97 | 98 | // Create and store the user's birthday in the database 99 | FirstcupUser user = new FirstcupUser(date, ageDifference); 100 | em.persist(user); 101 | 102 | logger.log(Level.INFO, "Final ageDifference is: {0}", ageDifference); 103 | 104 | return ageDifference;* 105 | } 106 | ---- 107 | + 108 | This method creates the `Calendar` objects used to calculate the 109 | difference in age between the user and Duke and performs the actual 110 | calculation of the difference in age. 111 | + 112 | Similar to the `DukesAgeResource.getText` code, `getAgeDifference` 113 | subtracts Duke's birthday year from the user's birthday year to get a 114 | raw age difference. If Duke's birthday falls before the user's, and the 115 | raw difference is more than 0, it subtracts one year from the age 116 | difference. 117 | + 118 | A new `FirstcupUser` entity is created with the user's birthday and age 119 | difference, then stored in Derby by calling the `persist` method 120 | in `EntityManager`. 121 | + 122 | The final age difference is returned as an `int`. 123 | 2. Right-click in the editor window and select *Format*. 124 | 3. From the *File* menu, choose *Save*. 125 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application005.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Modifying the Web Client 4 | next=web-application006.html 5 | prev=web-application004.html 6 | ~~~~~~ 7 | = Modifying the Web Client 8 | 9 | 10 | [[GCRLT]][[modifying-the-web-client]] 11 | 12 | Modifying the Web Client 13 | ------------------------ 14 | 15 | To add the correct functionality to the web client, you need to perform 16 | the following tasks: 17 | 18 | * Modify the `DukesBDay` managed bean class 19 | * Modify the Facelets pages 20 | 21 | [[GCRQX]][[modify-the-dukesbday-managed-bean-class]] 22 | 23 | Modify the DukesBDay Managed Bean Class 24 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 25 | 26 | `DukesBDay` is a CDI managed bean that acts as a backing bean. A managed 27 | bean is a lightweight container-managed object that supports a set of 28 | basic services. A backing bean is a managed bean that provides temporary 29 | data storage for the values of the components included on a particular 30 | JavaServer Faces page. The JavaServer Faces application instantiates the 31 | managed bean and stores it in scope. The section following this one 32 | describes more about managed beans and how to configure them. 33 | 34 | This section describes how to modify the `DukesBDay` class. 35 | 36 | [[sthref10]][[call-the-dukes-age-web-service-to-retrieve-dukes-current-age]] 37 | 38 | Call the dukes-age Web Service to Retrieve Duke's Current Age 39 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 40 | 41 | Now modify the `getAge` method of `DukesBDay` to call the `dukes-age` 42 | web service using the JAX-RS Client API. This will retrieve Duke's 43 | current age, so it can be compared to the user's age. 44 | 45 | 1. Expand the *Source Packages* node, expand the `firstcup.web` node, 46 | then double-click the `DukesBDay.java` file to open it in the editor 47 | window. 48 | 2. Find the `getAge` method and implement its functionality by copying 49 | and pasting the following code in bold: 50 | + 51 | [source,oac_no_warn,subs=+quotes] 52 | ---- 53 | public int getAge() { 54 | *try { 55 | Client client = ClientBuilder.newClient(); 56 | WebTarget target = 57 | client.target("http://localhost:8080/dukes-age/webapi/dukesAge"); 58 | String response = target.request().get(String.class); 59 | age = Integer.parseInt(response); 60 | } catch (IllegalArgumentException | NullPointerException | 61 | WebApplicationException ex) { 62 | logger.severe("processing of HTTP response failed"); 63 | } 64 | return age;* 65 | } 66 | ---- 67 | 3. In the editor window, right-click and select *Format*. 68 | 4. From the *File* menu, select *Save*. 69 | 70 | [[GCRSA]][[get-the-age-difference-from-the-dukesbirthdaybean-enterprise-bean]] 71 | 72 | Get the Age Difference from the DukesBirthdayBean Enterprise Bean 73 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 74 | 75 | Now modify the `processBirthday` method to get the difference in age 76 | between the user's age and Duke's age from the `DukesBirthdayBean` EJB, 77 | set the `absAgeDiff` variable to the absolute value of the age 78 | difference, and set a result string that will forward the user to the 79 | display page. 80 | 81 | 1. Find the `processBirthday` method and implement the functionality by 82 | copying and pasting the following code in bold: 83 | + 84 | [source,oac_no_warn,subs=+quotes] 85 | ---- 86 | public String processBirthday() { 87 | *this.setAgeDiff(dukesBirthdayBean.getAgeDifference(yourBD)); 88 | logger.log(Level.INFO, "age diff from dukesbday {0}", ageDiff); 89 | this.setAbsAgeDiff(Math.abs(this.getAgeDiff())); 90 | logger.log(Level.INFO, "absAgeDiff {0}", absAgeDiff); 91 | this.setAverageAgeDifference(dukesBirthdayBean.getAverageAgeDifference()); 92 | logger.log(Level.INFO, "averageAgeDifference {0}", averageAgeDifference); 93 | return "/response.xhtml";* 94 | } 95 | ---- 96 | + 97 | This method calls the `getAgeDifference` method of `DukesBirthdayBean` 98 | to get the age difference and store it in the `ageDiff` property, sets 99 | the absolute age difference stored in the `absAgeDiff` property, and 100 | sets the average age difference stored in the `averageAgeDifference` 101 | property. It returns the relative URL of the response page to which the 102 | user will be forwarded. 103 | 2. In the editor window, right-click and select *Format*. 104 | 3. From the *File* menu, select *Save*. 105 | 106 | [[GIMVD]][[creating-the-facelets-client]] 107 | 108 | Creating the Facelets Client 109 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 110 | 111 | The Facelets client consists of a _resource library_, a _composite 112 | component_, and two XHTML files. 113 | 114 | [[GIMUG]][[resource-libraries-in-firstcup-war]] 115 | 116 | Resource Libraries in firstcup-war 117 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 118 | 119 | A JavaServer Faces resource library is a collection of user-created 120 | components collected in a standard location in a web application. 121 | Resource libraries are identified according to a _resource identifier_, a 122 | string that represents a particular resource within a web application. 123 | Resources can be packaged either at the root of the web application or 124 | on the web application's classpath. 125 | 126 | A resource packaged in the web application root must be in a 127 | subdirectory of a `resources` directory at the web application root. 128 | 129 | [source,oac_no_warn,subs=+quotes] 130 | ---- 131 | resources/_resource-identifier_ 132 | ---- 133 | 134 | A resource packaged in the web application classpath must be in a 135 | subdirectory of the `META-INF/resources` directory within a web 136 | application. 137 | 138 | [source,oac_no_warn,subs=+quotes] 139 | ---- 140 | META-INF/resources/_resource-identifier_ 141 | ---- 142 | 143 | Resource identifiers are unique strings that conform to the following 144 | format: 145 | 146 | [source,oac_no_warn,subs=+quotes] 147 | ---- 148 | [_locale-prefix_/][_library-name_ /][_library-version_/]_resource-name_ [/_resource-version_] 149 | ---- 150 | 151 | Elements of the resource identifier in brackets (`[]`) are optional. A 152 | resource name, identifying a particular resource (a file or a graphic, 153 | for example), is required. In `firstcup-war`, a resource library with 154 | the name `components` is packaged in the web application root, and this 155 | library contains one resource, a file called `inputDate.xhtml`. The 156 | resource identifier for this resource is therefore 157 | `components/inputDate.xhtml`, and it is located in the web application 158 | root at `resources/components/inputDate.xhtml`. 159 | 160 | [[GIMTW]][[the-inputdate-composite-component]] 161 | 162 | The inputDate Composite Component 163 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 164 | 165 | A composite component is a set of user-defined JavaServerFaces and 166 | Facelets components located in a resource. In `firstcup-war`, the 167 | `inputDate.xhtml` resource, located in the `components` resource 168 | library, is a composite component that contains tags for reading in a 169 | date the user enters in a form. Composite components consist of an 170 | _interface_ definition and an _implementation_. 171 | 172 | The interface definition is specified with the `` tag to 173 | define which attributes are exposed to pages that use the composite 174 | component. Attributes are identified with the `` tag. 175 | 176 | The `inputDate.xhtml` interface definition is as follows. It defines a 177 | single attribute, `date`, that must be specified in pages that use the 178 | `inputDate` composite component. 179 | 180 | [source,oac_no_warn] 181 | ---- 182 | 183 | 184 | 185 | ---- 186 | 187 | The implementation of the composite component is specified with the 188 | `` tag. The tags within the `` are 189 | the actual component tags that will be added to pages that use the 190 | composite component. They can be any HTML render kit, JavaServer Faces, 191 | or Facelets tags. The `#{cc.attrs.``attribute-name``}` expression is 192 | used to get the value of the specified attribute from the page or 193 | component that is using the composite component. 194 | 195 | The implementation of the `inputDate` composite component is as follows. 196 | An HTML input text component will store the entered text into the `date` 197 | attribute, accessed by the `#{cc.attrs.date}` expression. A JavaServer 198 | Faces `convertDateTime` component will convert the entered text to a 199 | date with the form of `MM/dd/yyyy` (04/13/2014, for example). 200 | 201 | [source,oac_no_warn] 202 | ---- 203 | 204 | 205 | 206 | 207 |

208 | 209 | 210 | ---- 211 | 212 | If there's an error with the input of the `inputText` component, the 213 | form submission is unsuccessful, and a warning message is displayed. The 214 | message output is specified by the `` tag, which is connected 215 | to the `inputText` component that has the id `getdate`. 216 | 217 | [[GIMWV]][[implement-the-inputdate-composite-component]] 218 | 219 | Implement the inputDate Composite Component 220 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 221 | 222 | Modify the `inputDate` composite component in the `components` resource 223 | library. 224 | 225 | 1. Expand *Web Pages*, then `resources`, then `components`, and open 226 | `inputDate.xhtml`. 227 | 2. Add the composite component interface definition between the opening 228 | and closing `` tags in `inputDate.xhtml`: 229 | + 230 | [source,oac_no_warn,subs=+quotes] 231 | ---- 232 | 233 | ** 234 | 235 | ---- 236 | 3. Add the composite component implementation between the opening and 237 | closing `cc:implementation` tags: 238 | + 239 | [source,oac_no_warn,subs=+quotes] 240 | ---- 241 | 242 | * 243 | 244 | 245 |

246 | * 247 | 248 | ---- 249 | 4. In the editor window, right-click and select *Format*. 250 | 5. From the *File* menu, select *Save*. 251 | 252 | [[GIMUM]][[the-facelets-web-interface]] 253 | 254 | The Facelets Web Interface 255 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 256 | 257 | The `firstcup-war` web application interface has two XHTML files. The 258 | `greeting.xhtml` file displays Duke's current age and the form where the 259 | user can enter a birthday. The `response.xhtml` file displays the age 260 | difference between the user and Duke. 261 | 262 | The `greeting.xhtml` file contains several pieces of the `firstcup-war` 263 | application detailed previously. It uses the localized strings contained 264 | in `WebMessages.properties` and `WebMessages_es.properties`. It uses the 265 | `DukesBDay` managed bean to call both the `DukesAgeResource` JAX-RS web 266 | service and the `DukesBirthdayBean` enterprise bean. It uses the 267 | `inputDate` composite component to create the input for the user to 268 | enter a birthday. 269 | 270 | Here's the content of the `greeting.xhtml` file. 271 | 272 | [source,oac_no_warn] 273 | ---- 274 | 275 | 278 | 281 | 282 | Firstcup Greeting Page 283 | 284 | 285 | 286 |

287 | 288 |

289 | 290 | 291 |

292 | 293 |

294 | 295 | 296 |

297 | 299 | 300 | 301 | 302 | 303 | ---- 304 | 305 | The `greeting.xhtml` file uses the HTML RenderKit and the `components` 306 | resource library tag libraries. The `components` tag library has a 307 | prefix of `fc`, and is used to specify the `inputDate` composite 308 | component in the form below. The 309 | `` tag has 310 | the required `date` attribute, and it stores the value in the `yourBD` 311 | property in the `DukesBDay` managed bean by using the EL expression 312 | `#{dukesBDay.yourBD}`. 313 | 314 | The localized strings are referenced by the EL expressions 315 | `\#{bundle.``property-name``}`. For example, the 316 | `` tag will display the 317 | following string in English locales: 318 | 319 | [source,oac_no_warn] 320 | ---- 321 | Hi. I'm Duke. Let's find out who's older -- you or I. 322 | ---- 323 | 324 | The `` tag creates a Submit button and specifies that a 325 | successful submission should render the `response.xhtml` file by setting 326 | the `action` attribute to `#{dukesBDay.processBirthday}`. The 327 | `processBirthday` method returns the value `"/response.xhtml"`. The 328 | `action` attribute is used to define navigation rules for forms in 329 | Facelets pages. 330 | 331 | The `response.xhtml` file displays the age difference between the user 332 | and Duke and the average age difference of all users so far. Different 333 | strings are displayed based on whether the user is the same age, 334 | younger, or older than Duke. The text can be displayed or not based on 335 | the conditions specified by the `rendered` attribute of the 336 | `` tag. The conditions used in the `rendered` attribute 337 | are Expression Language (EL) alternatives to the Java programming 338 | language conditional operators to allow XML parsing of the XHTML file. 339 | 340 | [[sthref11]][[GIMVG]] 341 | 342 | Table 4-1 Conditional Operator EL Language Alternatives 343 | 344 | [width="60%",cols="25%,40%,35%"] 345 | |======================================================================= 346 | |*Logical Condition* |*Java Programming Language Conditional Operator* |*EL 347 | Alternative* 348 | |AND a| 349 | `&&` 350 | 351 | 352 | a| 353 | `&&` 354 | 355 | 356 | |EQUALS a| 357 | `==` 358 | 359 | 360 | a| 361 | `==` 362 | 363 | 364 | |LESS THAN a| 365 | `<` 366 | 367 | 368 | |`lt` 369 | 370 | |GREATER THAN |`>` |`gt` 371 | |======================================================================= 372 | 373 | 374 | Here's the content of the `response.xhtml` file. 375 | 376 | [source,oac_no_warn] 377 | ---- 378 | 379 | 381 | 383 | 384 | Response Page 385 | 386 | 387 | 388 | 389 | 391 | 393 | 395 | 397 | 399 | 401 | 403 | 405 | 407 |

408 | 410 |

411 | 412 | 413 | 414 | 415 | ---- 416 | 417 | For example, the `\#{bundle.SameAge}` string is displayed if the user and 418 | Duke have the same birthday, as specified by the condition 419 | `#{dukesBDay.ageDiff == 0}` in the `rendered` attribute. That is, the 420 | following string is displayed when the `ageDiff` property of `DukesBDay` 421 | equals `0`: 422 | 423 | [source,oac_no_warn] 424 | ---- 425 | You are the same age as Duke! 426 | ---- 427 | 428 | The form also contains a `` tag that creates a *Back* 429 | button, which directs the user back to the `greeting.xhtml` page, as 430 | specified in the `action` attribute. 431 | 432 | [[GIMTA]][[add-the-form-to-greeting.xhtml]] 433 | 434 | Add the Form to greeting.xhtml 435 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 436 | 437 | Add the form that provides the user interface for displaying Duke's age 438 | and specifying the user's birthday. 439 | 440 | 1. In the *Projects* tab, double-click `greeting.xhtml` in the 441 | `firstcup-war` project and, in the editor window, replace the text 442 | between the `` and `` tags with the following: 443 | + 444 | [source,oac_no_warn] 445 | ---- 446 |

447 | 448 |

449 | 450 | 451 |

452 | 453 |

454 | 455 | 456 |

457 | 459 | ---- 460 | 2. In the editor window, right-click and select *Format*. 461 | 3. From the *File* menu, select *Save*. 462 | 463 | [[GIMVW]][[add-the-form-to-response.html]] 464 | 465 | Add the Form to response.html 466 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 467 | 468 | Add a form that displays the age difference between Duke and the user, 469 | displays the average age difference of all users, and allows the user to 470 | navigate back to `greeting.xhtml`. 471 | 472 | 1. In the *Projects* tab, double-click `response.xhtml` in the 473 | `firstcup-war` project and, in the editor window, replace the text 474 | between the `` and `` tags with the following: 475 | + 476 | [source,oac_no_warn] 477 | ---- 478 | 479 | 481 | 483 | 485 | 487 | 489 | 491 | 493 | 495 | 497 |

498 | 500 |

501 | 502 | ---- 503 | 2. In the editor window, right-click and select *Format*. 504 | 3. From the *File* menu, select *Save*. 505 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application006.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Building, Packaging, Deploying, and Running the firstcup-war Web Application 4 | next=next-steps.html 5 | prev=web-application005.html 6 | ~~~~~~ 7 | = Building, Packaging, Deploying, and Running the firstcup-war Web Application 8 | 9 | 10 | [[GCTNX]][[building-packaging-deploying-and-running-the-firstcup-war-web-application]] 11 | 12 | Building, Packaging, Deploying, and Running the firstcup-war Web Application 13 | ---------------------------------------------------------------------------- 14 | 15 | In this section, you will build the `firstcup-war` web application, 16 | deploy it to the server, and run the application. 17 | 18 | [[GCTOJ]][[build-package-and-deploy-the-firstcup-war-web-application]] 19 | 20 | Build, Package, and Deploy the firstcup-war Web Application 21 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 22 | 23 | Now build and package the `DukesBirthdayBean` enterprise bean, the 24 | `FirstcupUser` entity, and the `firstcup-war` web client into a WAR 25 | file, `firstcup-war.war`, then deploy it to the server. 26 | 27 | 1. In the *Projects* tab, select the `firstcup-war` project. 28 | 2. Right-click `firstcup-war` and select *Run*. 29 | 30 | After `firstcup-war.war` deploys successfully to GlassFish Server, a web 31 | browser will load the application URL. 32 | 33 | [[GCTQC]][[run-the-firstcup-war-application]] 34 | 35 | Run the firstcup-war Application 36 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 37 | 38 | 1. On the greeting page, enter your birth date in the *Your birthday* 39 | field. Make sure you use the date pattern specified on the page: 40 | MM/dd/yyyy. 41 | 2. Click *Submit*. 42 | 3. After the `response.xhtml` page is displayed, click *Back* to return 43 | to the `greeting.xhtml` page. 44 | 4. Enter a different birthday in the text field and click *Submit* again 45 | to see how the average age of First Cup users changes. 46 | -------------------------------------------------------------------------------- /src/main/jbake/jbake.properties: -------------------------------------------------------------------------------- 1 | site.host=http://jbake.org 2 | render.tags=false 3 | render.sitemap=false 4 | render.archive=false 5 | render.feed=false 6 | asciidoctor.option.safe=0 7 | asciidoctor.attributes.export=true -------------------------------------------------------------------------------- /src/main/jbake/templates/footer.ftl: -------------------------------------------------------------------------------- 1 | <#-- a footer template fragment included in the page template --> 2 |


3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <#if content.prev??> 12 | 18 | 19 | 20 | <#if content.next??> 21 | 27 | 28 | 29 | 35 | 36 |
13 | 14 | 15 | Previous 16 | 17 | 22 | 23 | 24 | Next 25 | 26 | 30 | 31 | 32 | Contents 33 | 34 |
37 | 38 | 39 | 40 | Oracle Logo  41 | Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/jbake/templates/header.ftl: -------------------------------------------------------------------------------- 1 | 2 | <#-- a header template fragment included in the page template --> 3 | 4 | 5 | 6 | <#if (content.title)??><#escape x as x?xml>${content.title}</#escape></#if> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 |
15 | Java Platform, Enterprise Edition (Java EE) 8
16 | Your First Cup: An Introduction to the Java EE Platform 17 | 18 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | <#if content.prev??> 31 | 37 | 38 | 39 | <#if content.next??> 40 | 46 | 47 | 48 | 54 | 55 |
32 | 33 | 34 | Previous 35 | 36 | 41 | 42 | 43 | Next 44 | 45 | 49 | 50 | 51 | Contents 52 | 53 |
56 | 57 | -------------------------------------------------------------------------------- /src/main/jbake/templates/menu.ftl: -------------------------------------------------------------------------------- 1 | <#-- a menu bar template fragment included in the page template --> -------------------------------------------------------------------------------- /src/main/jbake/templates/page.ftl: -------------------------------------------------------------------------------- 1 | <#-- a top level page layout template --> 2 | 3 | <#include "header.ftl"> 4 | <#include "menu.ftl"> 5 | 6 | ${content.body} 7 | 8 | <#include "footer.ftl"> --------------------------------------------------------------------------------