diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5dcac45f --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +*.ipr +*.iml +*.iws +*.swp +*~ +/target/ +.idea +nbactions.xml +.classpath +.project +.settings/ +downloads/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..76309137 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,30 @@ +--- + +--- + +# Source Code Submissions +We welcome your contributions and look forward to collaborating with you. We can only accept source code repository +submissions from users who have signed and returned the Oracle +Contributor Agreement. You will find details and the agreement to sign at this OTN web page: +[Oracle Contributor Agreement](http://www.oracle.com/technetwork/community/oca-486395.html). + +# Other Contributions +For all project Submissions other than source code repository contributions, the following also applies: Oracle does +not claim ownership of Your Submissions. However, in order to fulfill +the purposes of this project, You must give Oracle and all Users +the right to post, access, discuss, use, publish, disseminate, and refine +Your Submissions. + +In legalese: *You hereby grant to Oracle and all +Users a royalty-free, perpetual, irrevocable, worldwide, non-exclusive, +and fully sub-licensable right and license, under Your intellectual +property rights, to reproduce, modify, adapt, publish, translate, create +derivative works from, distribute, perform, display, and use Your +Submissions (in whole or part) and to incorporate or implement them in +other works in any form, media, or technology now known or later +developed, all subject to the obligation to retain any copyright notices +included in Your Submissions. All Users, Oracle, and their +sublicensees are responsible for any modifications they make to the +Submissions of others.* + +Copyright © 2017 Oracle and/or its affiliates. All rights reserved. diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..b1c74f95 --- /dev/null +++ b/LICENSE @@ -0,0 +1,759 @@ +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1 + +1. Definitions. + + 1.1. "Contributor" means each individual or entity that creates or + contributes to the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original + Software, prior Modifications used by a Contributor (if any), and + the Modifications made by that particular Contributor. + + 1.3. "Covered Software" means (a) the Original Software, or (b) + Modifications, or (c) the combination of files containing Original + Software with files containing Modifications, in each case including + portions thereof. + + 1.4. "Executable" means the Covered Software in any form other than + Source Code. + + 1.5. "Initial Developer" means the individual or entity that first + makes Original Software available under this License. + + 1.6. "Larger Work" means a work which combines Covered Software or + portions thereof with code not governed by the terms of this License. + + 1.7. "License" means this document. + + 1.8. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means the Source Code and Executable form of + any of the following: + + A. Any file that results from an addition to, deletion from or + modification of the contents of a file containing Original Software + or previous Modifications; + + B. Any new file that contains any part of the Original Software or + previous Modification; or + + C. Any new file that is contributed or otherwise made available + under the terms of this License. + + 1.10. "Original Software" means the Source Code and Executable form + of computer software code that is originally released under this + License. + + 1.11. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, process, + and apparatus claims, in any patent Licensable by grantor. + + 1.12. "Source Code" means (a) the common form of computer software + code in which modifications are made and (b) associated + documentation included in or with such code. + + 1.13. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms of, + this License. For legal entities, "You" includes any entity which + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject + to third party intellectual property claims, the Initial Developer + hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer, to use, reproduce, + modify, display, perform, sublicense and distribute the Original + Software (or portions thereof), with or without Modifications, + and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using or selling of + Original Software, to make, have made, use, practice, sell, and + offer for sale, and/or otherwise dispose of the Original Software + (or portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) are effective on + the date Initial Developer first distributes or otherwise makes the + Original Software available to a third party under the terms of this + License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: (1) for code that You delete from the Original Software, or + (2) for infringements caused by: (i) the modification of the + Original Software, or (ii) the combination of the Original Software + with other software or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject + to third party intellectual property claims, each Contributor hereby + grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor to use, reproduce, modify, + display, perform, sublicense and distribute the Modifications + created by such Contributor (or portions thereof), either on an + unmodified basis, with other Modifications, as Covered Software + and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or selling + of Modifications made by that Contributor either alone and/or in + combination with its Contributor Version (or portions of such + combination), to make, use, sell, offer for sale, have made, and/or + otherwise dispose of: (1) Modifications made by that Contributor (or + portions thereof); and (2) the combination of Modifications made by + that Contributor with its Contributor Version (or portions of such + combination). + + (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective + on the date Contributor first distributes or otherwise makes the + Modifications available to a third party. + + (d) Notwithstanding Section 2.2(b) above, no patent license is + granted: (1) for any code that Contributor has deleted from the + Contributor Version; (2) for infringements caused by: (i) third + party modifications of Contributor Version, or (ii) the combination + of Modifications made by that Contributor with other software + (except as part of the Contributor Version) or other devices; or (3) + under Patent Claims infringed by Covered Software in the absence of + Modifications made by that Contributor. + +3. Distribution Obligations. + + 3.1. Availability of Source Code. + + Any Covered Software that You distribute or otherwise make available + in Executable form must also be made available in Source Code form + and that Source Code form must be distributed only under the terms + of this License. You must include a copy of this License with every + copy of the Source Code form of the Covered Software You distribute + or otherwise make available. You must inform recipients of any such + Covered Software in Executable form as to how they can obtain such + Covered Software in Source Code form in a reasonable manner on or + through a medium customarily used for software exchange. + + 3.2. Modifications. + + The Modifications that You create or to which You contribute are + governed by the terms of this License. You represent that You + believe Your Modifications are Your original creation(s) and/or You + have sufficient rights to grant the rights conveyed by this License. + + 3.3. Required Notices. + + You must include a notice in each of Your Modifications that + identifies You as the Contributor of the Modification. You may not + remove or alter any copyright, patent or trademark notices contained + within the Covered Software, or any notices of licensing or any + descriptive text giving attribution to any Contributor or the + Initial Developer. + + 3.4. Application of Additional Terms. + + You may not offer or impose any terms on any Covered Software in + Source Code form that alters or restricts the applicable version of + this License or the recipients' rights hereunder. You may choose to + offer, and to charge a fee for, warranty, support, indemnity or + liability obligations to one or more recipients of Covered Software. + However, you may do so only on Your own behalf, and not on behalf of + the Initial Developer or any Contributor. You must make it + absolutely clear that any such warranty, support, indemnity or + liability obligation is offered by You alone, and You hereby agree + to indemnify the Initial Developer and every Contributor for any + liability incurred by the Initial Developer or such Contributor as a + result of warranty, support, indemnity or liability terms You offer. + + 3.5. Distribution of Executable Versions. + + You may distribute the Executable form of the Covered Software under + the terms of this License or under the terms of a license of Your + choice, which may contain terms different from this License, + provided that You are in compliance with the terms of this License + and that the license for the Executable form does not attempt to + limit or alter the recipient's rights in the Source Code form from + the rights set forth in this License. If You distribute the Covered + Software in Executable form under a different license, You must make + it absolutely clear that any terms which differ from this License + are offered by You alone, not by the Initial Developer or + Contributor. You hereby agree to indemnify the Initial Developer and + every Contributor for any liability incurred by the Initial + Developer or such Contributor as a result of any such terms You offer. + + 3.6. Larger Works. + + You may create a Larger Work by combining Covered Software with + other code not governed by the terms of this License and distribute + the Larger Work as a single product. In such a case, You must make + sure the requirements of this License are fulfilled for the Covered + Software. + +4. Versions of the License. + + 4.1. New Versions. + + Oracle is the initial license steward and may publish revised and/or + new versions of this License from time to time. Each version will be + given a distinguishing version number. Except as provided in Section + 4.3, no one other than the license steward has the right to modify + this License. + + 4.2. Effect of New Versions. + + You may always continue to use, distribute or otherwise make the + Covered Software available under the terms of the version of the + License under which You originally received the Covered Software. If + the Initial Developer includes a notice in the Original Software + prohibiting it from being distributed or otherwise made available + under any subsequent version of the License, You must distribute and + make the Covered Software available under the terms of the version + of the License under which You originally received the Covered + Software. Otherwise, You may also choose to use, distribute or + otherwise make the Covered Software available under the terms of any + subsequent version of the License published by the license steward. + + 4.3. Modified Versions. + + When You are an Initial Developer and You want to create a new + license for Your Original Software, You may create and use a + modified version of this License if You: (a) rename the license and + remove any references to the name of the license steward (except to + note that the license differs from this License); and (b) otherwise + make it clear that the license contains terms which differ from this + License. + +5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE + IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR + NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF + THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE + DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY + OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, + REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN + ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS + AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +6. TERMINATION. + + 6.1. This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to + cure such breach within 30 days of becoming aware of the breach. + Provisions which, by their nature, must remain in effect beyond the + termination of this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding + declaratory judgment actions) against Initial Developer or a + Contributor (the Initial Developer or Contributor against whom You + assert such claim is referred to as "Participant") alleging that the + Participant Software (meaning the Contributor Version where the + Participant is a Contributor or the Original Software where the + Participant is the Initial Developer) directly or indirectly + infringes any patent, then any and all rights granted directly or + indirectly to You by such Participant, the Initial Developer (if the + Initial Developer is not the Participant) and all Contributors under + Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice + from Participant terminate prospectively and automatically at the + expiration of such 60 day notice period, unless if within such 60 + day period You withdraw Your claim with respect to the Participant + Software against such Participant either unilaterally or pursuant to + a written agreement with Participant. + + 6.3. If You assert a patent infringement claim against Participant + alleging that the Participant Software directly or indirectly + infringes any patent where such claim is resolved (such as by + license or settlement) prior to the initiation of patent + infringement litigation, then the reasonable value of the licenses + granted by such Participant under Sections 2.1 or 2.2 shall be taken + into account in determining the amount or value of any payment or + license. + + 6.4. In the event of termination under Sections 6.1 or 6.2 above, + all end user licenses that have been validly granted by You or any + distributor hereunder prior to termination (excluding licenses + granted to You by any distributor) shall survive termination. + +7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE + INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF + COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE + TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT + LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER + FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR + LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE + POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT + APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH + PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH + LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR + LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION + AND LIMITATION MAY NOT APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + + The Covered Software is a "commercial item," as that term is defined + in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer + software" (as that term is defined at 48 C.F.R. ยง + 252.227-7014(a)(1)) and "commercial computer software documentation" + as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent + with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 + (June 1995), all U.S. Government End Users acquire Covered Software + with only those rights set forth herein. This U.S. Government Rights + clause is in lieu of, and supersedes, any other FAR, DFAR, or other + clause or provision that addresses Government rights in computer + software under this License. + +9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed by + the law of the jurisdiction specified in a notice contained within + the Original Software (except to the extent applicable law, if any, + provides otherwise), excluding such jurisdiction's conflict-of-law + provisions. Any litigation relating to this License shall be subject + to the jurisdiction of the courts located in the jurisdiction and + venue specified in a notice contained within the Original Software, + with the losing party responsible for costs, including, without + limitation, court costs and reasonable attorneys' fees and expenses. + The application of the United Nations Convention on Contracts for + the International Sale of Goods is expressly excluded. Any law or + regulation which provides that the language of a contract shall be + construed against the drafter shall not apply to this License. You + agree that You alone are responsible for compliance with the United + States export administration regulations (and the export control + laws and regulation of any other countries) when You use, distribute + or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or indirectly, + out of its utilization of rights under this License and You agree to + work with Initial Developer and Contributors to distribute such + responsibility on an equitable basis. Nothing herein is intended or + shall be deemed to constitute any admission of liability. + +------------------------------------------------------------------------ + +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION +LICENSE (CDDL) + +The code released under the CDDL shall be governed by the laws of the +State of California (excluding conflict-of-law provisions). Any +litigation relating to this License shall be subject to the jurisdiction +of the Federal Courts of the Northern District of California and the +state courts of the State of California, with venue lying in Santa Clara +County, California. + + + + The GNU General Public License (GPL) Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor +Boston, MA 02110-1335 +USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to +share and change it. By contrast, the GNU General Public License is +intended to guarantee your freedom to share and change free software--to +make sure the software is free for all its users. This General Public +License applies to most of the Free Software Foundation's software and +to any other program whose authors commit to using it. (Some other Free +Software Foundation software is covered by the GNU Library General +Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. +Our General Public Licenses are designed to make sure that you have the +freedom to distribute copies of free software (and charge for this +service if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone +to deny you these rights or to ask you to surrender the rights. These +restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis +or for a fee, you must give the recipients all the rights that you have. +You must make sure that they, too, receive or can get the source code. +And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software patents. +We wish to avoid the danger that redistributors of a free program will +individually obtain patent licenses, in effect making the program +proprietary. To prevent this, we have made it clear that any patent must +be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a +notice placed by the copyright holder saying it may be distributed under +the terms of this General Public License. The "Program", below, refers +to any such program or work, and a "work based on the Program" means +either the Program or any derivative work under copyright law: that is +to say, a work containing the Program or a portion of it, either +verbatim or with modifications and/or translated into another language. +(Hereinafter, translation is included without limitation in the term +"modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of running +the Program is not restricted, and the output from the Program is +covered only if its contents constitute a work based on the Program +(independent of having been made by running the Program). Whether that +is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously +and appropriately publish on each copy an appropriate copyright notice +and disclaimer of warranty; keep intact all the notices that refer to +this License and to the absence of any warranty; and give any other +recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of +it, thus forming a work based on the Program, and copy and distribute +such modifications or work under the terms of Section 1 above, provided +that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any part + thereof, to be licensed as a whole at no charge to all third parties + under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a notice + that there is no warranty (or else, saying that you provide a + warranty) and that users may redistribute the program under these + conditions, and telling the user how to view a copy of this License. + (Exception: if the Program itself is interactive but does not + normally print such an announcement, your work based on the Program + is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, and +can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based on +the Program, the distribution of the whole must be on the terms of this +License, whose permissions for other licensees extend to the entire +whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of a +storage or distribution medium does not bring the other work under the +scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections 1 + and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your cost + of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed + only for noncommercial distribution and only if you received the + program in object code or executable form with such an offer, in + accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source code +means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to control +compilation and installation of the executable. However, as a special +exception, the source code distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies the +executable. + +If distribution of executable or object code is made by offering access +to copy from a designated place, then offering equivalent access to copy +the source code from the same place counts as distribution of the source +code, even though third parties are not compelled to copy the source +along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt otherwise +to copy, modify, sublicense or distribute the Program is void, and will +automatically terminate your rights under this License. However, parties +who have received copies, or rights, from you under this License will +not have their licenses terminated so long as such parties remain in +full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and all +its terms and conditions for copying, distributing or modifying the +Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further restrictions +on the recipients' exercise of the rights granted herein. You are not +responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot distribute +so as to satisfy simultaneously your obligations under this License and +any other pertinent obligations, then as a consequence you may not +distribute the Program at all. For example, if a patent license would +not permit royalty-free redistribution of the Program by all those who +receive copies directly or indirectly through you, then the only way you +could satisfy both it and this License would be to refrain entirely from +distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is implemented +by public license practices. Many people have made generous +contributions to the wide range of software distributed through that +system in reliance on consistent application of that system; it is up to +the author/donor to decide if he or she is willing to distribute +software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be +a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License may +add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among countries +not thus excluded. In such case, this License incorporates the +limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new +versions of the General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Program does not specify a version +number of this License, you may choose any version ever published by the +Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the +author to ask for permission. For software which is copyrighted by the +Free Software Foundation, write to the Free Software Foundation; we +sometimes make exceptions for this. Our decision will be guided by the +two goals of preserving the free status of all derivatives of our free +software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, +EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE +ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH +YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL +NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR +DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL +DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM +(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED +INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF +THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR +OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + One line to give the program's name and a brief idea of what it does. + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type + `show w'. This is free software, and you are welcome to redistribute + it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the commands +you use may be called something other than `show w' and `show c'; they +could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + program `Gnomovision' (which makes passes at compilers) written by + James Hacker. + + signature of Ty Coon, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications +with the library. If this is what you want to do, use the GNU Library +General Public License instead of this License. + +# + +Certain source files distributed by Oracle America, Inc. and/or its +affiliates are subject to the following clarification and special +exception to the GPLv2, based on the GNU Project exception for its +Classpath libraries, known as the GNU Classpath Exception, but only +where Oracle has expressly included in the particular source file's +header the words "Oracle designates this particular file as subject to +the "Classpath" exception as provided by Oracle in the LICENSE file +that accompanied this code." + +You should also note that Oracle includes multiple, independent +programs in this software package. Some of those programs are provided +under licenses deemed incompatible with the GPLv2 by the Free Software +Foundation and others. For example, the package includes programs +licensed under the Apache License, Version 2.0. Such programs are +licensed to you under their original licenses. + +Oracle facilitates your further distribution of this package by adding +the Classpath Exception to the necessary parts of its GPLv2 code, which +permits you to use that code in combination with other independent +modules not licensed under the GPLv2. However, note that this would +not permit you to commingle code under an incompatible license with +Oracle's GPLv2 licensed code by, for example, cutting and pasting such +code into a file also containing Oracle's GPLv2 licensed code and then +distributing the result. Additionally, if you were to remove the +Classpath Exception from any of the files to which it applies and +distribute the result, you would likely be required to license some or +all of the other code in that distribution under the GPLv2 as well, and +since the GPLv2 is incompatible with the license terms of some items +included in the distribution by Oracle, removing the Classpath +Exception could therefore effectively compromise your ability to +further distribute the package. + +Proceed with caution and we recommend that you obtain the advice of a +lawyer skilled in open source matters before removing the Classpath +Exception or making modifications to this package which may +subsequently be redistributed and/or involve the use of third party +software. + +CLASSPATH EXCEPTION +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License version 2 cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from or +based on this library. If you modify this library, you may extend this +exception to your version of the library, but you are not obligated to +do so. If you do not wish to do so, delete this exception statement +from your version. diff --git a/README.md b/README.md new file mode 100644 index 00000000..5cd7451d --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +Java Servlet API +================ + +Building +-------- + +Prerequisites: + +* JDK8+ +* Maven 3.0.3+ + +Run the build: + +`mvn install` + +The build runs copyright check and generates the jar, sources-jar and javadoc-jar by default. + +Checking findbugs +----------------- + +`mvn -DskipTests -Dfindbugs.threshold=Low findbugs:findbugs` + diff --git a/copyright-exclude b/copyright-exclude index c1c82ee4..2430b60f 100644 --- a/copyright-exclude +++ b/copyright-exclude @@ -1,2 +1,10 @@ -javax.servlet/copyright-exclude -javax.servlet/src/main/javadoc/doc-files/speclicense.html +copyright-exclude +LICENSE +README +CONTRIBUTING.md +src/main/javadoc/doc-files/expert-draft-bg-blank.graffle +src/main/javadoc/doc-files/expert-draft-bg-blank.png +src/main/javadoc/doc-files/expert-draft-bg-non-blank.graffle +src/main/javadoc/doc-files/expert-draft-bg-non-blank.png +src/main/javadoc/doc-files/expert-draft-bg.png +src/main/javadoc/doc-files/speclicense.html diff --git a/exclude.xml b/exclude.xml index d4292749..fbc31476 100644 --- a/exclude.xml +++ b/exclude.xml @@ -2,19 +2,19 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. The contents of this file are subject to the terms of either the GNU General Public License Version 2 only ("GPL") or the Common Development and Distribution License("CDDL") (collectively, the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the License at - https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - or packager/legal/LICENSE.txt. See the License for the specific + https://oss.oracle.com/licenses/CDDL+GPL-1.1 + or LICENSE.txt. See the License for the specific language governing permissions and limitations under the License. When distributing the software, include this License Header Notice in each - file and include the License file at packager/legal/LICENSE.txt. + file and include the License file at LICENSE.txt. GPL Classpath Exception: Oracle designates this particular file as subject to the "Classpath" diff --git a/pom.xml b/pom.xml index 3d0169b6..1a1198e2 100644 --- a/pom.xml +++ b/pom.xml @@ -3,19 +3,19 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. The contents of this file are subject to the terms of either the GNU General Public License Version 2 only ("GPL") or the Common Development and Distribution License("CDDL") (collectively, the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the License at - https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - or packager/legal/LICENSE.txt. See the License for the specific + https://oss.oracle.com/licenses/CDDL+GPL-1.1 + or LICENSE.txt. See the License for the specific language governing permissions and limitations under the License. When distributing the software, include this License Header Notice in each - file and include the License file at packager/legal/LICENSE.txt. + file and include the License file at LICENSE.txt. GPL Classpath Exception: Oracle designates this particular file as subject to the "Classpath" @@ -53,40 +53,40 @@ javax.servlet javax.servlet-api jar - 3.1.0 + 4.0.1 - 3.1 + 4.0 javax.servlet javax.servlet-api - 3.1.0 - Java Servlet 3.1 - Java Servlet 3.1 API Specification + 4.0.0 + Java Servlet 4.0 + Java Servlet 4.0 API Specification Oracle Corporation org.glassfish - 2.3.1 + 3.0.4 exclude.xml Low - 1.33 + 1.49 Java Servlet API - - http://servlet-spec.java.net + + https://javaee.github.io/servlet-spec/ - mode - Rajiv Mordani - http://weblogs.java.net/blog/mode + edburns + Ed Burns + http://purl.oclc.org/NET/edburns/ Oracle - lead + co-lead + developer - swchan2 + shingwaichan Shing Wai Chan - http://weblogs.java.net/blog/swchan2 Oracle lead @@ -94,44 +94,57 @@ + + + jvnet-nexus-snapshots + Java.net Nexus Snapshots Repository + https://maven.java.net/content/repositories/snapshots/ + + + jvnet-nexus-staging + Java.net Nexus Staging Repository + https://maven.java.net/service/local/staging/deploy/maven2/ + + GlassFish Community - https://glassfish.dev.java.net + https://javaee.github.io CDDL + GPLv2 with classpath exception - https://glassfish.dev.java.net/nonav/public/CDDL+GPL.html + https://oss.oracle.com/licenses/CDDL+GPL-1.1 repo A business-friendly OSS license - jira - http://java.net/jira/browse/SERVLET_SPEC + github + https://github.com/javaee/servlet-spec/issues Servlet Developer - users@servlet-spec.java.net + servlet-spec@javaee.groups.io - scm:svn:https://svn.java.net/svn/glassfish~svn/tags/javax.servlet-api-3.1.0 - scm:svn:https://svn.java.net/svn/glassfish~svn/tags/javax.servlet-api-3.1.0 - http://java.net/projects/glassfish/sources/svn/show/tags/javax.servlet-api-3.1.0 - + scm:git:https://github.com/javaee/servlet-spec.git + scm:git:git@github.com:javaee/servlet-spec.git + https://github.com/javaee/servlet-spec + 4.0.1 + maven-compiler-plugin - 2.0.2 + 3.1 - 1.7 - 1.7 - -Xlint:unchecked + 1.8 + 1.8 + -Xlint:all @@ -215,11 +228,13 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.8 + 2.10.4 src ${doc.title} ${window.title} + javax.servlet-api.css + true Servlet API Documentation @@ -227,7 +242,7 @@ -Oracle and/or its affiliates. All Rights Reserved. Use is subject to @@ -235,16 +250,46 @@ Portions Copyright © 1999-2002 The Apache Software Foundation. ]]> + + + implSpec + a + Implementation Requirements: + + + param + + + return + + + throws + + + since + + + version + + + serialData + + + factory + + + see + + - package - - javadoc - + + jar + - + org.codehaus.mojo findbugs-maven-plugin @@ -259,21 +304,43 @@ org.apache.maven.plugins maven-release-plugin + 2.5.3 forked-path false + @{project.version} ${release.arguments} + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.8.1 + + org.glassfish.copyright glassfish-copyright-maven-plugin ${copyright-plugin.version} + git + true ${basedir}/copyright-exclude + true + + + check-copyright + process-test-sources + + copyright + check + + + @@ -305,17 +372,4 @@ - - - - - - - glassfish-repository - http://download.java.net/maven/glassfish - - never - - - diff --git a/release.sh b/release.sh index 5404b980..6229b248 100755 --- a/release.sh +++ b/release.sh @@ -2,19 +2,19 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -# Copyright (c) 2012-2013 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012-2017 Oracle and/or its affiliates. All rights reserved. # # The contents of this file are subject to the terms of either the GNU # General Public License Version 2 only ("GPL") or the Common Development # and Distribution License("CDDL") (collectively, the "License"). You # may not use this file except in compliance with the License. You can # obtain a copy of the License at -# https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html -# or packager/legal/LICENSE.txt. See the License for the specific +# https://oss.oracle.com/licenses/CDDL+GPL-1.1 +# or LICENSE.txt. See the License for the specific # language governing permissions and limitations under the License. # # When distributing the software, include this License Header Notice in each -# file and include the License file at packager/legal/LICENSE.txt. +# file and include the License file at LICENSE.txt. # # GPL Classpath Exception: # Oracle designates this particular file as subject to the "Classpath" @@ -72,5 +72,5 @@ # https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8.ReleaseIt # http://aseng-wiki.us.oracle.com/asengwiki/display/GlassFish/Migrating+Maven+deployment+to+maven.java.net -mvn release:prepare -Prelease -mvn release:perform -Prelease +mvn -B release:prepare -Prelease +mvn -B release:perform -Prelease diff --git a/src/main/java/javax/servlet/AsyncContext.java b/src/main/java/javax/servlet/AsyncContext.java index 752c912d..68e29e60 100644 --- a/src/main/java/javax/servlet/AsyncContext.java +++ b/src/main/java/javax/servlet/AsyncContext.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -82,6 +82,13 @@ public interface AsyncContext { */ static final String ASYNC_CONTEXT_PATH = "javax.servlet.async.context_path"; + /** + * The name of the request attribute under which the original + * {@link javax.servlet.http.HttpServletMapping} is made available to the target of a + * {@link #dispatch(String)} or {@link #dispatch(ServletContext,String)} + */ + static final String ASYNC_MAPPING = "javax.servlet.async.mapping"; + /** * The name of the request attribute under which the original * path info is made available to the target of a @@ -167,7 +174,7 @@ public interface AsyncContext { * last dispatched by the container. * *

The following sequence illustrates how this will work: - *

+     * 
{@code
      * // REQUEST dispatch to /url/A
      * AsyncContext ac = request.startAsync();
      * ...
@@ -190,7 +197,7 @@ public interface AsyncContext {
      * ac = request.startAsync(request,response);
      * ...
      * ac.dispatch(); // ASYNC dispatch to /url/B
-     * 
+ * }
* *

This method returns immediately after passing the request * and response objects to a container managed thread, on which the @@ -452,6 +459,7 @@ public void addListener(AsyncListener listener, *

This method supports any annotations applicable to AsyncListener. * + * @param the class of the object to instantiate * @param clazz the AsyncListener class to instantiate * * @return the new AsyncListener instance diff --git a/src/main/java/javax/servlet/AsyncEvent.java b/src/main/java/javax/servlet/AsyncEvent.java index 2e1faa00..d1739ec1 100644 --- a/src/main/java/javax/servlet/AsyncEvent.java +++ b/src/main/java/javax/servlet/AsyncEvent.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/AsyncListener.java b/src/main/java/javax/servlet/AsyncListener.java index 41b9711d..ebe6cb36 100644 --- a/src/main/java/javax/servlet/AsyncListener.java +++ b/src/main/java/javax/servlet/AsyncListener.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/DispatcherType.java b/src/main/java/javax/servlet/DispatcherType.java index 44b7dd5e..65d1b18f 100644 --- a/src/main/java/javax/servlet/DispatcherType.java +++ b/src/main/java/javax/servlet/DispatcherType.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/Filter.java b/src/main/java/javax/servlet/Filter.java index 7b5f5506..7f67f46c 100644 --- a/src/main/java/javax/servlet/Filter.java +++ b/src/main/java/javax/servlet/Filter.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -61,9 +20,9 @@ import java.io.IOException; /** - * A filter is an object that performs filtering tasks on either the - * request to a resource (a servlet or static content), or on the response - * from a resource, or both. + *

A filter is an object that performs + * filtering tasks on either the request to a resource (a servlet or static content), or on the response + * from a resource, or both.

* *

Filters perform filtering in the doFilter method. * Every Filter has access to a FilterConfig object from which it can obtain @@ -92,22 +51,30 @@ public interface Filter { /** - * Called by the web container to indicate to a filter that it is - * being placed into service. + *

Called by the web container + * to indicate to a filter that it is being placed into service.

* *

The servlet container calls the init * method exactly once after instantiating the filter. The init * method must complete successfully before the filter is asked to do any - * filtering work. + * filtering work.

* *

The web container cannot place the filter into service if the init - * method either + * method either

*
    *
  1. Throws a ServletException *
  2. Does not return within a time period defined by the web container *
+ * + * @implSpec + * The default implementation takes no action. + * + * @param filterConfig a FilterConfig object containing the + * filter's configuration and initialization parameters + * @throws ServletException if an exception has occurred that interferes with + * the filter's normal operation */ - public void init(FilterConfig filterConfig) throws ServletException; + default public void init(FilterConfig filterConfig) throws ServletException {} /** @@ -137,6 +104,15 @@ public interface Filter { *
  • Directly set headers on the response after invocation of the * next entity in the filter chain. * + * + * @param request the ServletRequest object contains the client's request + * @param response the ServletResponse object contains the filter's response + * @param chain the FilterChain for invoking the next filter or the resource + * @throws IOException if an I/O related error has occurred during the processing + * @throws ServletException if an exception occurs that interferes with the + * filter's normal operation + * + * @see UnavailableException */ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) @@ -144,19 +120,22 @@ public void doFilter(ServletRequest request, ServletResponse response, /** - * Called by the web container to indicate to a filter that it is being - * taken out of service. + *

    Called by the web container + * to indicate to a filter that it is being + * taken out of service.

    * *

    This method is only called once all threads within the filter's * doFilter method have exited or after a timeout period has passed. * After the web container calls this method, it will not call the - * doFilter method again on this instance of the filter. + * doFilter method again on this instance of the filter.

    * *

    This method gives the filter an opportunity to clean up any * resources that are being held (for example, memory, file handles, * threads) and make sure that any persistent state is synchronized - * with the filter's current state in memory. + * with the filter's current state in memory.

    + * + * @implSpec + * The default implementation takes no action. */ - public void destroy(); + default public void destroy() {} } - diff --git a/src/main/java/javax/servlet/FilterChain.java b/src/main/java/javax/servlet/FilterChain.java index 6f26435a..cefe3872 100644 --- a/src/main/java/javax/servlet/FilterChain.java +++ b/src/main/java/javax/servlet/FilterChain.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -61,26 +20,27 @@ import java.io.IOException; /** - * A FilterChain is an object provided by the servlet container to the developer - * giving a view into the invocation chain of a filtered request for a resource. Filters - * use the FilterChain to invoke the next filter in the chain, or if the calling filter - * is the last filter in the chain, to invoke the resource at the end of the chain. - * - * @see Filter - * @since Servlet 2.3 - **/ + * A FilterChain is an object provided by the servlet container to the developer + * giving a view into the invocation chain of a filtered request for a resource. Filters + * use the FilterChain to invoke the next filter in the chain, or if the calling filter + * is the last filter in the chain, to invoke the resource at the end of the chain. + * + * @see Filter + * @since Servlet 2.3 + */ public interface FilterChain { - - /** - * Causes the next filter in the chain to be invoked, or if the calling filter is the last filter - * in the chain, causes the resource at the end of the chain to be invoked. - * - * @param request the request to pass along the chain. - * @param response the response to pass along the chain. - */ - - public void doFilter ( ServletRequest request, ServletResponse response ) throws IOException, ServletException; -} + /** + * Causes the next filter in the chain to be invoked, or if the calling filter is the last filter + * in the chain, causes the resource at the end of the chain to be invoked. + * + * @param request the request to pass along the chain. + * @param response the response to pass along the chain. + * @throws IOException if an I/O related error has occurred during the processing + * @throws ServletException if an exception has occurred that interferes with the + * filterChain's normal operation + */ + public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException; +} diff --git a/src/main/java/javax/servlet/FilterConfig.java b/src/main/java/javax/servlet/FilterConfig.java index 3990b536..95ce0a17 100644 --- a/src/main/java/javax/servlet/FilterConfig.java +++ b/src/main/java/javax/servlet/FilterConfig.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -72,6 +31,8 @@ public interface FilterConfig { /** * Returns the filter-name of this filter as defined in the deployment * descriptor. + * + * @return the filter name of this filter */ public String getFilterName(); diff --git a/src/main/java/javax/servlet/FilterRegistration.java b/src/main/java/javax/servlet/FilterRegistration.java index 0e93468a..99c95b9c 100644 --- a/src/main/java/javax/servlet/FilterRegistration.java +++ b/src/main/java/javax/servlet/FilterRegistration.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/GenericFilter.java b/src/main/java/javax/servlet/GenericFilter.java new file mode 100644 index 00000000..02e1e0fd --- /dev/null +++ b/src/main/java/javax/servlet/GenericFilter.java @@ -0,0 +1,254 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.servlet; + +import java.io.IOException; +import java.util.Enumeration; +import java.util.ResourceBundle; + +/** + * + *

    Defines a generic, protocol-independent + * filter. To write an HTTP filter for use on the + * Web, extend {@link javax.servlet.http.HttpFilter} instead.

    + * + *

    GenericFilter implements the Filter + * and FilterConfig interfaces. GenericFilter + * may be directly extended by a filter, although it's more common to extend + * a protocol-specific subclass such as HttpFilter. + * + *

    GenericFilter makes writing filters + * easier. It provides simple versions of the lifecycle methods + * init and destroy and of the methods + * in the FilterConfig interface. + * + *

    To write a generic filter, you need only + * override the abstract doFilter method. + * + * @author Various + * + * @since Servlet 4.0 + */ + + +public abstract class GenericFilter + implements Filter, FilterConfig, java.io.Serializable +{ + private static final String LSTRING_FILE = "javax.servlet.LocalStrings"; + private static final ResourceBundle lStrings = + ResourceBundle.getBundle(LSTRING_FILE); + + private transient FilterConfig config; + + + /** + * + *

    Does nothing. All of the filter initialization + * is done by one of the init methods.

    + * + * @since Servlet 4.0 + */ + public GenericFilter() { } + + + /** + *

    Returns a String containing the value of the named + * initialization parameter, or null if the parameter does + * not exist. See {@link FilterConfig#getInitParameter}.

    + * + *

    This method is supplied for convenience. It gets the + * value of the named parameter from the servlet's + * ServletConfig object. + * + * @param name a String specifying the name + * of the initialization parameter + * + * @return String a String containing the value + * of the initialization parameter + * + * @since Servlet 4.0 + * + */ + @Override + public String getInitParameter(String name) { + FilterConfig fc = getFilterConfig(); + if (fc == null) { + throw new IllegalStateException( + lStrings.getString("err.filter_config_not_initialized")); + } + + return fc.getInitParameter(name); + } + + + /** + *

    Returns the names of the filter's initialization parameters + * as an Enumeration of String objects, + * or an empty Enumeration if the filter has no + * initialization parameters. See {@link + * FilterConfig#getInitParameterNames}.

    + * + *

    This method is supplied for convenience. It gets the + * parameter names from the filter's FilterConfig object. + * + * @return Enumeration an enumeration of String + * objects containing the names of + * the filter's initialization parameters + * + * @since Servlet 4.0 + */ + @Override + public Enumeration getInitParameterNames() { + FilterConfig fc = getFilterConfig(); + if (fc == null) { + throw new IllegalStateException( + lStrings.getString("err.filter_config_not_initialized")); + } + + return fc.getInitParameterNames(); + } + + + /** + *

    Returns this servlet's {@link ServletConfig} object.

    + * + * @return FilterConfig the FilterConfig object + * that initialized this filter + * + * @since Servlet 4.0 + */ + public FilterConfig getFilterConfig() { + return config; + } + + + /** + *

    Returns a reference to the {@link ServletContext} in which this filter + * is running. See {@link FilterConfig#getServletContext}.

    + * + *

    This method is supplied for convenience. It gets the + * context from the filter's FilterConfig object. + * + * @return ServletContext the ServletContext object + * passed to this filter by the init + * method + * + * @since Servlet 4.0 + */ + @Override + public ServletContext getServletContext() { + FilterConfig sc = getFilterConfig(); + if (sc == null) { + throw new IllegalStateException( + lStrings.getString("err.filter_config_not_initialized")); + } + + return sc.getServletContext(); + } + + + /** + *

    Called by the servlet container to indicate to a filter that + * it is being placed into service. See {@link Filter#init}.

    + * + *

    This implementation stores the {@link FilterConfig} + * object it receives from the servlet container for later use. + * When overriding this form of the method, call + * super.init(config). + * + * @param config the FilterConfig object + * that contains configuration + * information for this filter + * + * @exception ServletException if an exception occurs that + * interrupts the servlet's normal + * operation + * + * @see UnavailableException + * + * @since Servlet 4.0 + */ + @Override + public void init(FilterConfig config) throws ServletException { + this.config = config; + this.init(); + } + + /** + *

    A convenience method which can be overridden so that there's no need + * to call super.init(config).

    + * + *

    Instead of overriding {@link #init(FilterConfig)}, simply override + * this method and it will be called by + * GenericFilter.init(FilterConfig config). + * The FilterConfig object can still be retrieved via {@link + * #getFilterConfig}. + * + * @exception ServletException if an exception occurs that + * interrupts the servlet's + * normal operation + * + * @since Servlet 4.0 + */ + public void init() throws ServletException { + + } + + + /** + *

    Returns the name of this filter instance. + * See {@link FilterConfig#getFilterName}.

    + * + * @return the name of this filter instance + * + * @since Servlet 4.0 + */ + @Override + public String getFilterName() { + FilterConfig sc = getFilterConfig(); + if (sc == null) { + throw new IllegalStateException( + lStrings.getString("err.servlet_config_not_initialized")); + } + + return sc.getFilterName(); + } +} diff --git a/src/main/java/javax/servlet/GenericServlet.java b/src/main/java/javax/servlet/GenericServlet.java index 686fb940..4a51a5bf 100644 --- a/src/main/java/javax/servlet/GenericServlet.java +++ b/src/main/java/javax/servlet/GenericServlet.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -230,7 +189,7 @@ public String getServletInfo() { * super.init(config). * * @param config the ServletConfig object - * that contains configutation + * that contains configuration * information for this servlet * * @exception ServletException if an exception occurs that diff --git a/src/main/java/javax/servlet/HttpConstraintElement.java b/src/main/java/javax/servlet/HttpConstraintElement.java index 69863561..47763a44 100644 --- a/src/main/java/javax/servlet/HttpConstraintElement.java +++ b/src/main/java/javax/servlet/HttpConstraintElement.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -93,7 +93,7 @@ public HttpConstraintElement(TransportGuarantee guarantee, * @param semantic EmptyRoleSemantic.DENY or * EmptyRoleSemantic.PERMIT * @param guarantee TransportGuarantee.NONE or - * TransportGuarantee.CONFIDENTIAL + * TransportGuarantee.CONFIDENTIAL * @param roleNames the names of the roles that are to be allowed * access, or missing if the semantic is EmptyRoleSemantic.DENY */ @@ -113,7 +113,7 @@ public HttpConstraintElement(EmptyRoleSemantic semantic, * *

    This value is insignificant when getRolesAllowed * returns a non-empty array, and should not be specified when a - * non-empty array is specified for getRolesAllowed. + * non-empty array is specified for getRolesAllowed. * * @return the {@link EmptyRoleSemantic} to be applied when * getRolesAllowed returns an empty (that is, zero-length) diff --git a/src/main/java/javax/servlet/HttpMethodConstraintElement.java b/src/main/java/javax/servlet/HttpMethodConstraintElement.java index 52640ff6..17bd88be 100644 --- a/src/main/java/javax/servlet/HttpMethodConstraintElement.java +++ b/src/main/java/javax/servlet/HttpMethodConstraintElement.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/LocalStrings.properties b/src/main/java/javax/servlet/LocalStrings.properties index a6c765a4..7a478e0d 100644 --- a/src/main/java/javax/servlet/LocalStrings.properties +++ b/src/main/java/javax/servlet/LocalStrings.properties @@ -1,46 +1,5 @@ # -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# -# Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. -# -# The contents of this file are subject to the terms of either the GNU -# General Public License Version 2 only ("GPL") or the Common Development -# and Distribution License("CDDL") (collectively, the "License"). You -# may not use this file except in compliance with the License. You can -# obtain a copy of the License at -# https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html -# or packager/legal/LICENSE.txt. See the License for the specific -# language governing permissions and limitations under the License. -# -# When distributing the software, include this License Header Notice in each -# file and include the License file at packager/legal/LICENSE.txt. -# -# GPL Classpath Exception: -# Oracle designates this particular file as subject to the "Classpath" -# exception as provided by Oracle in the GPL Version 2 section of the License -# file that accompanied this code. -# -# Modifications: -# If applicable, add the following below the License Header, with the fields -# enclosed by brackets [] replaced by your own identifying information: -# "Portions Copyright [year] [name of copyright owner]" -# -# Contributor(s): -# If you wish your version of this file to be governed by only the CDDL or -# only the GPL Version 2, indicate your decision by adding "[Contributor] -# elects to include this software in this distribution under the [CDDL or GPL -# Version 2] license." If you don't indicate a single choice of license, a -# recipient has the option to distribute your version of this file under -# either the CDDL, the GPL Version 2 or to extend the choice of license to -# its licensees as provided above. However, if you add GPL Version 2 code -# and therefore, elected the GPL Version 2 license, then the option applies -# only if the new code is made subject to such option by the copyright -# holder. -# -# -# This file incorporates work covered by the following copyright and -# permission notice: -# +# Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. # Copyright 2004 The Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/LocalStrings_fr.properties b/src/main/java/javax/servlet/LocalStrings_fr.properties index d90b8522..af9a2f07 100644 --- a/src/main/java/javax/servlet/LocalStrings_fr.properties +++ b/src/main/java/javax/servlet/LocalStrings_fr.properties @@ -1,46 +1,5 @@ # -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# -# Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. -# -# The contents of this file are subject to the terms of either the GNU -# General Public License Version 2 only ("GPL") or the Common Development -# and Distribution License("CDDL") (collectively, the "License"). You -# may not use this file except in compliance with the License. You can -# obtain a copy of the License at -# https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html -# or packager/legal/LICENSE.txt. See the License for the specific -# language governing permissions and limitations under the License. -# -# When distributing the software, include this License Header Notice in each -# file and include the License file at packager/legal/LICENSE.txt. -# -# GPL Classpath Exception: -# Oracle designates this particular file as subject to the "Classpath" -# exception as provided by Oracle in the GPL Version 2 section of the License -# file that accompanied this code. -# -# Modifications: -# If applicable, add the following below the License Header, with the fields -# enclosed by brackets [] replaced by your own identifying information: -# "Portions Copyright [year] [name of copyright owner]" -# -# Contributor(s): -# If you wish your version of this file to be governed by only the CDDL or -# only the GPL Version 2, indicate your decision by adding "[Contributor] -# elects to include this software in this distribution under the [CDDL or GPL -# Version 2] license." If you don't indicate a single choice of license, a -# recipient has the option to distribute your version of this file under -# either the CDDL, the GPL Version 2 or to extend the choice of license to -# its licensees as provided above. However, if you add GPL Version 2 code -# and therefore, elected the GPL Version 2 license, then the option applies -# only if the new code is made subject to such option by the copyright -# holder. -# -# -# This file incorporates work covered by the following copyright and -# permission notice: -# +# Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. # Copyright 2004 The Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/LocalStrings_ja.properties b/src/main/java/javax/servlet/LocalStrings_ja.properties index 52659bb8..7d557854 100644 --- a/src/main/java/javax/servlet/LocalStrings_ja.properties +++ b/src/main/java/javax/servlet/LocalStrings_ja.properties @@ -1,46 +1,5 @@ # -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# -# Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. -# -# The contents of this file are subject to the terms of either the GNU -# General Public License Version 2 only ("GPL") or the Common Development -# and Distribution License("CDDL") (collectively, the "License"). You -# may not use this file except in compliance with the License. You can -# obtain a copy of the License at -# https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html -# or packager/legal/LICENSE.txt. See the License for the specific -# language governing permissions and limitations under the License. -# -# When distributing the software, include this License Header Notice in each -# file and include the License file at packager/legal/LICENSE.txt. -# -# GPL Classpath Exception: -# Oracle designates this particular file as subject to the "Classpath" -# exception as provided by Oracle in the GPL Version 2 section of the License -# file that accompanied this code. -# -# Modifications: -# If applicable, add the following below the License Header, with the fields -# enclosed by brackets [] replaced by your own identifying information: -# "Portions Copyright [year] [name of copyright owner]" -# -# Contributor(s): -# If you wish your version of this file to be governed by only the CDDL or -# only the GPL Version 2, indicate your decision by adding "[Contributor] -# elects to include this software in this distribution under the [CDDL or GPL -# Version 2] license." If you don't indicate a single choice of license, a -# recipient has the option to distribute your version of this file under -# either the CDDL, the GPL Version 2 or to extend the choice of license to -# its licensees as provided above. However, if you add GPL Version 2 code -# and therefore, elected the GPL Version 2 license, then the option applies -# only if the new code is made subject to such option by the copyright -# holder. -# -# -# This file incorporates work covered by the following copyright and -# permission notice: -# +# Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. # Copyright 2004 The Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/MultipartConfigElement.java b/src/main/java/javax/servlet/MultipartConfigElement.java index a525e7ea..dd36f826 100644 --- a/src/main/java/javax/servlet/MultipartConfigElement.java +++ b/src/main/java/javax/servlet/MultipartConfigElement.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/ReadListener.java b/src/main/java/javax/servlet/ReadListener.java index c8582e22..82a5449f 100644 --- a/src/main/java/javax/servlet/ReadListener.java +++ b/src/main/java/javax/servlet/ReadListener.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2011-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -38,7 +38,6 @@ * holder. */ - package javax.servlet; import java.io.IOException; @@ -58,8 +57,9 @@ public interface ReadListener extends EventListener { * When an instance of the ReadListener is registered with a {@link ServletInputStream}, * this method will be invoked by the container the first time when it is possible * to read data. Subsequently the container will invoke this method if and only - * if {@link javax.servlet.ServletInputStream#isReady()} method - * has been called and has returned false. + * if the {@link javax.servlet.ServletInputStream#isReady()} method + * has been called and has returned a value of false and + * data has subsequently become available to read. * * @throws IOException if an I/O related error has occurred during processing */ @@ -75,6 +75,8 @@ public interface ReadListener extends EventListener { /** * Invoked when an error occurs processing the request. + * + * @param t the throwable to indicate why the read operation failed */ public void onError(Throwable t); diff --git a/src/main/java/javax/servlet/Registration.java b/src/main/java/javax/servlet/Registration.java index 663544fb..26df0911 100644 --- a/src/main/java/javax/servlet/Registration.java +++ b/src/main/java/javax/servlet/Registration.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -129,6 +129,10 @@ public interface Registration { * updates will be performed, and an IllegalArgumentException will be * thrown. * + *

    The returned set is not backed by the {@code Registration} object, + * so changes in the returned set are not reflected in the + * {@code Registration} object, and vice-versa.

    + * * @param initParameters the initialization parameters * * @return the (possibly empty) Set of initialization parameter names diff --git a/src/main/java/javax/servlet/RequestDispatcher.java b/src/main/java/javax/servlet/RequestDispatcher.java index f707a7e3..19cdacc0 100644 --- a/src/main/java/javax/servlet/RequestDispatcher.java +++ b/src/main/java/javax/servlet/RequestDispatcher.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -95,6 +54,16 @@ public interface RequestDispatcher { */ static final String FORWARD_CONTEXT_PATH = "javax.servlet.forward.context_path"; + /** + * The name of the request attribute under which the original + * {@link javax.servlet.http.HttpServletMapping} is made available + * to the target of a + * {@link #forward(ServletRequest,ServletResponse) forward} + * + * @since 4.0 + */ + static final String FORWARD_MAPPING = "javax.servlet.forward.mapping"; + /** * The name of the request attribute under which the original * path info is made available to the target of a @@ -137,6 +106,14 @@ public interface RequestDispatcher { */ static final String INCLUDE_PATH_INFO = "javax.servlet.include.path_info"; + /** + * The name of the request attribute under which the + * {@link javax.servlet.http.HttpServletMapping} + * of the target of an {@link #include(ServletRequest,ServletResponse) + * include} is stored + */ + static final String INCLUDE_MAPPING = "javax.servlet.include.mapping"; + /** * The name of the request attribute under which the servlet path * of the target of an {@link #include(ServletRequest,ServletResponse) diff --git a/src/main/java/javax/servlet/Servlet.java b/src/main/java/javax/servlet/Servlet.java index d5780a41..abb0250c 100644 --- a/src/main/java/javax/servlet/Servlet.java +++ b/src/main/java/javax/servlet/Servlet.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/ServletConfig.java b/src/main/java/javax/servlet/ServletConfig.java index 479e809c..2140916e 100644 --- a/src/main/java/javax/servlet/ServletConfig.java +++ b/src/main/java/javax/servlet/ServletConfig.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/ServletContainerInitializer.java b/src/main/java/javax/servlet/ServletContainerInitializer.java index 9ebdbdf6..a7e873e4 100644 --- a/src/main/java/javax/servlet/ServletContainerInitializer.java +++ b/src/main/java/javax/servlet/ServletContainerInitializer.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -59,7 +59,7 @@ * to {@link #onStartup}. * *

    When examining the classes of an application to see if they match - * any of the criteria specified by the HandlesTypes annontation + * any of the criteria specified by the HandlesTypes annotation * of a ServletContainerInitializer, the container may run into * classloading problems if any of the application's optional JAR * files are missing. Because the container is not in a position to decide diff --git a/src/main/java/javax/servlet/ServletContext.java b/src/main/java/javax/servlet/ServletContext.java index 3ba38e04..3bd5431d 100644 --- a/src/main/java/javax/servlet/ServletContext.java +++ b/src/main/java/javax/servlet/ServletContext.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -70,22 +29,22 @@ /** * Defines a set of methods that a servlet uses to communicate with its - * servlet container, for example, to get the MIME type of a file, dispatch - * requests, or write to a log file. + * servlet container, for example, to get the MIME type of a file, + * dispatch requests, or write to a log file. * *

    There is one context per "web application" per Java Virtual Machine. (A * "web application" is a collection of servlets and content installed under a * specific subset of the server's URL namespace such as /catalog - * and possibly installed via a .war file.) + * and possibly installed via a .war file.) * *

    In the case of a web * application marked "distributed" in its deployment descriptor, there will - * be one context instance for each virtual machine. In this situation, the + * be one context instance for each virtual machine. In this situation, the * context cannot be used as a location to share global information (because - * the information won't be truly global). Use an external resource like + * the information won't be truly global). Use an external resource like * a database instead. * - *

    The ServletContext object is contained within + *

    The ServletContext object is contained within * the {@link ServletConfig} object, which the Web server provides the * servlet when the servlet is initialized. * @@ -123,10 +82,10 @@ public interface ServletContext { * *

    The context path is the portion of the request URI that is used * to select the context of the request. The context path always comes - * first in a request URI. If this context is the โ€œdefaultโ€ context - * rooted at the base of the Web serverโ€™s URL name space, this path + * first in a request URI. If this context is the "root" context + * rooted at the base of the Web server's URL name space, this path * will be an empty string. Otherwise, if the context is not rooted at - * the root of the serverโ€™s name space, the path starts with a / + * the root of the server's name space, the path starts with a / * character but does not end with a / character. * *

    It is possible that a servlet container may match a context by @@ -138,7 +97,7 @@ public interface ServletContext { * prime or preferred context path of the application. * * @return The context path of the web application, or "" for the - * default (root) context + * root context * * @see javax.servlet.http.HttpServletRequest#getContextPath() * @@ -148,51 +107,51 @@ public interface ServletContext { /** - * Returns a ServletContext object that + * Returns a ServletContext object that * corresponds to a specified URL on the server. * *

    This method allows servlets to gain * access to the context for various parts of the server, and as * needed obtain {@link RequestDispatcher} objects from the context. - * The given path must be begin with /, is interpreted relative + * The given path must be begin with /, is interpreted relative * to the server's document root and is matched against the context * roots of other web applications hosted on this container. - * + * *

    In a security conscious environment, the servlet container may * return null for a given URL. - * + * * @param uripath a String specifying the context path of * another web application in the container. * @return the ServletContext object that * corresponds to the named URL, or null if either - none exists or the container wishes to restrict + none exists or the container wishes to restrict * this access. * * @see RequestDispatcher */ public ServletContext getContext(String uripath); - + /** * Returns the major version of the Servlet API that this * servlet container supports. All implementations that comply - * with Version 3.0 must have this method return the integer 3. + * with Version 4.0 must have this method return the integer 4. * - * @return 3 + * @return 4 */ public int getMajorVersion(); - - + + /** * Returns the minor version of the Servlet API that this * servlet container supports. All implementations that comply - * with Version 3.0 must have this method return the integer 0. + * with Version 4.0 must have this method return the integer 0. * * @return 0 */ public int getMinorVersion(); - - + + /** * Gets the major version of the Servlet specification that the * application represented by this ServletContext is based on. @@ -213,8 +172,8 @@ public interface ServletContext { * @since Servlet 3.0 */ public int getEffectiveMajorVersion(); - - + + /** * Gets the minor version of the Servlet specification that the * application represented by this ServletContext is based on. @@ -224,7 +183,7 @@ public interface ServletContext { * supported by the Servlet container. * * @return the minor version of the Servlet specification that the - * application xrepresented by this ServletContext is based on + * application represented by this ServletContext is based on * * @throws UnsupportedOperationException if this ServletContext was * passed to the {@link ServletContextListener#contextInitialized} method @@ -238,7 +197,7 @@ public interface ServletContext { /** - * Returns the MIME type of the specified file, or null if + * Returns the MIME type of the specified file, or null if * the MIME type is not known. The MIME type is determined * by the configuration of the servlet container, and may be specified * in a web application deployment descriptor. Common MIME @@ -249,7 +208,7 @@ public interface ServletContext { * @return a String specifying the file's MIME type */ public String getMimeType(String file); - + /** * Returns a directory-like listing of all the paths to resources @@ -263,9 +222,13 @@ public interface ServletContext { * directory of a JAR file inside the web application's * /WEB-INF/lib directory, and have a leading /. * + *

    The returned set is not backed by the {@code ServletContext} object, + * so changes in the returned set are not reflected in the + * {@code ServletContext} object, and vice-versa.

    + * *

    For example, for a web application containing: * - *

    +     * 
    {@code
          *   /welcome.html
          *   /catalog/index.html
          *   /catalog/products.html
    @@ -275,24 +238,24 @@ public interface ServletContext {
          *   /WEB-INF/web.xml
          *   /WEB-INF/classes/com.acme.OrderServlet.class
          *   /WEB-INF/lib/catalog.jar!/META-INF/resources/catalog/moreOffers/books.html
    -     * 
    - * + * }
    + * * getResourcePaths("/") would return * {"/welcome.html", "/catalog/", "/customer/", "/WEB-INF/"}, * and getResourcePaths("/catalog/") would return * {"/catalog/index.html", "/catalog/products.html", * "/catalog/offers/", "/catalog/moreOffers/"}. - * + * * @param path the partial path used to match the resources, * which must start with a / * @return a Set containing the directory listing, or null if there * are no resources in the web application whose path * begins with the supplied path. - * + * * @since Servlet 2.3 - */ + */ public Set getResourcePaths(String path); - + /** * Returns a URL to the resource that is mapped to the given path. @@ -308,10 +271,10 @@ public interface ServletContext { * The order in which the JAR files inside /WEB-INF/lib * are searched is undefined. * - *

    This method allows the servlet container to make a resource - * available to servlets from any source. Resources + *

    This method allows the servlet container to make a resource + * available to servlets from any source. Resources * can be located on a local or remote - * file system, in a database, or in a .war file. + * file system, in a database, or in a .war file. * *

    The servlet container must implement the URL handlers * and URLConnection objects that are necessary @@ -323,38 +286,38 @@ public interface ServletContext { *

    Some containers may allow writing to the URL returned by * this method using the methods of the URL class. * - *

    The resource content is returned directly, so be aware that + *

    The resource content is returned directly, so be aware that * requesting a .jsp page returns the JSP source code. - * Use a RequestDispatcher instead to include results of + * Use a RequestDispatcher instead to include results of * an execution. * *

    This method has a different purpose than * java.lang.Class.getResource, * which looks up resources based on a class loader. This * method does not use class loaders. - * + * * @param path a String specifying * the path to the resource * * @return the resource located at the named path, * or null if there is no resource at that path * - * @exception MalformedURLException if the pathname is not given in + * @exception MalformedURLException if the pathname is not given in * the correct form - */ + */ public URL getResource(String path) throws MalformedURLException; - + /** * Returns the resource located at the named path as * an InputStream object. * - *

    The data in the InputStream can be + *

    The data in the InputStream can be * of any type or length. The path must be specified according * to the rules given in getResource. * This method returns null if no resource exists at - * the specified path. - * + * the specified path. + * *

    Meta-information such as content length and content type * that is available via getResource * method is lost when using this method. @@ -363,28 +326,28 @@ public interface ServletContext { * and URLConnection objects necessary to access * the resource. * - *

    This method is different from + *

    This method is different from * java.lang.Class.getResourceAsStream, - * which uses a class loader. This method allows servlet containers + * which uses a class loader. This method allows servlet containers * to make a resource available * to a servlet from any location, without using a class loader. - * + * * * @param path a String specifying the path * to the resource * - * @return the InputStream returned to the + * @return the InputStream returned to the * servlet, or null if no resource - * exists at the specified path + * exists at the specified path */ public InputStream getResourceAsStream(String path); - + /** - * + * * Returns a {@link RequestDispatcher} object that acts * as a wrapper for the resource located at the given path. - * A RequestDispatcher object can be used to forward + * A RequestDispatcher object can be used to forward * a request to the resource or to include the resource in a response. * The resource can be dynamic or static. * @@ -402,7 +365,7 @@ public interface ServletContext { * * @return a RequestDispatcher object * that acts as a wrapper for the resource - * at the specified path, or null if + * at the specified path, or null if * the ServletContext cannot return * a RequestDispatcher * @@ -416,12 +379,12 @@ public interface ServletContext { * Returns a {@link RequestDispatcher} object that acts * as a wrapper for the named servlet. * - *

    Servlets (and JSP pages also) may be given names via server + *

    Servlets (and JSP pages also) may be given names via server * administration or via a web application deployment descriptor. - * A servlet instance can determine its name using + * A servlet instance can determine its name using * {@link ServletConfig#getServletName}. * - *

    This method returns null if the + *

    This method returns null if the * ServletContext * cannot return a RequestDispatcher for any reason. * @@ -438,23 +401,29 @@ public interface ServletContext { * @see ServletConfig#getServletName */ public RequestDispatcher getNamedDispatcher(String name); - - + + /** * @deprecated As of Java Servlet API 2.1, with no direct replacement. * *

    This method was originally defined to retrieve a servlet - * from a ServletContext. In this version, this method - * always returns null and remains only to preserve - * binary compatibility. This method will be permanently removed + * from a ServletContext. In this version, this method + * always returns null and remains only to preserve + * binary compatibility. This method will be permanently removed * in a future version of the Java Servlet API. * - *

    In lieu of this method, servlets can share information using the + *

    In lieu of this method, servlets can share information using the * ServletContext class and can perform shared business logic * by invoking methods on common non-servlet classes. + * + * @param name the servlet name + * @return the {@code javax.servlet.Servlet Servlet} with the given name + * @throws ServletException if an exception has occurred that interfaces + * with servlet's normal operation */ + @Deprecated public Servlet getServlet(String name) throws ServletException; - + /** * @deprecated As of Java Servlet API 2.0, with no replacement. @@ -466,62 +435,72 @@ public interface ServletContext { * remains only to preserve binary compatibility. This method * will be permanently removed in a future version of the Java * Servlet API. + * + * @return an Enumeration of {@code javax.servlet.Servlet Servlet} */ + @Deprecated public Enumeration getServlets(); - + /** * @deprecated As of Java Servlet API 2.1, with no replacement. * - *

    This method was originally defined to return an + *

    This method was originally defined to return an * Enumeration * of all the servlet names known to this context. In this version, - * this method always returns an empty Enumeration and - * remains only to preserve binary compatibility. This method will + * this method always returns an empty Enumeration and + * remains only to preserve binary compatibility. This method will * be permanently removed in a future version of the Java Servlet API. + * + * @return an Enumeration of {@code javax.servlet.Servlet Servlet} names */ + @Deprecated public Enumeration getServletNames(); - + /** * * Writes the specified message to a servlet log file, usually - * an event log. The name and type of the servlet log file is + * an event log. The name and type of the servlet log file is * specific to the servlet container. * - * @param msg a String specifying the + * @param msg a String specifying the * message to be written to the log file */ public void log(String msg); - + /** * @deprecated As of Java Servlet API 2.1, use - * {@link #log(String message, Throwable throwable)} + * {@link #log(String message, Throwable throwable)} * instead. * - *

    This method was originally defined to write an + *

    This method was originally defined to write an * exception's stack trace and an explanatory error message * to the servlet log file. + * + * @param exception the Exception error + * @param msg a String that describes the exception */ + @Deprecated public void log(Exception exception, String msg); - + /** * Writes an explanatory message and a stack trace * for a given Throwable exception - * to the servlet log file. The name and type of the servlet log + * to the servlet log file. The name and type of the servlet log * file is specific to the servlet container, usually an event log. * - * @param message a String that + * @param message a String that * describes the error or exception * - * @param throwable the Throwable error + * @param throwable the Throwable error * or exception */ public void log(String message, Throwable throwable); - - + + /** * Gets the real path corresponding to the given * virtual path. @@ -555,43 +534,47 @@ public interface ServletContext { * translation cannot be performed */ public String getRealPath(String path); - + /** * Returns the name and version of the servlet container on which - * the servlet is running. + * the servlet is running. * - *

    The form of the returned string is + *

    The form of the returned string is * servername/versionnumber. * For example, the JavaServer Web Development Kit may return the string * JavaServer Web Dev Kit/1.0. * - *

    The servlet container may return other optional information + *

    The servlet container may return other optional information * after the primary string in parentheses, for example, * JavaServer Web Dev Kit/1.0 (JDK 1.1.6; Windows NT 4.0 x86). * * - * @return a String containing at least the + * @return a String containing at least the * servlet container name and version number */ public String getServerInfo(); - + /** * Returns a String containing the value of the named - * context-wide initialization parameter, or null if the - * parameter does not exist. + * context-wide initialization parameter, or null if + * the parameter does not exist. * *

    This method can make available configuration information useful - * to an entire web application. For example, it can provide a - * webmaster's email address or the name of a system that holds + * to an entire web application. For example, it can provide a + * webmaster's email address or the name of a system that holds * critical data. * * @param name a String containing the name of the * parameter whose value is requested - * - * @return a String containing at least the - * servlet container name and version number + * + * @return a String containing the value of the + * context's initialization parameter, or null if the + * context's initialization parameter does not exist. + * + * @throws NullPointerException if the argument {@code name} is + * {@code null} * * @see ServletConfig#getInitParameter */ @@ -604,14 +587,14 @@ public interface ServletContext { * empty Enumeration if the context has no initialization * parameters. * - * @return an Enumeration of String + * @return an Enumeration of String * objects containing the names of the context's * initialization parameters * * @see ServletConfig#getInitParameter */ public Enumeration getInitParameterNames(); - + /** * Sets the context initialization parameter with the given name and @@ -628,20 +611,22 @@ public interface ServletContext { * @throws IllegalStateException if this ServletContext has already * been initialized * + * @throws NullPointerException if the name parameter is {@code null} + * * @throws UnsupportedOperationException if this ServletContext was * passed to the {@link ServletContextListener#contextInitialized} method * of a {@link ServletContextListener} that was neither declared in * web.xml or web-fragment.xml, nor annotated * with {@link javax.servlet.annotation.WebListener} - * + * * @since Servlet 3.0 */ public boolean setInitParameter(String name, String value); /** - * Returns the servlet container attribute with the given name, - * or null if there is no attribute by that name. + * Returns the servlet container attribute with the given name, or + * null if there is no attribute by that name. * *

    An attribute allows a servlet container to give the * servlet additional information not @@ -658,73 +643,79 @@ public interface ServletContext { * matching java.*, javax.*, * and sun.*. * - * @param name a String specifying the name + * @param name a String specifying the name * of the attribute * - * @return an Object containing the value - * of the attribute, or null - * if no attribute exists matching the given - * name + * @return an Object containing the value of the + * attribute, or null if no attribute + * exists matching the given name. * * @see ServletContext#getAttributeNames + * + * @throws NullPointerException if the argument {@code name} is + * {@code null} + * */ public Object getAttribute(String name); - + /** - * Returns an Enumeration containing the + * Returns an Enumeration containing the * attribute names available within this ServletContext. * *

    Use the {@link #getAttribute} method with an attribute name * to get the value of an attribute. * - * @return an Enumeration of attribute + * @return an Enumeration of attribute * names * * @see #getAttribute */ public Enumeration getAttributeNames(); - - + + /** * Binds an object to a given attribute name in this ServletContext. If * the name specified is already used for an attribute, this * method will replace the attribute with the new to the new attribute. - *

    If listeners are configured on the ServletContext the + *

    If listeners are configured on the ServletContext the * container notifies them accordingly. *

    - * If a null value is passed, the effect is the same as calling + * If a null value is passed, the effect is the same as calling * removeAttribute(). - * + * *

    Attribute names should follow the same convention as package * names. The Java Servlet API specification reserves names * matching java.*, javax.*, and * sun.*. * - * @param name a String specifying the name + * @param name a String specifying the name * of the attribute * * @param object an Object representing the * attribute to be bound + * + * @throws NullPointerException if the name parameter is {@code null} + * */ public void setAttribute(String name, Object object); - + /** - * Removes the attribute with the given name from + * Removes the attribute with the given name from * this ServletContext. After removal, subsequent calls to * {@link #getAttribute} to retrieve the attribute's value * will return null. * - *

    If listeners are configured on the ServletContext the + *

    If listeners are configured on the ServletContext the * container notifies them accordingly. * - * @param name a String specifying the name + * @param name a String specifying the name * of the attribute to be removed */ public void removeAttribute(String name); - + /** * Returns the name of this web application corresponding to this * ServletContext as specified in the deployment descriptor for this @@ -732,7 +723,7 @@ public interface ServletContext { * * @return The name of the web application or null if no name has been * declared in the deployment descriptor. - * + * * @since Servlet 2.3 */ public String getServletContextName(); @@ -745,7 +736,7 @@ public interface ServletContext { *

    The registered servlet may be further configured via the returned * {@link ServletRegistration} object. * - *

    The specified className will be loaded using the + *

    The specified className will be loaded using the * classloader associated with the application represented by this * ServletContext. * @@ -755,7 +746,7 @@ public interface ServletContext { * and returned. * *

    This method introspects the class with the given className - * for the {@link javax.servlet.annotation.ServletSecurity}, + * for the {@link javax.servlet.annotation.ServletSecurity}, * {@link javax.servlet.annotation.MultipartConfig}, * javax.annotation.security.RunAs, and * javax.annotation.security.DeclareRoles annotations. @@ -770,7 +761,7 @@ public interface ServletContext { * @return a ServletRegistration object that may be used to further * configure the registered servlet, or null if this * ServletContext already contains a complete ServletRegistration for - * a servlet with the given servletName + * a servlet with the given servletName * * @throws IllegalStateException if this ServletContext has already * been initialized @@ -821,7 +812,7 @@ public ServletRegistration.Dynamic addServlet( * web.xml or web-fragment.xml, nor annotated * with {@link javax.servlet.annotation.WebListener} * - * @throws IllegalArgumentException if the given servlet instance + * @throws IllegalArgumentException if the given servlet instance * implements {@link SingleThreadModel}, or servletName is null * or an empty String * @@ -844,7 +835,7 @@ public ServletRegistration.Dynamic addServlet( * servletClass to it) and returned. * *

    This method introspects the given servletClass for - * the {@link javax.servlet.annotation.ServletSecurity}, + * the {@link javax.servlet.annotation.ServletSecurity}, * {@link javax.servlet.annotation.MultipartConfig}, * javax.annotation.security.RunAs, and * javax.annotation.security.DeclareRoles annotations. @@ -860,7 +851,7 @@ public ServletRegistration.Dynamic addServlet( * @return a ServletRegistration object that may be used to further * configure the registered servlet, or null if this * ServletContext already contains a complete ServletRegistration for - * the given servletName + * the given servletName * * @throws IllegalStateException if this ServletContext has already * been initialized @@ -880,11 +871,49 @@ public ServletRegistration.Dynamic addServlet(String servletName, Class servletClass); + /** + * Adds the servlet with the given jsp file to this servlet context. + * + *

    The registered servlet may be further configured via the returned + * {@link ServletRegistration} object. + * + *

    If this ServletContext already contains a preliminary + * ServletRegistration for a servlet with the given servletName, + * it will be completed (by assigning the given jspFile to it) + * and returned. + * + * @param servletName the name of the servlet + * @param jspFile the full path to a JSP file within the web application + * beginning with a `/'. + * + * @return a ServletRegistration object that may be used to further + * configure the registered servlet, or null if this + * ServletContext already contains a complete ServletRegistration for + * a servlet with the given servletName + * + * @throws IllegalStateException if this ServletContext has already + * been initialized + * + * @throws IllegalArgumentException if servletName is null + * or an empty String + * + * @throws UnsupportedOperationException if this ServletContext was + * passed to the {@link ServletContextListener#contextInitialized} method + * of a {@link ServletContextListener} that was neither declared in + * web.xml or web-fragment.xml, nor annotated + * with {@link javax.servlet.annotation.WebListener} + * + * @since Servlet 4.0 + */ + public ServletRegistration.Dynamic addJspFile( + String servletName, String jspFile); + + /** * Instantiates the given Servlet class. * *

    The returned Servlet instance may be further customized before it - * is registered with this ServletContext via a call to + * is registered with this ServletContext via a call to * {@link #addServlet(String,Servlet)}. * *

    The given Servlet class must define a zero argument constructor, @@ -892,7 +921,7 @@ public ServletRegistration.Dynamic addServlet(String servletName, * *

    This method introspects the given clazz for * the following annotations: - * {@link javax.servlet.annotation.ServletSecurity}, + * {@link javax.servlet.annotation.ServletSecurity}, * {@link javax.servlet.annotation.MultipartConfig}, * javax.annotation.security.RunAs, and * javax.annotation.security.DeclareRoles. @@ -901,6 +930,7 @@ public ServletRegistration.Dynamic addServlet(String servletName, * See the Java EE platform and JSR 299 specifications for additional * details about Managed Beans and resource injection. * + * @param the class of the Servlet to create * @param clazz the Servlet class to instantiate * * @return the new Servlet instance @@ -919,6 +949,7 @@ public ServletRegistration.Dynamic addServlet(String servletName, public T createServlet(Class clazz) throws ServletException; + /** * Gets the ServletRegistration corresponding to the servlet with the * given servletName. @@ -933,6 +964,7 @@ public T createServlet(Class clazz) * web.xml or web-fragment.xml, nor annotated * with {@link javax.servlet.annotation.WebListener} * + * @param servletName the name of a servlet * @since Servlet 3.0 */ public ServletRegistration getServletRegistration(String servletName); @@ -946,7 +978,8 @@ public T createServlet(Class clazz) *

    The returned Map includes the ServletRegistration objects * corresponding to all declared and annotated servlets, as well as the * ServletRegistration objects corresponding to all servlets that have - * been added via one of the addServlet methods. + * been added via one of the addServlet and addJspFile + * methods. * *

    If permitted, any changes to the returned Map must not affect this * ServletContext. @@ -973,7 +1006,7 @@ public T createServlet(Class clazz) *

    The registered filter may be further configured via the returned * {@link FilterRegistration} object. * - *

    The specified className will be loaded using the + *

    The specified className will be loaded using the * classloader associated with the application represented by this * ServletContext. * @@ -993,7 +1026,7 @@ public T createServlet(Class clazz) * @return a FilterRegistration object that may be used to further * configure the registered filter, or null if this * ServletContext already contains a complete FilterRegistration for - * a filter with the given filterName + * a filter with the given filterName * * @throws IllegalStateException if this ServletContext has already * been initialized @@ -1011,7 +1044,7 @@ public T createServlet(Class clazz) */ public FilterRegistration.Dynamic addFilter( String filterName, String className); - + /** * Registers the given filter instance with this ServletContext @@ -1077,7 +1110,7 @@ public FilterRegistration.Dynamic addFilter( * @return a FilterRegistration object that may be used to further * configure the registered filter, or null if this * ServletContext already contains a complete FilterRegistration for a - * filter with the given filterName + * filter with the given filterName * * @throws IllegalStateException if this ServletContext has already * been initialized @@ -1101,7 +1134,7 @@ public FilterRegistration.Dynamic addFilter(String filterName, * Instantiates the given Filter class. * *

    The returned Filter instance may be further customized before it - * is registered with this ServletContext via a call to + * is registered with this ServletContext via a call to * {@link #addFilter(String,Filter)}. * *

    The given Filter class must define a zero argument constructor, @@ -1112,6 +1145,7 @@ public FilterRegistration.Dynamic addFilter(String filterName, * See the Java EE platform and JSR 299 specifications for additional * details about Managed Beans and resource injection. * + * @param the class of the Filter to create * @param clazz the Filter class to instantiate * * @return the new Filter instance @@ -1135,6 +1169,7 @@ public T createFilter(Class clazz) * Gets the FilterRegistration corresponding to the filter with the * given filterName. * + * @param filterName the name of a filter * @return the (complete or preliminary) FilterRegistration for the * filter with the given filterName, or null if no * FilterRegistration exists under that name @@ -1236,6 +1271,10 @@ public T createFilter(Class clazz) * Gets the session tracking modes that are supported by default for this * ServletContext. * + *

    The returned set is not backed by the {@code ServletContext} object, + * so changes in the returned set are not reflected in the + * {@code ServletContext} object, and vice-versa.

    + * * @return set of the session tracking modes supported by default for * this ServletContext * @@ -1257,9 +1296,9 @@ public T createFilter(Class clazz) *

    The session tracking modes in effect are those provided to * {@link #setSessionTrackingModes setSessionTrackingModes}. * - *

    By default, the session tracking modes returned by - * {@link #getDefaultSessionTrackingModes getDefaultSessionTrackingModes} - * are in effect. + *

    The returned set is not backed by the {@code ServletContext} object, + * so changes in the returned set are not reflected in the + * {@code ServletContext} object, and vice-versa.

    * * @return set of the session tracking modes in effect for this * ServletContext @@ -1283,21 +1322,21 @@ public T createFilter(Class clazz) * ServletContext, and must implement one or more of the following * interfaces: *
      - *
    • {@link ServletContextAttributeListener} - *
    • {@link ServletRequestListener} - *
    • {@link ServletRequestAttributeListener} - *
    • {@link javax.servlet.http.HttpSessionAttributeListener} - *
    • {@link javax.servlet.http.HttpSessionIdListener} - *
    • {@link javax.servlet.http.HttpSessionListener} + *
    • {@link ServletContextAttributeListener} + *
    • {@link ServletRequestListener} + *
    • {@link ServletRequestAttributeListener} + *
    • {@link javax.servlet.http.HttpSessionAttributeListener} + *
    • {@link javax.servlet.http.HttpSessionIdListener} + *
    • {@link javax.servlet.http.HttpSessionListener} *
    * - *

    If this ServletContext was passed to + *

    If this ServletContext was passed to * {@link ServletContainerInitializer#onStartup}, then the class with * the given name may also implement {@link ServletContextListener}, * in addition to the interfaces listed above. * *

    As part of this method call, the container must load the class - * with the specified class name to ensure that it implements one of + * with the specified class name to ensure that it implements one of * the required interfaces. * *

    If the class with the given name implements a listener interface @@ -1340,15 +1379,15 @@ public T createFilter(Class clazz) *

    The given listener must be an instance of one or more of the * following interfaces: *

      - *
    • {@link ServletContextAttributeListener} - *
    • {@link ServletRequestListener} - *
    • {@link ServletRequestAttributeListener} - *
    • {@link javax.servlet.http.HttpSessionAttributeListener} - *
    • {@link javax.servlet.http.HttpSessionIdListener} - *
    • {@link javax.servlet.http.HttpSessionListener} + *
    • {@link ServletContextAttributeListener} + *
    • {@link ServletRequestListener} + *
    • {@link ServletRequestAttributeListener} + *
    • {@link javax.servlet.http.HttpSessionAttributeListener} + *
    • {@link javax.servlet.http.HttpSessionIdListener} + *
    • {@link javax.servlet.http.HttpSessionListener} *
    * - *

    If this ServletContext was passed to + *

    If this ServletContext was passed to * {@link ServletContainerInitializer#onStartup}, then the given * listener may also be an instance of {@link ServletContextListener}, * in addition to the interfaces listed above. @@ -1361,6 +1400,7 @@ public T createFilter(Class clazz) * then the listener will be added to the end of the ordered list of * listeners of that interface. * + * @param the class of the EventListener to add * @param t the listener to be added * * @throws IllegalArgumentException if the given listener is not @@ -1388,15 +1428,15 @@ public T createFilter(Class clazz) *

    The given listenerClass must implement one or more of the * following interfaces: *

      - *
    • {@link ServletContextAttributeListener} - *
    • {@link ServletRequestListener} - *
    • {@link ServletRequestAttributeListener} - *
    • {@link javax.servlet.http.HttpSessionAttributeListener} - *
    • {@link javax.servlet.http.HttpSessionIdListener} - *
    • {@link javax.servlet.http.HttpSessionListener} + *
    • {@link ServletContextAttributeListener} + *
    • {@link ServletRequestListener} + *
    • {@link ServletRequestAttributeListener} + *
    • {@link javax.servlet.http.HttpSessionAttributeListener} + *
    • {@link javax.servlet.http.HttpSessionIdListener} + *
    • {@link javax.servlet.http.HttpSessionListener} *
    * - *

    If this ServletContext was passed to + *

    If this ServletContext was passed to * {@link ServletContainerInitializer#onStartup}, then the given * listenerClass may also implement * {@link ServletContextListener}, in addition to the interfaces listed @@ -1440,13 +1480,13 @@ public T createFilter(Class clazz) * Instantiates the given EventListener class. * *

    The specified EventListener class must implement at least one of - * the {@link ServletContextListener}, - * {@link ServletContextAttributeListener}, - * {@link ServletRequestListener}, - * {@link ServletRequestAttributeListener}, - * {@link javax.servlet.http.HttpSessionAttributeListener} - * {@link javax.servlet.http.HttpSessionIdListener}, or - * {@link javax.servlet.http.HttpSessionListener}, or + * the {@link ServletContextListener}, + * {@link ServletContextAttributeListener}, + * {@link ServletRequestListener}, + * {@link ServletRequestAttributeListener}, + * {@link javax.servlet.http.HttpSessionAttributeListener}, + * {@link javax.servlet.http.HttpSessionIdListener}, or + * {@link javax.servlet.http.HttpSessionListener} * interfaces. * *

    The returned EventListener instance may be further customized @@ -1461,6 +1501,7 @@ public T createFilter(Class clazz) * See the Java EE platform and JSR 299 specifications for additional * details about Managed Beans and resource injection. * + * @param the class of the EventListener to create * @param clazz the EventListener class to instantiate * * @return the new EventListener instance @@ -1476,19 +1517,19 @@ public T createFilter(Class clazz) * * @throws IllegalArgumentException if the specified EventListener class * does not implement any of the - * {@link ServletContextListener}, - * {@link ServletContextAttributeListener}, - * {@link ServletRequestListener}, - * {@link ServletRequestAttributeListener}, - * {@link javax.servlet.http.HttpSessionAttributeListener} - * {@link javax.servlet.http.HttpSessionIdListener}, or - * {@link javax.servlet.http.HttpSessionListener}, or + * {@link ServletContextListener}, + * {@link ServletContextAttributeListener}, + * {@link ServletRequestListener}, + * {@link ServletRequestAttributeListener}, + * {@link javax.servlet.http.HttpSessionAttributeListener}, + * {@link javax.servlet.http.HttpSessionIdListener}, or + * {@link javax.servlet.http.HttpSessionListener} * interfaces. * * @since Servlet 3.0 */ public T createListener(Class clazz) - throws ServletException; + throws ServletException; /** @@ -1536,7 +1577,7 @@ public T createListener(Class clazz) * web.xml or web-fragment.xml, nor annotated * with {@link javax.servlet.annotation.WebListener} * - * @throws SecurityException if a security manager denies access to + * @throws SecurityException if a security manager denies access to * the requested class loader * * @since Servlet 3.0 @@ -1596,4 +1637,121 @@ public T createListener(Class clazz) * @since Servlet 3.1 */ public String getVirtualServerName(); + + + /** + * Gets the session timeout in minutes that are supported by default for + * this ServletContext. + * + * @return the session timeout in minutes that are supported by default for + * this ServletContext + * + * @throws UnsupportedOperationException if this ServletContext was + * passed to the {@link ServletContextListener#contextInitialized} method + * of a {@link ServletContextListener} that was neither declared in + * web.xml or web-fragment.xml, nor annotated + * with {@link javax.servlet.annotation.WebListener} + * + * @since Servlet 4.0 + */ + public int getSessionTimeout(); + + + /** + * Sets the session timeout in minutes for this ServletContext. + * + * @param sessionTimeout session timeout in minutes + * + * @throws IllegalStateException if this ServletContext has already + * been initialized + * + * @throws UnsupportedOperationException if this ServletContext was + * passed to the {@link ServletContextListener#contextInitialized} method + * of a {@link ServletContextListener} that was neither declared in + * web.xml or web-fragment.xml, nor annotated + * with {@link javax.servlet.annotation.WebListener} + * + * @since Servlet 4.0 + */ + public void setSessionTimeout(int sessionTimeout); + + + /** + * Gets the request character encoding that are supported by default for + * this ServletContext. This method returns null if no request + * encoding character encoding has been specified in deployment descriptor + * or container specific configuration (for all web applications in the + * container). + * + * @return the request character encoding that are supported by default for + * this ServletContext + * + * @throws UnsupportedOperationException if this ServletContext was + * passed to the {@link ServletContextListener#contextInitialized} method + * of a {@link ServletContextListener} that was neither declared in + * web.xml or web-fragment.xml, nor annotated + * with {@link javax.servlet.annotation.WebListener} + * + * @since Servlet 4.0 + */ + public String getRequestCharacterEncoding(); + + + /** + * Sets the request character encoding for this ServletContext. + * + * @param encoding request character encoding + * + * @throws IllegalStateException if this ServletContext has already + * been initialized + * + * @throws UnsupportedOperationException if this ServletContext was + * passed to the {@link ServletContextListener#contextInitialized} method + * of a {@link ServletContextListener} that was neither declared in + * web.xml or web-fragment.xml, nor annotated + * with {@link javax.servlet.annotation.WebListener} + * + * @since Servlet 4.0 + */ + public void setRequestCharacterEncoding(String encoding); + + + /** + * Gets the response character encoding that are supported by default for + * this ServletContext. This method returns null if no response + * encoding character encoding has been specified in deployment descriptor + * or container specific configuration (for all web applications in the + * container). + * + * @return the request character encoding that are supported by default for + * this ServletContext + * + * @throws UnsupportedOperationException if this ServletContext was + * passed to the {@link ServletContextListener#contextInitialized} method + * of a {@link ServletContextListener} that was neither declared in + * web.xml or web-fragment.xml, nor annotated + * with {@link javax.servlet.annotation.WebListener} + * + * @since Servlet 4.0 + */ + public String getResponseCharacterEncoding(); + + + /** + * Sets the response character encoding for this ServletContext. + * + * @param encoding response character encoding + * + * @throws IllegalStateException if this ServletContext has already + * been initialized + * + * @throws UnsupportedOperationException if this ServletContext was + * passed to the {@link ServletContextListener#contextInitialized} method + * of a {@link ServletContextListener} that was neither declared in + * web.xml or web-fragment.xml, nor annotated + * with {@link javax.servlet.annotation.WebListener} + * + * @since Servlet 4.0 + */ + public void setResponseCharacterEncoding(String encoding); } diff --git a/src/main/java/javax/servlet/ServletContextAttributeEvent.java b/src/main/java/javax/servlet/ServletContextAttributeEvent.java index 0ed017eb..8ebc5fd2 100644 --- a/src/main/java/javax/servlet/ServletContextAttributeEvent.java +++ b/src/main/java/javax/servlet/ServletContextAttributeEvent.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/ServletContextAttributeListener.java b/src/main/java/javax/servlet/ServletContextAttributeListener.java index 55414b51..2e10f8eb 100644 --- a/src/main/java/javax/servlet/ServletContextAttributeListener.java +++ b/src/main/java/javax/servlet/ServletContextAttributeListener.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -87,8 +46,11 @@ public interface ServletContextAttributeListener extends EventListener { * @param event the ServletContextAttributeEvent containing the * ServletContext to which the attribute was added, along with the * attribute name and value + * + * @implSpec + * The default implementation takes no action. */ - public void attributeAdded(ServletContextAttributeEvent event); + default public void attributeAdded(ServletContextAttributeEvent event) {} /** * Receives notification that an attribute has been removed @@ -97,8 +59,11 @@ public interface ServletContextAttributeListener extends EventListener { * @param event the ServletContextAttributeEvent containing the * ServletContext from which the attribute was removed, along with * the attribute name and value + * + * @implSpec + * The default implementation takes no action. */ - public void attributeRemoved(ServletContextAttributeEvent event); + default public void attributeRemoved(ServletContextAttributeEvent event) {} /* * Receives notification that an attribute has been replaced @@ -107,7 +72,10 @@ public interface ServletContextAttributeListener extends EventListener { * @param event the ServletContextAttributeEvent containing the * ServletContext in which the attribute was replaced, along with * the attribute name and its old value + * + * @implSpec + * The default implementation takes no action. */ - public void attributeReplaced(ServletContextAttributeEvent event); + default public void attributeReplaced(ServletContextAttributeEvent event) {} } diff --git a/src/main/java/javax/servlet/ServletContextEvent.java b/src/main/java/javax/servlet/ServletContextEvent.java index 81068b73..8e3eca26 100644 --- a/src/main/java/javax/servlet/ServletContextEvent.java +++ b/src/main/java/javax/servlet/ServletContextEvent.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/ServletContextListener.java b/src/main/java/javax/servlet/ServletContextListener.java index 58320417..d37e58d0 100644 --- a/src/main/java/javax/servlet/ServletContextListener.java +++ b/src/main/java/javax/servlet/ServletContextListener.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -91,8 +50,11 @@ public interface ServletContextListener extends EventListener { * * @param sce the ServletContextEvent containing the ServletContext * that is being initialized + * + * @implSpec + * The default implementation takes no action. */ - public void contextInitialized(ServletContextEvent sce); + default public void contextInitialized(ServletContextEvent sce) {} /** * Receives notification that the ServletContext is about to be @@ -104,7 +66,10 @@ public interface ServletContextListener extends EventListener { * * @param sce the ServletContextEvent containing the ServletContext * that is being destroyed + * + * @implSpec + * The default implementation takes no action. */ - public void contextDestroyed(ServletContextEvent sce); + default public void contextDestroyed(ServletContextEvent sce) {} } diff --git a/src/main/java/javax/servlet/ServletException.java b/src/main/java/javax/servlet/ServletException.java index e82f59c9..375bb298 100644 --- a/src/main/java/javax/servlet/ServletException.java +++ b/src/main/java/javax/servlet/ServletException.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/ServletInputStream.java b/src/main/java/javax/servlet/ServletInputStream.java index 479a4f47..a0369ab4 100644 --- a/src/main/java/javax/servlet/ServletInputStream.java +++ b/src/main/java/javax/servlet/ServletInputStream.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/ServletOutputStream.java b/src/main/java/javax/servlet/ServletOutputStream.java index 9d5dff96..efcd1e51 100644 --- a/src/main/java/javax/servlet/ServletOutputStream.java +++ b/src/main/java/javax/servlet/ServletOutputStream.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/ServletRegistration.java b/src/main/java/javax/servlet/ServletRegistration.java index b65b3ab3..26037e3e 100644 --- a/src/main/java/javax/servlet/ServletRegistration.java +++ b/src/main/java/javax/servlet/ServletRegistration.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -59,6 +59,10 @@ public interface ServletRegistration extends Registration { *

    If this method is called multiple times, each successive call * adds to the effects of the former. * + *

    The returned set is not backed by the {@code ServletRegistration} + * object, so changes in the returned set are not reflected in the + * {@code ServletRegistration} object, and vice-versa.

    + * * @param urlPatterns the URL patterns of the servlet mapping * * @return the (possibly empty) Set of URL patterns that are already @@ -156,6 +160,10 @@ interface Dynamic extends ServletRegistration, Registration.Dynamic { * descriptor, then this method establishes the security constraint * for that pattern from the argument * ServletSecurityElement. + * + *

    The returned set is not backed by the {@code Dynamic} object, + * so changes in the returned set are not reflected in the + * {@code Dynamic} object, and vice-versa.

    * * @param constraint the {@link ServletSecurityElement} to be applied * to the patterns mapped to this ServletRegistration diff --git a/src/main/java/javax/servlet/ServletRequest.java b/src/main/java/javax/servlet/ServletRequest.java index 5d99560a..979898e3 100644 --- a/src/main/java/javax/servlet/ServletRequest.java +++ b/src/main/java/javax/servlet/ServletRequest.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -116,8 +75,13 @@ public interface ServletRequest { /** * Returns the name of the character encoding used in the body of this - * request. This method returns null if the request - * does not specify a character encoding + * request. This method returns null if no request encoding + * character encoding has been specified. The following methods for + * specifying the request character encoding are consulted, in decreasing + * order of priority: per request, per web app (using + * {@link ServletContext#setRequestCharacterEncoding}, deployment + * descriptor), and per container (for all web applications deployed in + * that container, using vendor specific configuration). * * @return a String containing the name of the character * encoding, or null if the request does not specify a @@ -457,6 +421,11 @@ public interface ServletRequest { public RequestDispatcher getRequestDispatcher(String path); /** + * @param path the path for which the real path is to be returned. + + * @return the real path, or null if the + * translation cannot be performed. + * @deprecated As of Version 2.1 of the Java Servlet API, * use {@link ServletContext#getRealPath} instead. */ diff --git a/src/main/java/javax/servlet/ServletRequestAttributeEvent.java b/src/main/java/javax/servlet/ServletRequestAttributeEvent.java index 6a09c42f..1f59887f 100644 --- a/src/main/java/javax/servlet/ServletRequestAttributeEvent.java +++ b/src/main/java/javax/servlet/ServletRequestAttributeEvent.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/ServletRequestAttributeListener.java b/src/main/java/javax/servlet/ServletRequestAttributeListener.java index 70bf5123..f17ab03a 100644 --- a/src/main/java/javax/servlet/ServletRequestAttributeListener.java +++ b/src/main/java/javax/servlet/ServletRequestAttributeListener.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -92,8 +51,11 @@ public interface ServletRequestAttributeListener extends EventListener { * @param srae the ServletRequestAttributeEvent containing the * ServletRequest and the name and value of the attribute that was * added + * + * @implSpec + * The default implementation takes no action. */ - public void attributeAdded(ServletRequestAttributeEvent srae); + default public void attributeAdded(ServletRequestAttributeEvent srae) {} /** * Receives notification that an attribute has been removed from the @@ -102,8 +64,11 @@ public interface ServletRequestAttributeListener extends EventListener { * @param srae the ServletRequestAttributeEvent containing the * ServletRequest and the name and value of the attribute that was * removed + * + * @implSpec + * The default implementation takes no action. */ - public void attributeRemoved(ServletRequestAttributeEvent srae); + default public void attributeRemoved(ServletRequestAttributeEvent srae) {} /** * Receives notification that an attribute has been replaced on the @@ -112,7 +77,10 @@ public interface ServletRequestAttributeListener extends EventListener { * @param srae the ServletRequestAttributeEvent containing the * ServletRequest and the name and (old) value of the attribute * that was replaced + * + * @implSpec + * The default implementation takes no action. */ - public void attributeReplaced(ServletRequestAttributeEvent srae); + default public void attributeReplaced(ServletRequestAttributeEvent srae) {} } diff --git a/src/main/java/javax/servlet/ServletRequestEvent.java b/src/main/java/javax/servlet/ServletRequestEvent.java index 8d04e649..c4db8faa 100644 --- a/src/main/java/javax/servlet/ServletRequestEvent.java +++ b/src/main/java/javax/servlet/ServletRequestEvent.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -55,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package javax.servlet; /** @@ -83,6 +43,8 @@ public ServletRequestEvent(ServletContext sc, ServletRequest request) { /** * Returns the ServletRequest that is changing. + + * @return the {@link ServletRequest} corresponding to this event. */ public ServletRequest getServletRequest () { return this.request; @@ -90,6 +52,8 @@ public ServletRequest getServletRequest () { /** * Returns the ServletContext of this web application. + * + * @return the {@link ServletContext} for this web application. */ public ServletContext getServletContext () { return (ServletContext) super.getSource(); diff --git a/src/main/java/javax/servlet/ServletRequestListener.java b/src/main/java/javax/servlet/ServletRequestListener.java index 677140c6..d65edf9e 100644 --- a/src/main/java/javax/servlet/ServletRequestListener.java +++ b/src/main/java/javax/servlet/ServletRequestListener.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -91,8 +50,11 @@ public interface ServletRequestListener extends EventListener { * * @param sre the ServletRequestEvent containing the ServletRequest * and the ServletContext representing the web application + * + * @implSpec + * The default implementation takes no action. */ - public void requestDestroyed(ServletRequestEvent sre); + default public void requestDestroyed(ServletRequestEvent sre) {} /** * Receives notification that a ServletRequest is about to come @@ -100,6 +62,9 @@ public interface ServletRequestListener extends EventListener { * * @param sre the ServletRequestEvent containing the ServletRequest * and the ServletContext representing the web application + * + * @implSpec + * The default implementation takes no action. */ - public void requestInitialized(ServletRequestEvent sre); + default public void requestInitialized(ServletRequestEvent sre) {} } diff --git a/src/main/java/javax/servlet/ServletRequestWrapper.java b/src/main/java/javax/servlet/ServletRequestWrapper.java index 565fd36f..bf8c95b3 100644 --- a/src/main/java/javax/servlet/ServletRequestWrapper.java +++ b/src/main/java/javax/servlet/ServletRequestWrapper.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -83,6 +42,8 @@ public class ServletRequestWrapper implements ServletRequest { /** * Creates a ServletRequest adaptor wrapping the given request object. * @throws java.lang.IllegalArgumentException if the request is null + * + * @param request the {@link ServletRequest} to be wrapped */ public ServletRequestWrapper(ServletRequest request) { if (request == null) { @@ -94,6 +55,8 @@ public ServletRequestWrapper(ServletRequest request) { /** * Return the wrapped request object. + * + * @return the wrapped {@link ServletRequest} */ public ServletRequest getRequest() { return this.request; @@ -102,7 +65,11 @@ public ServletRequest getRequest() { /** * Sets the request object being wrapped. + * + * @param request the {@link ServletRequest} to be installed + * * @throws java.lang.IllegalArgumentException if the request is null. + * */ public void setRequest(ServletRequest request) { if (request == null) { @@ -346,6 +313,7 @@ public RequestDispatcher getRequestDispatcher(String path) { * @deprecated As of Version 2.1 of the Java Servlet API, * use {@link ServletContext#getRealPath} instead */ + @Deprecated public String getRealPath(String path) { return this.request.getRealPath(path); } diff --git a/src/main/java/javax/servlet/ServletResponse.java b/src/main/java/javax/servlet/ServletResponse.java index 7e858626..7b1c38dd 100644 --- a/src/main/java/javax/servlet/ServletResponse.java +++ b/src/main/java/javax/servlet/ServletResponse.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -76,13 +35,19 @@ * ServletOutputStream and manage the character sections * manually. * - *

    The charset for the MIME body response can be specified - * explicitly using the {@link #setCharacterEncoding} and - * {@link #setContentType} methods, or implicitly - * using the {@link #setLocale} method. - * Explicit specifications take precedence over - * implicit specifications. If no charset is specified, ISO-8859-1 will be - * used. The setCharacterEncoding, + *

    The charset for the MIME body response can be specified explicitly + * using any of the following techniques: per request, per web-app (using + * {@link ServletContext#setRequestCharacterEncoding}, deployment descriptor), + * and per container (for all web applications deployed in that container, + * using vendor specific configuration). + * If multiple of the preceding techniques have been employed, the priority is + * the order listed. + * For per request, the charset for the response can be specified explicitly + * using the {@link #setCharacterEncoding} and {@link #setContentType} methods, + * or implicitly using the {@link #setLocale} method. + * Explicit specifications take precedence over implicit specifications. + * If no charset is explicitly specified, ISO-8859-1 will be used. + * The setCharacterEncoding, * setContentType, or setLocale method must * be called before getWriter and before committing * the response for the character encoding to be used. @@ -103,12 +68,17 @@ public interface ServletResponse { /** * Returns the name of the character encoding (MIME charset) * used for the body sent in this response. - * The character encoding may have been specified explicitly - * using the {@link #setCharacterEncoding} or - * {@link #setContentType} methods, or implicitly using the - * {@link #setLocale} method. Explicit specifications take - * precedence over implicit specifications. Calls made - * to these methods after getWriter has been + * The following methods for specifying the response character encoding are + * consulted, in decreasing order of priority: per request, perweb-app + * (using {@link ServletContext#setResponseCharacterEncoding}, deployment + * descriptor), and per container (for all web applications deployed in + * that container, using vendor specific configuration). + * The first one of these methods that yields a result is returned. + * Per-request, the charset for the response can be specified explicitly + * using the {@link setCharacterEncoding} and {@link setContentType} + * methods, or implicitly using the setLocale(java.util.Locale) method. + * Explicit specifications take precedence over implicit specifications. + * Calls made to these methods after getWriter has been * called or after the response has been committed have no * effect on the character encoding. If no character encoding * has been specified, ISO-8859-1 is returned. @@ -205,9 +175,10 @@ public interface ServletResponse { /** * Sets the character encoding (MIME charset) of the response * being sent to the client, for example, to UTF-8. - * If the character encoding has already been set by - * {@link #setContentType} or {@link #setLocale}, - * this method overrides it. + * If the response character encoding has already been set by the + * {@link ServletContext#setResponseCharacterEncoding}, + * deployment descriptor, or using the setContentType() or setLocale() + * methods, the value set in this method overrides any of those values. * Calling {@link #setContentType} with the String * of text/html and calling * this method with the String of UTF-8 @@ -342,6 +313,9 @@ public interface ServletResponse { * @see #getBufferSize * @see #isCommitted * @see #reset + + * @throws IOException if the act of flushing the buffer cannot be + * completed. * */ public void flushBuffer() throws IOException; @@ -444,6 +418,8 @@ public interface ServletResponse { * setLocale after the response is committed * have no effect. If no locale has been specified, * the container's default locale is returned. + * + * @return the Locale for this response. * * @see #setLocale */ diff --git a/src/main/java/javax/servlet/ServletResponseWrapper.java b/src/main/java/javax/servlet/ServletResponseWrapper.java index bba9f70f..b861f848 100644 --- a/src/main/java/javax/servlet/ServletResponseWrapper.java +++ b/src/main/java/javax/servlet/ServletResponseWrapper.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -81,6 +40,8 @@ public class ServletResponseWrapper implements ServletResponse { /** * Creates a ServletResponse adaptor wrapping the given response object. * @throws java.lang.IllegalArgumentException if the response is null. + * @param response the {@link ServletResponse} to be wrapped + * */ @@ -93,6 +54,8 @@ public ServletResponseWrapper(ServletResponse response) { /** * Return the wrapped ServletResponse object. + * + * @return the wrapped {@link ServletResponse} */ public ServletResponse getResponse() { @@ -103,6 +66,8 @@ public ServletResponse getResponse() { /** * Sets the response being wrapped. * @throws java.lang.IllegalArgumentException if the response is null. + * + * @param response the {@link ServletResponse} to be installed */ public void setResponse(ServletResponse response) { diff --git a/src/main/java/javax/servlet/ServletSecurityElement.java b/src/main/java/javax/servlet/ServletSecurityElement.java index 5947174b..13950ef4 100644 --- a/src/main/java/javax/servlet/ServletSecurityElement.java +++ b/src/main/java/javax/servlet/ServletSecurityElement.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -45,7 +45,7 @@ import javax.servlet.annotation.ServletSecurity; /** - * Java Class represntation of a {@link ServletSecurity} annotation value. + * Java Class representation of a {@link ServletSecurity} annotation value. * * @since Servlet 3.0 */ diff --git a/src/main/java/javax/servlet/SessionCookieConfig.java b/src/main/java/javax/servlet/SessionCookieConfig.java index 7f35005a..2dd82f3f 100644 --- a/src/main/java/javax/servlet/SessionCookieConfig.java +++ b/src/main/java/javax/servlet/SessionCookieConfig.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/SessionTrackingMode.java b/src/main/java/javax/servlet/SessionTrackingMode.java index d9126e6b..9c3a855b 100644 --- a/src/main/java/javax/servlet/SessionTrackingMode.java +++ b/src/main/java/javax/servlet/SessionTrackingMode.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/SingleThreadModel.java b/src/main/java/javax/servlet/SingleThreadModel.java index 16cf1283..2572d3f9 100644 --- a/src/main/java/javax/servlet/SingleThreadModel.java +++ b/src/main/java/javax/servlet/SingleThreadModel.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -85,6 +44,6 @@ * @deprecated As of Java Servlet API 2.4, with no direct * replacement. */ - +@Deprecated public interface SingleThreadModel { } diff --git a/src/main/java/javax/servlet/UnavailableException.java b/src/main/java/javax/servlet/UnavailableException.java index 13c288c8..f529aaf6 100644 --- a/src/main/java/javax/servlet/UnavailableException.java +++ b/src/main/java/javax/servlet/UnavailableException.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -107,7 +66,7 @@ public class UnavailableException * descriptive message * */ - + @Deprecated public UnavailableException(Servlet servlet, String msg) { super(msg); this.servlet = servlet; @@ -130,7 +89,7 @@ public UnavailableException(Servlet servlet, String msg) { * displayed for the user. * */ - + @Deprecated public UnavailableException(int seconds, Servlet servlet, String msg) { super(msg); this.servlet = servlet; @@ -218,7 +177,7 @@ public boolean isPermanent() { * throwing the UnavailableException * */ - + @Deprecated public Servlet getServlet() { return servlet; } diff --git a/src/main/java/javax/servlet/WriteListener.java b/src/main/java/javax/servlet/WriteListener.java index 6724dad0..6d50ecfd 100644 --- a/src/main/java/javax/servlet/WriteListener.java +++ b/src/main/java/javax/servlet/WriteListener.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2011-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -38,7 +38,6 @@ * holder. */ - package javax.servlet; import java.io.IOException; @@ -57,8 +56,9 @@ public interface WriteListener extends EventListener { * When an instance of the WriteListener is registered with a {@link ServletOutputStream}, * this method will be invoked by the container the first time when it is possible * to write data. Subsequently the container will invoke this method if and only - * if {@link javax.servlet.ServletOutputStream#isReady()} method - * has been called and has returned false. + * if the {@link javax.servlet.ServletOutputStream#isReady()} method + * has been called and has returned a value of false and a write + * operation has subsequently become possible. * * @throws IOException if an I/O related error has occurred during processing */ @@ -66,6 +66,8 @@ public interface WriteListener extends EventListener { /** * Invoked when an error occurs writing data using the non-blocking APIs. + * + * @param t the throwable to indicate why the write operation failed */ public void onError(final Throwable t); diff --git a/src/main/java/javax/servlet/annotation/HandlesTypes.java b/src/main/java/javax/servlet/annotation/HandlesTypes.java index a1dbdae8..2be3cdbf 100644 --- a/src/main/java/javax/servlet/annotation/HandlesTypes.java +++ b/src/main/java/javax/servlet/annotation/HandlesTypes.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -69,6 +69,9 @@ * the {@link javax.servlet.ServletContainerInitializer#onStartup} * method of the ServletContainerInitializer (if no matching classes * are found, null must be passed instead) + * + * @return the classes in which {@link javax.servlet.ServletContainerInitializer + * ServletContainerInitializer} has expressed interest */ Class[] value(); } diff --git a/src/main/java/javax/servlet/annotation/HttpConstraint.java b/src/main/java/javax/servlet/annotation/HttpConstraint.java index 99c5e12a..093090f4 100644 --- a/src/main/java/javax/servlet/annotation/HttpConstraint.java +++ b/src/main/java/javax/servlet/annotation/HttpConstraint.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -72,7 +72,7 @@ * The default authorization semantic. * This value is insignificant when rolesAllowed returns a * non-empty array, and should not be specified when a non-empty - * array is specified for rolesAllowed. + * array is specified for rolesAllowed. * * @return the {@link EmptyRoleSemantic} to be applied when * rolesAllowed returns an empty (that is, zero-length) array. diff --git a/src/main/java/javax/servlet/annotation/HttpMethodConstraint.java b/src/main/java/javax/servlet/annotation/HttpMethodConstraint.java index 1a5e8131..e2218353 100644 --- a/src/main/java/javax/servlet/annotation/HttpMethodConstraint.java +++ b/src/main/java/javax/servlet/annotation/HttpMethodConstraint.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/annotation/MultipartConfig.java b/src/main/java/javax/servlet/annotation/MultipartConfig.java index 69c04332..c3287b57 100644 --- a/src/main/java/javax/servlet/annotation/MultipartConfig.java +++ b/src/main/java/javax/servlet/annotation/MultipartConfig.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -63,6 +63,8 @@ /** * The directory location where files will be stored + * + * @return the directory location where files will be stored */ String location() default ""; @@ -70,6 +72,8 @@ * The maximum size allowed for uploaded files. * *

    The default is -1L, which means unlimited. + * + * @return the maximum size allowed for uploaded files */ long maxFileSize() default -1L; @@ -78,11 +82,15 @@ * requests * *

    The default is -1L, which means unlimited. + * + * @return the maximum size allowed for multipart/form-data requests */ long maxRequestSize() default -1L; /** * The size threshold after which the file will be written to disk + * + * @return the size threshold after which the file will be written to disk */ int fileSizeThreshold() default 0; } diff --git a/src/main/java/javax/servlet/annotation/ServletSecurity.java b/src/main/java/javax/servlet/annotation/ServletSecurity.java index e40b7f9d..bbdf529f 100644 --- a/src/main/java/javax/servlet/annotation/ServletSecurity.java +++ b/src/main/java/javax/servlet/annotation/ServletSecurity.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/annotation/WebFilter.java b/src/main/java/javax/servlet/annotation/WebFilter.java index 88b09099..46c4d3e4 100644 --- a/src/main/java/javax/servlet/annotation/WebFilter.java +++ b/src/main/java/javax/servlet/annotation/WebFilter.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -65,57 +65,79 @@ /** * The description of the filter + * + * @return the description of the filter */ String description() default ""; /** * The display name of the filter + * + * @return the display name of the filter */ String displayName() default ""; /** * The init parameters of the filter + * + * @return the init parameters of the filter */ WebInitParam[] initParams() default {}; /** * The name of the filter + * + * @return the name of the filter */ String filterName() default ""; /** * The small-icon of the filter + * + * @return the small-icon of the filter */ String smallIcon() default ""; /** * The large-icon of the filter + * + * @return the large-icon of the filter */ String largeIcon() default ""; /** * The names of the servlets to which the filter applies. + * + * @return the names of the servlets to which the filter applies */ String[] servletNames() default {}; /** * The URL patterns to which the filter applies + * The default value is an empty array. + * + * @return the URL patterns to which the filter applies */ String[] value() default {}; /** * The URL patterns to which the filter applies + * + * @return the URL patterns to which the filter applies */ String[] urlPatterns() default {}; /** * The dispatcher types to which the filter applies + * + * @return the dispatcher types to which the filter applies */ DispatcherType[] dispatcherTypes() default {DispatcherType.REQUEST}; /** * Declares whether the filter supports asynchronous operation mode. * + * @return {@code true} if the filter supports asynchronous operation mode * @see javax.servlet.ServletRequest#startAsync * @see javax.servlet.ServletRequest#startAsync(ServletRequest, * ServletResponse) diff --git a/src/main/java/javax/servlet/annotation/WebInitParam.java b/src/main/java/javax/servlet/annotation/WebInitParam.java index d608215e..50586a15 100644 --- a/src/main/java/javax/servlet/annotation/WebInitParam.java +++ b/src/main/java/javax/servlet/annotation/WebInitParam.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -59,16 +59,22 @@ /** * Name of the initialization parameter + * + * @return name of the initialization parameter */ String name(); /** * Value of the initialization parameter + * + * @return value of the initialization parameter */ String value(); /** * Description of the initialization parameter + * + * @return description of the initialization parameter */ String description() default ""; } diff --git a/src/main/java/javax/servlet/annotation/WebListener.java b/src/main/java/javax/servlet/annotation/WebListener.java index 085aad2f..49acb194 100644 --- a/src/main/java/javax/servlet/annotation/WebListener.java +++ b/src/main/java/javax/servlet/annotation/WebListener.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -66,6 +66,8 @@ public @interface WebListener { /** * Description of the listener + * + * @return description of the listener */ String value() default ""; } diff --git a/src/main/java/javax/servlet/annotation/WebServlet.java b/src/main/java/javax/servlet/annotation/WebServlet.java index 65fa60e7..aa32498b 100644 --- a/src/main/java/javax/servlet/annotation/WebServlet.java +++ b/src/main/java/javax/servlet/annotation/WebServlet.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -64,32 +64,43 @@ /** * The name of the servlet + * + * @return the name of the servlet */ String name() default ""; /** * The URL patterns of the servlet + * + * @return the URL patterns of the servlet */ String[] value() default {}; /** * The URL patterns of the servlet + * + * @return the URL patterns of the servlet */ String[] urlPatterns() default {}; /** * The load-on-startup order of the servlet + * + * @return the load-on-startup order of the servlet */ int loadOnStartup() default -1; /** * The init parameters of the servlet + * + * @return the init parameters of the servlet */ WebInitParam [] initParams() default {}; /** * Declares whether the servlet supports asynchronous operation mode. * + * @return {@code true} if the servlet supports asynchronous operation mode * @see javax.servlet.ServletRequest#startAsync * @see javax.servlet.ServletRequest#startAsync(ServletRequest, * ServletResponse) @@ -98,21 +109,29 @@ /** * The small-icon of the servlet + * + * @return the small-icon of the servlet */ String smallIcon() default ""; - /** - * The large-icon of the servlet - */ + /** + * The large-icon of the servlet + * + * @return the large-icon of the servlet + */ String largeIcon() default ""; /** * The description of the servlet + * + * @return the description of the servlet */ String description() default ""; /** * The display name of the servlet + * + * @return the display name of the servlet */ String displayName() default ""; diff --git a/src/main/java/javax/servlet/annotation/package.html b/src/main/java/javax/servlet/annotation/package.html index 6be44bc6..11b7bb24 100644 --- a/src/main/java/javax/servlet/annotation/package.html +++ b/src/main/java/javax/servlet/annotation/package.html @@ -2,19 +2,19 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2008-2017 Oracle and/or its affiliates. All rights reserved. The contents of this file are subject to the terms of either the GNU General Public License Version 2 only ("GPL") or the Common Development and Distribution License("CDDL") (collectively, the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the License at - https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - or packager/legal/LICENSE.txt. See the License for the specific + https://oss.oracle.com/licenses/CDDL+GPL-1.1 + or LICENSE.txt. See the License for the specific language governing permissions and limitations under the License. When distributing the software, include this License Header Notice in each - file and include the License file at packager/legal/LICENSE.txt. + file and include the License file at LICENSE.txt. GPL Classpath Exception: Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/descriptor/JspConfigDescriptor.java b/src/main/java/javax/servlet/descriptor/JspConfigDescriptor.java index fc1599c1..ac8281c7 100644 --- a/src/main/java/javax/servlet/descriptor/JspConfigDescriptor.java +++ b/src/main/java/javax/servlet/descriptor/JspConfigDescriptor.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -62,7 +62,7 @@ public interface JspConfigDescriptor { * affect this JspConfigDescriptor. * * @return a (possibly empty) Collection of the - * <taglib<>/code> child elements of the + * <taglib> child elements of the * <jsp-config> element represented by this * JspConfigDescriptor */ diff --git a/src/main/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java b/src/main/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java index 1fbe918e..b088cfa1 100644 --- a/src/main/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java +++ b/src/main/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/descriptor/TaglibDescriptor.java b/src/main/java/javax/servlet/descriptor/TaglibDescriptor.java index bbec79a3..19ee5307 100644 --- a/src/main/java/javax/servlet/descriptor/TaglibDescriptor.java +++ b/src/main/java/javax/servlet/descriptor/TaglibDescriptor.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/descriptor/package.html b/src/main/java/javax/servlet/descriptor/package.html index 5e5b4241..d25c8457 100644 --- a/src/main/java/javax/servlet/descriptor/package.html +++ b/src/main/java/javax/servlet/descriptor/package.html @@ -5,19 +5,19 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2009-2017 Oracle and/or its affiliates. All rights reserved. The contents of this file are subject to the terms of either the GNU General Public License Version 2 only ("GPL") or the Common Development and Distribution License("CDDL") (collectively, the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the License at - https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - or packager/legal/LICENSE.txt. See the License for the specific + https://oss.oracle.com/licenses/CDDL+GPL-1.1 + or LICENSE.txt. See the License for the specific language governing permissions and limitations under the License. When distributing the software, include this License Header Notice in each - file and include the License file at packager/legal/LICENSE.txt. + file and include the License file at LICENSE.txt. GPL Classpath Exception: Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/http/Cookie.java b/src/main/java/javax/servlet/http/Cookie.java index 42176832..cfd85829 100644 --- a/src/main/java/javax/servlet/http/Cookie.java +++ b/src/main/java/javax/servlet/http/Cookie.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/http/HttpFilter.java b/src/main/java/javax/servlet/http/HttpFilter.java new file mode 100644 index 00000000..5b3635d8 --- /dev/null +++ b/src/main/java/javax/servlet/http/HttpFilter.java @@ -0,0 +1,164 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.servlet.http; + +import java.io.IOException; +import javax.servlet.FilterChain; +import javax.servlet.GenericFilter; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + + +/** + * + *

    Provides an abstract class to be subclassed to create + * an HTTP filter suitable for a Web site. A subclass of + * HttpFilter should override {@link #doFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) }.

    + * + *

    Filters typically run on multithreaded servers, + * so be aware that a filter must handle concurrent + * requests and be careful to synchronize access to shared resources. + * Shared resources include in-memory data such as + * instance or class variables and external objects + * such as files, database connections, and network + * connections. + * See the + * + * Java Tutorial on Multithreaded Programming for more + * information on handling multiple threads in a Java program. + * + * @author Various + * + * @since Servlet 4.0 + */ + +public abstract class HttpFilter extends GenericFilter +{ + + /** + *

    Does nothing, because this is an abstract class.

    + * + * @since 4.0 + */ + + public HttpFilter() { } + + /** + * + *

    The doFilter method of the Filter is called by the + * container each time a request/response pair is passed through the + * chain due to a client request for a resource at the end of the chain. + * The FilterChain passed in to this method allows the Filter to pass + * on the request and response to the next entity in the chain. There's no need to + * override this method.

    + * + *

    The default implementation inspects the incoming {@code req} and {@code res} + * objects to determine if they are instances of {@link HttpServletRequest} + * and {@link HttpServletResponse}, respectively. If not, a {@link ServletException} is thrown. + * Otherwise, the protected {@link #doFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain)} + * method is called.

    + * + * @param req a {@link ServletRequest} object that + * contains the request the client has made + * of the filter + * + * @param res a {@link ServletResponse} object that + * contains the response the filter sends + * to the client + * + * @param chain the FilterChain for invoking the next filter or the resource + * + * @throws IOException if an input or output error is + * detected when the filter handles + * the request + * + * @throws ServletException if the request for the could not be handled or + * either parameter is not an instance of the respective {@link HttpServletRequest} + * or {@link HttpServletResponse}. + * + * @since Servlet 4.0 + */ + @Override + public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { + if (!(req instanceof HttpServletRequest && + res instanceof HttpServletResponse)) { + throw new ServletException("non-HTTP request or response"); + } + + this.doFilter((HttpServletRequest)req, (HttpServletResponse)res, chain); + } + + /** + * + *

    The doFilter method of the Filter is called by the + * container each time a request/response pair is passed through the + * chain due to a client request for a resource at the end of the chain. + * The FilterChain passed in to this method allows the Filter to pass + * on the request and response to the next entity in the chain.

    + * + *

    The default implementation simply calls {@link FilterChain#doFilter}

    + * + * @param req a {@link HttpServletRequest} object that + * contains the request the client has made + * of the filter + * + * @param res a {@link HttpServletResponse} object that + * contains the response the filter sends + * to the client + * + * @param chain the FilterChain for invoking the next filter or the resource + * + * @throws IOException if an input or output error is + * detected when the filter handles + * the request + * + * @throws ServletException if the request for the could not be handled + * + * @since Servlet 4.0 + */ + protected void doFilter(HttpServletRequest req, HttpServletResponse res, FilterChain chain) throws IOException, ServletException { + chain.doFilter(req, res); + } + +} + + diff --git a/src/main/java/javax/servlet/http/HttpServlet.java b/src/main/java/javax/servlet/http/HttpServlet.java index eb0e483f..46f16f08 100644 --- a/src/main/java/javax/servlet/http/HttpServlet.java +++ b/src/main/java/javax/servlet/http/HttpServlet.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -65,7 +24,6 @@ import java.lang.reflect.Method; import java.text.MessageFormat; import java.util.Enumeration; -import java.util.Locale; import java.util.ResourceBundle; import javax.servlet.*; @@ -106,7 +64,7 @@ * such as files, database connections, and network * connections. * See the - * + * * Java Tutorial on Multithreaded Programming for more * information on handling multiple threads in a Java program. * @@ -196,11 +154,11 @@ public HttpServlet() { } * contains the response the servlet sends * to the client * - * @exception IOException if an input or output error is + * @throws IOException if an input or output error is * detected when the servlet handles * the GET request * - * @exception ServletException if the request for the GET + * @throws ServletException if the request for the GET * could not be handled * * @see javax.servlet.ServletResponse#setContentType @@ -275,9 +233,9 @@ protected long getLastModified(HttpServletRequest req) { * @param resp the response object that the servlet * uses to return the headers to the clien * - * @exception IOException if an input or output error occurs + * @throws IOException if an input or output error occurs * - * @exception ServletException if the request for the HEAD + * @throws ServletException if the request for the HEAD * could not be handled */ protected void doHead(HttpServletRequest req, HttpServletResponse resp) @@ -338,11 +296,11 @@ protected void doHead(HttpServletRequest req, HttpServletResponse resp) * contains the response the servlet sends * to the client * - * @exception IOException if an input or output error is + * @throws IOException if an input or output error is * detected when the servlet handles * the request * - * @exception ServletException if the request for the POST + * @throws ServletException if the request for the POST * could not be handled * * @see javax.servlet.ServletOutputStream @@ -396,11 +354,11 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp) * contains the response the servlet returns * to the client * - * @exception IOException if an input or output error occurs + * @throws IOException if an input or output error occurs * while the servlet is handling the * PUT request * - * @exception ServletException if the request for the PUT + * @throws ServletException if the request for the PUT * cannot be handled */ protected void doPut(HttpServletRequest req, HttpServletResponse resp) @@ -442,11 +400,11 @@ protected void doPut(HttpServletRequest req, HttpServletResponse resp) * contains the response the servlet returns * to the client * - * @exception IOException if an input or output error occurs + * @throws IOException if an input or output error occurs * while the servlet is handling the * DELETE request * - * @exception ServletException if the request for the + * @throws ServletException if the request for the * DELETE cannot be handled */ protected void doDelete(HttpServletRequest req, @@ -513,11 +471,11 @@ private Method[] getAllDeclaredMethods(Class c) { * contains the response the servlet returns * to the client * - * @exception IOException if an input or output error occurs + * @throws IOException if an input or output error occurs * while the servlet is handling the * OPTIONS request * - * @exception ServletException if the request for the + * @throws ServletException if the request for the * OPTIONS cannot be handled */ protected void doOptions(HttpServletRequest req, HttpServletResponse resp) @@ -613,11 +571,11 @@ protected void doOptions(HttpServletRequest req, HttpServletResponse resp) * contains the response the servlet returns * to the client * - * @exception IOException if an input or output error occurs + * @throws IOException if an input or output error occurs * while the servlet is handling the * TRACE request * - * @exception ServletException if the request for the + * @throws ServletException if the request for the * TRACE cannot be handled */ protected void doTrace(HttpServletRequest req, HttpServletResponse resp) @@ -665,11 +623,11 @@ protected void doTrace(HttpServletRequest req, HttpServletResponse resp) * contains the response the servlet returns * to the client * - * @exception IOException if an input or output error occurs + * @throws IOException if an input or output error occurs * while the servlet is handling the * HTTP request * - * @exception ServletException if the HTTP request + * @throws ServletException if the HTTP request * cannot be handled * * @see javax.servlet.Servlet#service @@ -763,12 +721,14 @@ private void maybeSetLastModified(HttpServletResponse resp, * contains the response the servlet returns * to the client * - * @exception IOException if an input or output error occurs + * @throws IOException if an input or output error occurs * while the servlet is handling the * HTTP request * - * @exception ServletException if the HTTP request cannot - * be handled + * @throws ServletException if the HTTP request cannot + * be handled or if either parameter is not + * an instance of its respective {@link HttpServletRequest} + * or {@link HttpServletResponse} counterparts. * * @see javax.servlet.Servlet#service */ diff --git a/src/main/java/javax/servlet/http/HttpServletMapping.java b/src/main/java/javax/servlet/http/HttpServletMapping.java new file mode 100644 index 00000000..3e057e23 --- /dev/null +++ b/src/main/java/javax/servlet/http/HttpServletMapping.java @@ -0,0 +1,174 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.servlet.http; + +/** + *

    Allows runtime discovery of the manner in which the {@link + * HttpServlet} for the current {@link HttpServletRequest} was invoked. + * Invoking any of the methods must not block the caller. The + * implementation must be thread safe. Instances are immutable and are + * returned from {@link HttpServletRequest#getHttpServletMapping}.

    + * + *

    Following are some illustrative examples for various combinations + * of mappings. Consider the following Servlet declaration:

    + * + *
    
    + * <servlet>
    + *     <servlet-name>MyServlet</servlet-name>
    + *     <servlet-class>MyServlet</servlet-class>
    + * </servlet>
    + * <servlet-mapping>
    + *     <servlet-name>MyServlet</servlet-name>
    + *     <url-pattern>/MyServlet</url-pattern>
    + *     <url-pattern>""</url-pattern>
    + *     <url-pattern>*.extension</url-pattern>
    + *     <url-pattern>/path/*</url-pattern>
    + * </servlet-mapping>
    + * 
    + * + *

    The expected values of the properties for various incoming URI + * path values are as shown in this table. The {@code servletName} + * column is omitted as its value is always {@code MyServlet}.

    + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    Expected values of properties for various URI paths
    URI Path (in quotes)matchValuepatternmappingMatch
    """"""CONTEXT_ROOT
    "/index.html"""/DEFAULT
    "/MyServlet"MyServlet/MyServletEXACT
    "/foo.extension"foo*.extensionEXTENSION
    "/path/foo"foo/path/*PATH
    + * + * @since 4.0 + */ +public interface HttpServletMapping { + + + + /** + *

    Return the portion of the URI path that caused this request to + * be matched. If the {@link getMappingMatch} value is {@code + * CONTEXT_ROOT} or {@code DEFAULT}, this method must return the + * empty string. If the {@link getMappingMatch} value is {@code + * EXACT}, this method must return the portion of the path that + * matched the servlet, omitting any leading slash. If the {@link + * getMappingMatch} value is {@code EXTENSION} or {@code PATH}, this + * method must return the value that matched the '*'. See the class + * javadoc for examples.

    + * + * @return the match. + * + * @since 4.0 + */ + public String getMatchValue(); + + /** + *

    Return the String representation for the {@code url-pattern} + * for this mapping. If the {@link getMappingMatch} value is {@code + * CONTEXT_ROOT} or {@code DEFAULT}, this method must return the + * empty string. If the {@link getMappingMatch} value is {@code + * EXTENSION}, this method must return the pattern, without any + * leading slash. Otherwise, this method returns the pattern + * exactly as specified in the descriptor or Java configuration.

    + * + * @return the String representation for the + * {@code url-pattern} for this mapping. + * + * @since 4.0 + */ + public String getPattern(); + + /** + *

    Return the String representation for the {@code servlet-name} + * for this mapping. If the Servlet providing the response is the + * default servlet, the return from this method is the name of the + * defautl servlet, which is container specific.

    + * + * @return the String representation for the {@code servlet-name} + * for this mapping. + * + * @since 4.0 + */ + public String getServletName(); + + /** + *

    Return the {@link MappingMatch} for this + * instance

    + * + * @return the {@code MappingMatch} for this instance. + * + * @since 4.0 + */ + public MappingMatch getMappingMatch(); + +} diff --git a/src/main/java/javax/servlet/http/HttpServletRequest.java b/src/main/java/javax/servlet/http/HttpServletRequest.java index d41f32f6..3f0a0d0b 100644 --- a/src/main/java/javax/servlet/http/HttpServletRequest.java +++ b/src/main/java/javax/servlet/http/HttpServletRequest.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -60,15 +19,16 @@ import java.io.IOException; import java.util.*; +import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.ServletRequest; /** * - * Extends the {@link javax.servlet.ServletRequest} interface - * to provide request information for HTTP servlets. + * Extends the {@link javax.servlet.ServletRequest} interface to provide + * request information for HTTP servlets. * - *

    The servlet container creates an HttpServletRequest + *

    The servlet container creates an HttpServletRequest * object and passes it as an argument to the servlet's service * methods (doGet, doPost, etc). * @@ -100,23 +60,23 @@ public interface HttpServletRequest extends ServletRequest { /** * Returns the name of the authentication scheme used to protect - * the servlet. All servlet containers support basic, form and client - * certificate authentication, and may additionally support digest + * the servlet. All servlet containers support basic, form and client + * certificate authentication, and may additionally support digest * authentication. - * If the servlet is not authenticated null is returned. + * If the servlet is not authenticated null is returned. * *

    Same as the value of the CGI variable AUTH_TYPE. * - * @return one of the static members BASIC_AUTH, + * @return one of the static members BASIC_AUTH, * FORM_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH * (suitable for == comparison) or * the container-specific string indicating * the authentication scheme, or - * null if the request was - * not authenticated. + * null if the request was + * not authenticated. */ public String getAuthType(); - + /** * Returns an array containing all of the Cookie * objects the client sent with this request. @@ -130,10 +90,10 @@ public interface HttpServletRequest extends ServletRequest { /** * Returns the value of the specified request header - * as a long value that represents a + * as a long value that represents a * Date object. Use this method with * headers that contain dates, such as - * If-Modified-Since. + * If-Modified-Since. * *

    The date is returned as * the number of milliseconds since January 1, 1970 GMT. @@ -179,8 +139,8 @@ public interface HttpServletRequest extends ServletRequest { * header, or null * if the request does not * have a header of that name - */ - public String getHeader(String name); + */ + public String getHeader(String name); /** * Returns all the values of the specified request header @@ -203,12 +163,12 @@ public interface HttpServletRequest extends ServletRequest { * the values of the requested header. If * the request does not have any headers of * that name return an empty - * enumeration. If + * enumeration. If * the container does not allow access to * header information, return null - */ - public Enumeration getHeaders(String name); - + */ + public Enumeration getHeaders(String name); + /** * Returns an enumeration of all the header names * this request contains. If the request has no @@ -227,7 +187,7 @@ public interface HttpServletRequest extends ServletRequest { * null */ public Enumeration getHeaderNames(); - + /** * Returns the value of the specified request header * as an int. If the request does not have a header @@ -240,7 +200,7 @@ public interface HttpServletRequest extends ServletRequest { * @param name a String specifying the name * of a request header * - * @return an integer expressing the value + * @return an integer expressing the value * of the request header or -1 * if the request doesn't have a * header of this name @@ -250,19 +210,99 @@ public interface HttpServletRequest extends ServletRequest { * to an int */ public int getIntHeader(String name); + + /** + *

    Return the {@link HttpServletMapping} by which the {@link + * HttpServlet} for this {@code HttpServletRequest} was invoked. + * The mappings for any applicable {@link javax.servlet.Filter}s are + * not indicated in the result. If the currently active {@link + * javax.servlet.Servlet} invocation was obtained by a call to + * {@link ServletRequest#getRequestDispatcher} followed by a call to + * {@link RequestDispatcher#forward}, the returned {@code + * HttpServletMapping} is the one corresponding to the path used to + * obtain the {@link RequestDispatcher}. If the currently active + * {@code Servlet} invocation was obtained by a call to {@link + * ServletRequest#getRequestDispatcher} followed by a call to {@link + * RequestDispatcher#include}, the returned {@code + * HttpServletMapping} is the one corresponding to the path that + * caused the first {@code Servlet} in the invocation sequence to be + * invoked. If the currently active {@code Servlet} invocation was + * obtained by a call to {@link + * javax.servlet.AsyncContext#dispatch}, the returned {@code + * HttpServletMapping} is the one corresponding to the path that + * caused the first {@code Servlet} in the invocation sequence to be + * invoked. See {@link + * javax.servlet.RequestDispatcher#FORWARD_MAPPING}, {@link + * javax.servlet.RequestDispatcher#INCLUDE_MAPPING} and {@link + * javax.servlet.AsyncContext#ASYNC_MAPPING} for additional request + * attributes related to {@code HttpServletMapping}. If the + * currently active {@code Servlet} invocation was obtained by a + * call to {@link javax.servlet.ServletContext#getNamedDispatcher}, + * the returned {@code HttpServletMapping} is the one corresponding + * to the path for the mapping last applied to this request.

    + * + *

    The returned object is immutable. Servlet 4.0 compliant + * implementations must override this method.

    + * + * @implSpec The default implementation returns a {@code + * HttpServletMapping} that returns the empty string for the match + * value, pattern and servlet name and {@code null} for the match + * type. + * + * @return An instance of {@code HttpServletMapping} describing the manner in which + * the current request was invoked. + * + * @since 4.0 + */ + + default public HttpServletMapping getHttpServletMapping() { + return new HttpServletMapping() { + @Override + public String getMatchValue() { + return ""; + } + + @Override + public String getPattern() { + return ""; + } + + @Override + public String getServletName() { + return ""; + } + + @Override + public MappingMatch getMappingMatch() { + return null; + } + + @Override + public String toString() { + return "MappingImpl{" + "matchValue=" + getMatchValue() + + ", pattern=" + getPattern() + ", servletName=" + + getServletName() + ", mappingMatch=" + getMappingMatch() + + "} HttpServletRequest {" + HttpServletRequest.this.toString() + + '}'; + } + + + + }; + } /** - * Returns the name of the HTTP method with which this + * Returns the name of the HTTP method with which this * request was made, for example, GET, POST, or PUT. * Same as the value of the CGI variable REQUEST_METHOD. * - * @return a String + * @return a String * specifying the name * of the method with which * this request was made */ public String getMethod(); - + /** * Returns any extra path information associated with * the URL the client sent when it made this request. @@ -276,7 +316,7 @@ public interface HttpServletRequest extends ServletRequest { *

    Same as the value of the CGI variable PATH_INFO. * * @return a String, decoded by the - * web container, specifying + * web container, specifying * extra path information that comes * after the servlet path but before * the query string in the request URL; @@ -304,6 +344,25 @@ public interface HttpServletRequest extends ServletRequest { */ public String getPathTranslated(); + /** + * Instantiates a new instance of {@link PushBuilder} for issuing server + * push responses from the current request. This method returns null + * if the current connection does not support server push, or server + * push has been disabled by the client via a + * {@code SETTINGS_ENABLE_PUSH} settings frame value of {@code 0} (zero). + * + * @implSpec + * The default implementation returns null. + * + * @return a {@link PushBuilder} for issuing server push responses + * from the current request, or null if push is not supported + * + * @since Servlet 4.0 + */ + default public PushBuilder newPushBuilder() { + return null; + } + /** * Returns the portion of the request URI that indicates the context * of the request. The context path always comes first in a request @@ -328,26 +387,26 @@ public interface HttpServletRequest extends ServletRequest { * @see javax.servlet.ServletContext#getContextPath() */ public String getContextPath(); - + /** * Returns the query string that is contained in the request * URL after the path. This method returns null * if the URL does not have a query string. Same as the value - * of the CGI variable QUERY_STRING. + * of the CGI variable QUERY_STRING. * * @return a String containing the query - * string or null if the URL + * string or null if the URL * contains no query string. The value is not * decoded by the container. */ public String getQueryString(); - + /** * Returns the login of the user making this request, if the - * user has been authenticated, or null if the user + * user has been authenticated, or null if the user * has not been authenticated. * Whether the user name is sent with each subsequent request - * depends on the browser and type of authentication. Same as the + * depends on the browser and type of authentication. Same as the * value of the CGI variable REMOTE_USER. * * @return a String specifying the login @@ -355,19 +414,19 @@ public interface HttpServletRequest extends ServletRequest { * if the user login is not known */ public String getRemoteUser(); - + /** * Returns a boolean indicating whether the authenticated user is included * in the specified logical "role". Roles and role membership can be * defined using deployment descriptors. If the user has not been * authenticated, the method returns false. * - *

    The role name โ€œ*โ€ should never be used as an argument in calling + *

    The role name "*" should never be used as an argument in calling * isUserInRole. Any call to isUserInRole with - * โ€œ*โ€ must return false. - * If the role-name of the security-role to be tested is โ€œ**โ€, and + * "*" must return false. + * If the role-name of the security-role to be tested is "**", and * the application has NOT declared an application security-role with - * role-name โ€œ**โ€, isUserInRole must only return true if + * role-name "**", isUserInRole must only return true if * the user has been authenticated; that is, only when * {@link #getRemoteUser} and {@link #getUserPrincipal} would both return * a non-null value. Otherwise, the container must check @@ -378,11 +437,11 @@ public interface HttpServletRequest extends ServletRequest { * * @return a boolean indicating whether * the user making this request belongs to a given role; - * false if the user has not been + * false if the user has not been * authenticated */ public boolean isUserInRole(String role); - + /** * Returns a java.security.Principal object containing * the name of the current authenticated user. If the user has not been @@ -390,11 +449,11 @@ public interface HttpServletRequest extends ServletRequest { * * @return a java.security.Principal containing * the name of the user making this request; - * null if the user has not been + * null if the user has not been * authenticated */ public java.security.Principal getUserPrincipal(); - + /** * Returns the session ID specified by the client. This may * not be the same as the ID of the current valid session @@ -409,13 +468,13 @@ public interface HttpServletRequest extends ServletRequest { * @see #isRequestedSessionIdValid */ public String getRequestedSessionId(); - + /** * Returns the part of this request's URL from the protocol * name up to the query string in the first line of the HTTP request. * The web container does not decode this String. * For example: - * + * * * * @@ -429,13 +488,13 @@ public interface HttpServletRequest extends ServletRequest { * {@link HttpUtils#getRequestURL}. * * @return a String containing - * the part of the URL from the + * the part of the URL from the * protocol name up to the query string * * @see HttpUtils#getRequestURL */ public String getRequestURI(); - + /** * Reconstructs the URL the client used to make the request. * The returned URL contains a protocol, server name, port @@ -479,11 +538,11 @@ public interface HttpServletRequest extends ServletRequest { * using the "/*" pattern. */ public String getServletPath(); - + /** * Returns the current HttpSession * associated with this request or, if there is no - * current session and create is true, returns + * current session and create is true, returns * a new session. * *

    If create is false @@ -491,17 +550,17 @@ public interface HttpServletRequest extends ServletRequest { * this method returns null. * *

    To make sure the session is properly maintained, - * you must call this method before + * you must call this method before * the response is committed. If the container is using cookies * to maintain session integrity and is asked to create a new session * when the response is committed, an IllegalStateException is thrown. * * @param create true to create - * a new session for this request if necessary; + * a new session for this request if necessary; * false to return null * if there's no current session * - * @return the HttpSession associated + * @return the HttpSession associated * with this request or null if * create is false * and the request has no valid session @@ -513,7 +572,7 @@ public interface HttpServletRequest extends ServletRequest { /** * Returns the current session associated with this request, * or if the request does not have a session, creates one. - * + * * @return the HttpSession associated * with this request * @@ -523,7 +582,7 @@ public interface HttpServletRequest extends ServletRequest { /** * Change the session id of the current session associated with this - * request and return the new session id. + * request and return the new session id. * * @return the new session id * @@ -533,12 +592,12 @@ public interface HttpServletRequest extends ServletRequest { * @since Servlet 3.1 */ public String changeSessionId(); - + /** * Checks whether the requested session ID is still valid. * *

    If the client did not specify any session ID, this method returns - * false. + * false. * * @return true if this * request has an id for a valid session @@ -550,53 +609,59 @@ public interface HttpServletRequest extends ServletRequest { * @see HttpSessionContext */ public boolean isRequestedSessionIdValid(); - + /** - * Checks whether the requested session ID came in as a cookie. + *

    Checks whether the requested session ID was conveyed to the + * server as an HTTP cookie.

    * * @return true if the session ID - * came in as a + * was conveyed to the server an an HTTP * cookie; otherwise, false * * @see #getSession - */ + */ public boolean isRequestedSessionIdFromCookie(); - + /** - * Checks whether the requested session ID came in as part of the - * request URL. + *

    Checks whether the requested session ID was conveyed to the + * server as part of the request URL.

    * - * @return true if the session ID - * came in as part of a URL; otherwise, + * @return true if the session ID was conveyed to the + * server as part of a URL; otherwise, * false * * @see #getSession */ public boolean isRequestedSessionIdFromURL(); - + /** * @deprecated As of Version 2.1 of the Java Servlet * API, use {@link #isRequestedSessionIdFromURL} * instead. + * + * @return true if the session ID was conveyed to the + * server as part of a URL; otherwise, + * false */ + @Deprecated public boolean isRequestedSessionIdFromUrl(); /** - * Use the container login mechanism configured for the - * ServletContext to authenticate the user making - * this request. - * - *

    This method may modify and commit the argument + * Use the container login mechanism configured for the + * ServletContext to authenticate the user making + * this request. + * + *

    This method may modify and commit the argument * HttpServletResponse. - * - * @param response The HttpServletResponse + * + * @param response The HttpServletResponse * associated with this HttpServletRequest - * + * * @return true when non-null values were or have been - * established as the values returned by getUserPrincipal, - * getRemoteUser, and getAuthType. Return - * false if authentication is incomplete and the underlying - * login mechanism has committed, in the response, the message (e.g., + * established as the values returned by getUserPrincipal, + * getRemoteUser, and getAuthType. Return + * false if authentication is incomplete and the underlying + * login mechanism has committed, in the response, the message (e.g., * challenge) and HTTP status code to be returned to the user. * * @throws IOException if an input or output error occurred while @@ -604,60 +669,60 @@ public interface HttpServletRequest extends ServletRequest { * * @throws IllegalStateException if the login mechanism attempted to * modify the response and it was already committed - * + * * @throws ServletException if the authentication failed and - * the caller is responsible for handling the error (i.e., the - * underlying login mechanism did NOT establish the message and + * the caller is responsible for handling the error (i.e., the + * underlying login mechanism did NOT establish the message and * HTTP status code to be returned to the user) * * @since Servlet 3.0 */ - public boolean authenticate(HttpServletResponse response) + public boolean authenticate(HttpServletResponse response) throws IOException,ServletException; /** - * Validate the provided username and password in the password validation - * realm used by the web container login mechanism configured for the + * Validate the provided username and password in the password validation + * realm used by the web container login mechanism configured for the * ServletContext. - * - *

    This method returns without throwing a ServletException - * when the login mechanism configured for the ServletContext + * + *

    This method returns without throwing a ServletException + * when the login mechanism configured for the ServletContext * supports username password validation, and when, at the time of the * call to login, the identity of the caller of the request had - * not been established (i.e, all of getUserPrincipal, - * getRemoteUser, and getAuthType return null), - * and when validation of the provided credentials is successful. + * not been established (i.e, all of getUserPrincipal, + * getRemoteUser, and getAuthType return null), + * and when validation of the provided credentials is successful. * Otherwise, this method throws a ServletException as * described below. - * + * *

    When this method returns without throwing an exception, it must * have established non-null values as the values returned by - * getUserPrincipal, getRemoteUser, and + * getUserPrincipal, getRemoteUser, and * getAuthType. - * + * * @param username The String value corresponding to * the login identifier of the user. - * + * * @param password The password String corresponding * to the identified user. * - * @exception ServletException if the configured login mechanism - * does not support username - * password authentication, or if a - * non-null caller identity had - * already been established (prior - * to the call to login), or if - * validation of the provided + * @exception ServletException if the configured login mechanism + * does not support username + * password authentication, or if a + * non-null caller identity had + * already been established (prior + * to the call to login), or if + * validation of the provided * username and password fails. * * @since Servlet 3.0 */ - public void login(String username, String password) + public void login(String username, String password) throws ServletException; - + /** - * Establish null as the value returned when - * getUserPrincipal, getRemoteUser, + * Establish null as the value returned when + * getUserPrincipal, getRemoteUser, * and getAuthType is called on the request. * * @exception ServletException if logout fails @@ -674,7 +739,7 @@ public void login(String username, String password) * does not contain any Part components, the returned * Collection will be empty. * - *

    Any changes to the returned Collection must not + *

    Any changes to the returned Collection must not * affect this HttpServletRequest. * * @return a (possibly empty) Collection of the @@ -727,9 +792,12 @@ public void login(String username, String password) public Part getPart(String name) throws IOException, ServletException; /** - * Create an instance of HttpUpgradeHandler for an given + * Creates an instance of HttpUpgradeHandler for a given * class and uses it for the http protocol upgrade processing. * + * @param The {@code Class}, which extends {@link + * HttpUpgradeHandler}, of the {@code handlerClass}. + * @param handlerClass The HttpUpgradeHandler class used for the upgrade. * * @return an instance of the HttpUpgradeHandler @@ -745,4 +813,59 @@ public void login(String username, String password) */ public T upgrade(Class handlerClass) throws IOException, ServletException; + + /** + * Get the request trailer fields. + * + *

    The returned map is not backed by the {@code HttpServletRequest} object, + * so changes in the returned map are not reflected in the + * {@code HttpServletRequest} object, and vice-versa.

    + * + *

    {@link #isTrailerFieldsReady()} should be called first to determine + * if it is safe to call this method without causing an exception.

    + * + * @implSpec + * The default implementation returns an empty map. + * + * @return A map of trailer fields in which all the keys are in lowercase, + * regardless of the case they had at the protocol level. If there are no + * trailer fields, yet {@link #isTrailerFieldsReady} is returning true, + * the empty map is returned. + * + * @throws IllegalStateException if {@link #isTrailerFieldsReady()} is false + * + * @since Servlet 4.0 + */ + default public Map getTrailerFields() { + return Collections.emptyMap(); + } + + /** + * Return a boolean indicating whether trailer fields are ready to read + * using {@link #getTrailerFields}. + * + * This methods returns true immediately if it is known that there is no + * trailer in the request, for instance, the underlying protocol (such + * as HTTP 1.0) does not supports the trailer fields, or the request is + * not in chunked encoding in HTTP 1.1. + * And the method also returns true if both of the following conditions + * are satisfied: + *
      + *
    1. the application has read all the request data and an EOF + * indication has been returned from the {@link #getReader} + * or {@link #getInputStream}. + *
    2. all the trailer fields sent by the client have been received. + * Note that it is possible that the client has sent no trailer fields. + *
    + * + * @implSpec + * The default implementation returns false. + * + * @return a boolean whether trailer fields are ready to read + * + * @since Servlet 4.0 + */ + default public boolean isTrailerFieldsReady() { + return true; + } } diff --git a/src/main/java/javax/servlet/http/HttpServletRequestWrapper.java b/src/main/java/javax/servlet/http/HttpServletRequestWrapper.java index e6ee1191..cb2393e6 100644 --- a/src/main/java/javax/servlet/http/HttpServletRequestWrapper.java +++ b/src/main/java/javax/servlet/http/HttpServletRequestWrapper.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -81,6 +40,8 @@ public class HttpServletRequestWrapper extends ServletRequestWrapper implements /** * Constructs a request object wrapping the given request. * @throws java.lang.IllegalArgumentException if the request is null + + * @param request the {@link HttpServletRequest} to be wrapped. */ public HttpServletRequestWrapper(HttpServletRequest request) { super(request); @@ -152,7 +113,16 @@ public Enumeration getHeaderNames() { public int getIntHeader(String name) { return this._getHttpServletRequest().getIntHeader(name); } - + + /** + *

    The default behavior of this method is to + * return getServletMapping() on the wrapped request object.

    + */ + @Override + public HttpServletMapping getHttpServletMapping() { + return this._getHttpServletRequest().getHttpServletMapping(); + } + /** * The default behavior of this method is to return getMethod() * on the wrapped request object. @@ -320,7 +290,11 @@ public boolean isRequestedSessionIdFromURL() { /** * The default behavior of this method is to return isRequestedSessionIdFromUrl() * on the wrapped request object. + * + * @deprecated As of Version 4.0 of the Java Servlet API, + * use {@link #isRequestedSessionIdFromURL} instead. */ + @Deprecated @Override public boolean isRequestedSessionIdFromUrl() { return this._getHttpServletRequest().isRequestedSessionIdFromUrl(); @@ -388,7 +362,7 @@ public Part getPart(String name) throws IOException, ServletException { } /** - * Create an instance of HttpUpgradeHandler for an given + * Create an instance of HttpUpgradeHandler for a given * class and uses it for the http protocol upgrade processing. * * @since Servlet 3.1 @@ -398,4 +372,37 @@ public T upgrade(Class handlerClass) throws IOException, ServletException { return this._getHttpServletRequest().upgrade(handlerClass); } + + /** + * The default behavior of this method is to call newPushBuilder on the + * wrapped request object. + * + * @since Servlet 4.0 + */ + @Override + public PushBuilder newPushBuilder() { + return this._getHttpServletRequest().newPushBuilder(); + } + + /** + * The default behavior of this method is to call getTrailerFields on the + * wrapped request object. + * + * @since Servlet 4.0 + */ + @Override + public Map getTrailerFields() { + return this._getHttpServletRequest().getTrailerFields(); + } + + /** + * The default behavior of this method is to call isTrailerFieldsReady on the + * wrapped request object. + * + * @since Servlet 4.0 + */ + @Override + public boolean isTrailerFieldsReady() { + return this._getHttpServletRequest().isTrailerFieldsReady(); + } } diff --git a/src/main/java/javax/servlet/http/HttpServletResponse.java b/src/main/java/javax/servlet/http/HttpServletResponse.java index e47ca909..08888aca 100644 --- a/src/main/java/javax/servlet/http/HttpServletResponse.java +++ b/src/main/java/javax/servlet/http/HttpServletResponse.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -60,6 +19,8 @@ import java.io.IOException; import java.util.Collection; +import java.util.Map; +import java.util.function.Supplier; import javax.servlet.ServletResponse; /** @@ -161,6 +122,7 @@ public interface HttpServletResponse extends ServletResponse { * the unchanged URL otherwise. * @exception IllegalArgumentException if the url is not valid */ + @Deprecated public String encodeUrl(String url); /** @@ -172,20 +134,26 @@ public interface HttpServletResponse extends ServletResponse { * the unchanged URL otherwise. * @exception IllegalArgumentException if the url is not valid */ + @Deprecated public String encodeRedirectUrl(String url); /** - * Sends an error response to the client using the specified - * status and clears the buffer. The server defaults to creating the - * response to look like an HTML-formatted server error page - * containing the specified message, setting the content type - * to "text/html". The server will preserve cookies and may clear or - * update any headers needed to serve the error page as a valid response. + *

    Sends an error response to the client using the specified + * status and clears the buffer. The server defaults to creating + * the response to look like an HTML-formatted server error page + * containing the specified message, setting the content type to + * "text/html". The caller is not responsible for + * escaping or re-encoding the message to ensure it is safe with + * respect to the current response encoding and content type. This + * aspect of safety is the responsibility of the container, as it is + * generating the error page containing the message. The server + * will preserve cookies and may clear or update any headers needed + * to serve the error page as a valid response.

    * - * If an error-page declaration has been made for the web application - * corresponding to the status code passed in, it will be served back in - * preference to the suggested msg parameter and the msg parameter will - * be ignored. + *

    If an error-page declaration has been made for the web + * application corresponding to the status code passed in, it will + * be served back in preference to the suggested msg parameter and + * the msg parameter will be ignored.

    * *

    If the response has already been committed, this method throws * an IllegalStateException. @@ -376,6 +344,7 @@ public interface HttpServletResponse extends ServletResponse { * @param sc the status code * @param sm the status message */ + @Deprecated public void setStatus(int sc, String sm); /** @@ -446,7 +415,56 @@ public interface HttpServletResponse extends ServletResponse { */ public Collection getHeaderNames(); - + /** + * Sets the supplier of trailer headers. + * + *

    The trailer header field value is defined as a comma-separated list + * (see Section 3.2.2 and Section 4.1.2 of RFC 7230).

    + * + *

    The supplier will be called within the scope of whatever thread/call + * causes the response content to be completed. Typically this will + * be any thread calling close() on the output stream or writer.

    + * + *

    The trailers that run afoul of the provisions of section 4.1.2 of + * RFC 7230 are ignored.

    + * + *

    The RFC requires the name of every key that is to be in the + * supplied Map is included in the comma separated list that is the value + * of the "Trailer" response header. The application is responsible for + * ensuring this requirement is met. Failure to do so may lead to + * interoperability failures.

    + * + * @implSpec + * The default implementation is a no-op. + * + * @param supplier the supplier of trailer headers + * + * @exception IllegalStateException if it is invoked after the response has + * has been committed, + * or the trailer is not supported in the request, for instance, + * the underlying protocol is HTTP 1.0, or the response is not + * in chunked encoding in HTTP 1.1. + * + * @since Servlet 4.0 + */ + default public void setTrailerFields(Supplier> supplier) { + } + + /** + * Gets the supplier of trailer headers. + * + * @implSpec + * The default implememtation return null. + * + * @return Supplier of trailer headers + * + * @since Servlet 4.0 + */ + default public Supplier> getTrailerFields() { + return null; + } + + /* * Server status codes; see RFC 2068. */ diff --git a/src/main/java/javax/servlet/http/HttpServletResponseWrapper.java b/src/main/java/javax/servlet/http/HttpServletResponseWrapper.java index 21123474..ee922539 100644 --- a/src/main/java/javax/servlet/http/HttpServletResponseWrapper.java +++ b/src/main/java/javax/servlet/http/HttpServletResponseWrapper.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -60,6 +19,8 @@ import java.io.IOException; import java.util.Collection; +import java.util.Map; +import java.util.function.Supplier; import javax.servlet.ServletResponseWrapper; /** @@ -80,6 +41,8 @@ public class HttpServletResponseWrapper extends ServletResponseWrapper implement /** * Constructs a response adaptor wrapping the given response. * @throws java.lang.IllegalArgumentException if the response is null + * + * @param response the {@link HttpServletResponse} to be wrapped. */ public HttpServletResponseWrapper(HttpServletResponse response) { super(response); @@ -132,6 +95,7 @@ public String encodeRedirectURL(String url) { * @deprecated As of version 2.1, use {@link #encodeURL(String url)} * instead */ + @Deprecated @Override public String encodeUrl(String url) { return this._getHttpServletResponse().encodeUrl(url); @@ -144,6 +108,7 @@ public String encodeUrl(String url) { * @deprecated As of version 2.1, use * {@link #encodeRedirectURL(String url)} instead */ + @Deprecated @Override public String encodeRedirectUrl(String url) { return this._getHttpServletResponse().encodeRedirectUrl(url); @@ -248,6 +213,7 @@ public void setStatus(int sc) { * use {@link #setStatus(int)}, to send an error with a description * use {@link #sendError(int, String)} */ + @Deprecated @Override public void setStatus(int sc, String sm) { this._getHttpServletResponse().setStatus(sc, sm); @@ -320,4 +286,32 @@ public Collection getHeaders(String name) { public Collection getHeaderNames() { return _getHttpServletResponse().getHeaderNames(); } + + /** + * The default behaviour of this method is to call + * {@link HttpServletResponse#setTrailerFields} on the wrapped response + * object. + * + * @param supplier of trailer headers + * + * @since Servlet 4.0 + */ + @Override + public void setTrailerFields(Supplier> supplier) { + _getHttpServletResponse().setTrailerFields(supplier); + } + + /** + * The default behaviour of this method is to call + * {@link HttpServletResponse#getTrailerFields} on the wrapped response + * object. + * + * @return supplier of trailer headers + * + * @since Servlet 4.0 + */ + @Override + public Supplier> getTrailerFields() { + return _getHttpServletResponse().getTrailerFields(); + } } diff --git a/src/main/java/javax/servlet/http/HttpSession.java b/src/main/java/javax/servlet/http/HttpSession.java index 23071ed6..158d0bc1 100644 --- a/src/main/java/javax/servlet/http/HttpSession.java +++ b/src/main/java/javax/servlet/http/HttpSession.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -212,7 +171,9 @@ public interface HttpSession { * It will be removed in a future * version of the Java Servlet API. * + * @return the {@link HttpSessionContext} for this session. */ + @Deprecated public HttpSessionContext getSessionContext(); @@ -241,6 +202,7 @@ public interface HttpSession { * @exception IllegalStateException if this method is called on an * invalidated session */ + @Deprecated public Object getValue(String name); @@ -271,6 +233,7 @@ public interface HttpSession { * @exception IllegalStateException if this method is called on an * invalidated session */ + @Deprecated public String[] getValueNames(); @@ -291,7 +254,7 @@ public interface HttpSession { * HttpSessionBindingListener.valueUnbound method is called. * *

    If the value passed in is null, this has the same effect as calling - * removeAttribute(). + * removeAttribute(). * * * @param name the name to which the object is bound; @@ -317,6 +280,7 @@ public interface HttpSession { * @exception IllegalStateException if this method is called on an * invalidated session */ + @Deprecated public void putValue(String name, Object value); @@ -351,6 +315,7 @@ public interface HttpSession { * @exception IllegalStateException if this method is called on an * invalidated session */ + @Deprecated public void removeValue(String name); diff --git a/src/main/java/javax/servlet/http/HttpSessionActivationListener.java b/src/main/java/javax/servlet/http/HttpSessionActivationListener.java index 4d0ead8a..32069275 100644 --- a/src/main/java/javax/servlet/http/HttpSessionActivationListener.java +++ b/src/main/java/javax/servlet/http/HttpSessionActivationListener.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -60,20 +19,38 @@ import java.util.EventListener; - /** Objects that are bound to a session may listen to container - ** events notifying them that sessions will be passivated and that - ** session will be activated. A container that migrates session between VMs - ** or persists sessions is required to notify all attributes bound to sessions - ** implementing HttpSessionActivationListener. - ** - * @since Servlet 2.3 - */ - +/** Objects that are bound to a session may listen to container + * events notifying them that sessions will be passivated and that + * session will be activated. A container that migrates session + * between VMs or persists sessions is required to notify all + * attributes bound to sessions implementing + * HttpSessionActivationListener. + * + * @since Servlet 2.3 + */ + public interface HttpSessionActivationListener extends EventListener { - /** Notification that the session is about to be passivated.*/ - public void sessionWillPassivate(HttpSessionEvent se); - /** Notification that the session has just been activated.*/ - public void sessionDidActivate(HttpSessionEvent se); + /** + * Notification that the session is about to be passivated. + * + * @implSpec + * The default implementation takes no action. + * + * @param se the {@link HttpSessionEvent} indicating the passivation + * of the session + */ + default public void sessionWillPassivate(HttpSessionEvent se) {} + + /** + * Notification that the session has just been activated. + * + * @implSpec + * The default implementation takes no action. + * + * @param se the {@link HttpSessionEvent} indicating the activation + * of the session + */ + default public void sessionDidActivate(HttpSessionEvent se) {} } diff --git a/src/main/java/javax/servlet/http/HttpSessionAttributeListener.java b/src/main/java/javax/servlet/http/HttpSessionAttributeListener.java index 9eb17e3b..2a1eceb0 100644 --- a/src/main/java/javax/servlet/http/HttpSessionAttributeListener.java +++ b/src/main/java/javax/servlet/http/HttpSessionAttributeListener.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -85,7 +44,7 @@ public interface HttpSessionAttributeListener extends EventListener { * @param event the HttpSessionBindingEvent containing the session * and the name and value of the attribute that was added */ - public void attributeAdded(HttpSessionBindingEvent event); + default public void attributeAdded(HttpSessionBindingEvent event) {} /** * Receives notification that an attribute has been removed from a @@ -94,7 +53,7 @@ public interface HttpSessionAttributeListener extends EventListener { * @param event the HttpSessionBindingEvent containing the session * and the name and value of the attribute that was removed */ - public void attributeRemoved(HttpSessionBindingEvent event); + default public void attributeRemoved(HttpSessionBindingEvent event) {} /** * Receives notification that an attribute has been replaced in a @@ -103,7 +62,7 @@ public interface HttpSessionAttributeListener extends EventListener { * @param event the HttpSessionBindingEvent containing the session * and the name and (old) value of the attribute that was replaced */ - public void attributeReplaced(HttpSessionBindingEvent event); + default public void attributeReplaced(HttpSessionBindingEvent event) {} } diff --git a/src/main/java/javax/servlet/http/HttpSessionBindingEvent.java b/src/main/java/javax/servlet/http/HttpSessionBindingEvent.java index 3ccd483d..2538817f 100644 --- a/src/main/java/javax/servlet/http/HttpSessionBindingEvent.java +++ b/src/main/java/javax/servlet/http/HttpSessionBindingEvent.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -114,6 +73,7 @@ public HttpSessionBindingEvent(HttpSession session, String name) { * * @param session the session to which the object is bound or unbound * @param name the name with which the object is bound or unbound + * @param value the object that is bound or unbound * * @see #getName * @see #getSession @@ -148,6 +108,9 @@ public String getName() { * of the removed attribute. If the attribute was replaced, this is the old * value of the attribute. * + * @return the value of the attribute that has been added, removed + * or replaced + * * @since Servlet 2.3 */ public Object getValue() { diff --git a/src/main/java/javax/servlet/http/HttpSessionBindingListener.java b/src/main/java/javax/servlet/http/HttpSessionBindingListener.java index c15fe829..9dd95db4 100644 --- a/src/main/java/javax/servlet/http/HttpSessionBindingListener.java +++ b/src/main/java/javax/servlet/http/HttpSessionBindingListener.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -81,38 +40,35 @@ public interface HttpSessionBindingListener extends EventListener { - - /** * * Notifies the object that it is being bound to * a session and identifies the session. * + * @implSpec + * The default implementation takes no action. + * * @param event the event that identifies the * session * * @see #valueUnbound * */ - - public void valueBound(HttpSessionBindingEvent event); - - + default public void valueBound(HttpSessionBindingEvent event) {} /** * * Notifies the object that it is being unbound * from a session and identifies the session. * + * @implSpec + * The default implementation takes no action. + * * @param event the event that identifies * the session * * @see #valueBound * */ - - public void valueUnbound(HttpSessionBindingEvent event); - - + default public void valueUnbound(HttpSessionBindingEvent event) {} } - diff --git a/src/main/java/javax/servlet/http/HttpSessionContext.java b/src/main/java/javax/servlet/http/HttpSessionContext.java index 3ed6fc45..e9ef0980 100644 --- a/src/main/java/javax/servlet/http/HttpSessionContext.java +++ b/src/main/java/javax/servlet/http/HttpSessionContext.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -75,7 +34,7 @@ * */ - +@Deprecated public interface HttpSessionContext { /** @@ -84,9 +43,11 @@ public interface HttpSessionContext { * no replacement. This method must * return null and will be removed in * a future version of this API. + * @param sessionId the id of the session to be returned * + * @return null in all cases */ - + @Deprecated public HttpSession getSession(String sessionId); @@ -99,8 +60,10 @@ public interface HttpSessionContext { * an empty Enumeration and will be removed * in a future version of this API. * + * @return null + * */ - + @Deprecated public Enumeration getIds(); } diff --git a/src/main/java/javax/servlet/http/HttpSessionEvent.java b/src/main/java/javax/servlet/http/HttpSessionEvent.java index 4c466226..7a348b8d 100644 --- a/src/main/java/javax/servlet/http/HttpSessionEvent.java +++ b/src/main/java/javax/servlet/http/HttpSessionEvent.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -70,6 +29,8 @@ public class HttpSessionEvent extends java.util.EventObject { /** * Construct a session event from the given source. + * + * @param source the {@link HttpSession} corresponding to this event */ public HttpSessionEvent(HttpSession source) { super(source); @@ -77,6 +38,7 @@ public HttpSessionEvent(HttpSession source) { /** * Return the session that changed. + * @return the {@link HttpSession} for this event. */ public HttpSession getSession () { return (HttpSession) super.getSource(); diff --git a/src/main/java/javax/servlet/http/HttpSessionIdListener.java b/src/main/java/javax/servlet/http/HttpSessionIdListener.java index c1d4b8c1..412ea467 100644 --- a/src/main/java/javax/servlet/http/HttpSessionIdListener.java +++ b/src/main/java/javax/servlet/http/HttpSessionIdListener.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -36,7 +36,6 @@ * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. - * */ package javax.servlet.http; diff --git a/src/main/java/javax/servlet/http/HttpSessionListener.java b/src/main/java/javax/servlet/http/HttpSessionListener.java index 507e49d0..9b4dc8c7 100644 --- a/src/main/java/javax/servlet/http/HttpSessionListener.java +++ b/src/main/java/javax/servlet/http/HttpSessionListener.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -84,16 +43,20 @@ public interface HttpSessionListener extends EventListener { /** * Receives notification that a session has been created. * + * @implSpec + * The default implementation takes no action. + * * @param se the HttpSessionEvent containing the session */ - public void sessionCreated(HttpSessionEvent se); + default public void sessionCreated(HttpSessionEvent se) {} /** * Receives notification that a session is about to be invalidated. * + * @implSpec + * The default implementation takes no action. + * * @param se the HttpSessionEvent containing the session */ - public void sessionDestroyed(HttpSessionEvent se); - + default public void sessionDestroyed(HttpSessionEvent se) {} } - diff --git a/src/main/java/javax/servlet/http/HttpUpgradeHandler.java b/src/main/java/javax/servlet/http/HttpUpgradeHandler.java index ec6c411d..23e96891 100644 --- a/src/main/java/javax/servlet/http/HttpUpgradeHandler.java +++ b/src/main/java/javax/servlet/http/HttpUpgradeHandler.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/http/HttpUtils.java b/src/main/java/javax/servlet/http/HttpUtils.java index 552ec125..372f0565 100644 --- a/src/main/java/javax/servlet/http/HttpUtils.java +++ b/src/main/java/javax/servlet/http/HttpUtils.java @@ -1,46 +1,5 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - * - * - * This file incorporates work covered by the following copyright and - * permission notice: - * + * Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -71,6 +30,7 @@ * to the request interfaces. * */ +@Deprecated public class HttpUtils { private static final String LSTRING_FILE = diff --git a/src/main/java/javax/servlet/http/LocalStrings.properties b/src/main/java/javax/servlet/http/LocalStrings.properties index d0f5ca55..e52aa45c 100644 --- a/src/main/java/javax/servlet/http/LocalStrings.properties +++ b/src/main/java/javax/servlet/http/LocalStrings.properties @@ -1,46 +1,5 @@ # -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# -# Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. -# -# The contents of this file are subject to the terms of either the GNU -# General Public License Version 2 only ("GPL") or the Common Development -# and Distribution License("CDDL") (collectively, the "License"). You -# may not use this file except in compliance with the License. You can -# obtain a copy of the License at -# https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html -# or packager/legal/LICENSE.txt. See the License for the specific -# language governing permissions and limitations under the License. -# -# When distributing the software, include this License Header Notice in each -# file and include the License file at packager/legal/LICENSE.txt. -# -# GPL Classpath Exception: -# Oracle designates this particular file as subject to the "Classpath" -# exception as provided by Oracle in the GPL Version 2 section of the License -# file that accompanied this code. -# -# Modifications: -# If applicable, add the following below the License Header, with the fields -# enclosed by brackets [] replaced by your own identifying information: -# "Portions Copyright [year] [name of copyright owner]" -# -# Contributor(s): -# If you wish your version of this file to be governed by only the CDDL or -# only the GPL Version 2, indicate your decision by adding "[Contributor] -# elects to include this software in this distribution under the [CDDL or GPL -# Version 2] license." If you don't indicate a single choice of license, a -# recipient has the option to distribute your version of this file under -# either the CDDL, the GPL Version 2 or to extend the choice of license to -# its licensees as provided above. However, if you add GPL Version 2 code -# and therefore, elected the GPL Version 2 license, then the option applies -# only if the new code is made subject to such option by the copyright -# holder. -# -# -# This file incorporates work covered by the following copyright and -# permission notice: -# +# Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. # Copyright 2004 The Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/http/LocalStrings_es.properties b/src/main/java/javax/servlet/http/LocalStrings_es.properties index 7f9b7f56..65367d98 100644 --- a/src/main/java/javax/servlet/http/LocalStrings_es.properties +++ b/src/main/java/javax/servlet/http/LocalStrings_es.properties @@ -1,46 +1,5 @@ # -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# -# Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. -# -# The contents of this file are subject to the terms of either the GNU -# General Public License Version 2 only ("GPL") or the Common Development -# and Distribution License("CDDL") (collectively, the "License"). You -# may not use this file except in compliance with the License. You can -# obtain a copy of the License at -# https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html -# or packager/legal/LICENSE.txt. See the License for the specific -# language governing permissions and limitations under the License. -# -# When distributing the software, include this License Header Notice in each -# file and include the License file at packager/legal/LICENSE.txt. -# -# GPL Classpath Exception: -# Oracle designates this particular file as subject to the "Classpath" -# exception as provided by Oracle in the GPL Version 2 section of the License -# file that accompanied this code. -# -# Modifications: -# If applicable, add the following below the License Header, with the fields -# enclosed by brackets [] replaced by your own identifying information: -# "Portions Copyright [year] [name of copyright owner]" -# -# Contributor(s): -# If you wish your version of this file to be governed by only the CDDL or -# only the GPL Version 2, indicate your decision by adding "[Contributor] -# elects to include this software in this distribution under the [CDDL or GPL -# Version 2] license." If you don't indicate a single choice of license, a -# recipient has the option to distribute your version of this file under -# either the CDDL, the GPL Version 2 or to extend the choice of license to -# its licensees as provided above. However, if you add GPL Version 2 code -# and therefore, elected the GPL Version 2 license, then the option applies -# only if the new code is made subject to such option by the copyright -# holder. -# -# -# This file incorporates work covered by the following copyright and -# permission notice: -# +# Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. # Copyright 2004 The Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -56,7 +15,7 @@ # limitations under the License. # -# $Id: LocalStrings_es.properties,v 1.1.1.1 2003/01/27 16:07:47 ja120114 Exp $ +# $Id: LocalStrings_es.properties,v 1.1.1.1 2003/01/27 16:07:47 ja120174 Exp $ # # Default localized string information # Localized para Locale es_ES diff --git a/src/main/java/javax/servlet/http/LocalStrings_fr.properties b/src/main/java/javax/servlet/http/LocalStrings_fr.properties index 9bef80c7..0c3f5d60 100644 --- a/src/main/java/javax/servlet/http/LocalStrings_fr.properties +++ b/src/main/java/javax/servlet/http/LocalStrings_fr.properties @@ -1,46 +1,5 @@ # -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# -# Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. -# -# The contents of this file are subject to the terms of either the GNU -# General Public License Version 2 only ("GPL") or the Common Development -# and Distribution License("CDDL") (collectively, the "License"). You -# may not use this file except in compliance with the License. You can -# obtain a copy of the License at -# https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html -# or packager/legal/LICENSE.txt. See the License for the specific -# language governing permissions and limitations under the License. -# -# When distributing the software, include this License Header Notice in each -# file and include the License file at packager/legal/LICENSE.txt. -# -# GPL Classpath Exception: -# Oracle designates this particular file as subject to the "Classpath" -# exception as provided by Oracle in the GPL Version 2 section of the License -# file that accompanied this code. -# -# Modifications: -# If applicable, add the following below the License Header, with the fields -# enclosed by brackets [] replaced by your own identifying information: -# "Portions Copyright [year] [name of copyright owner]" -# -# Contributor(s): -# If you wish your version of this file to be governed by only the CDDL or -# only the GPL Version 2, indicate your decision by adding "[Contributor] -# elects to include this software in this distribution under the [CDDL or GPL -# Version 2] license." If you don't indicate a single choice of license, a -# recipient has the option to distribute your version of this file under -# either the CDDL, the GPL Version 2 or to extend the choice of license to -# its licensees as provided above. However, if you add GPL Version 2 code -# and therefore, elected the GPL Version 2 license, then the option applies -# only if the new code is made subject to such option by the copyright -# holder. -# -# -# This file incorporates work covered by the following copyright and -# permission notice: -# +# Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. # Copyright 2004 The Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/http/LocalStrings_ja.properties b/src/main/java/javax/servlet/http/LocalStrings_ja.properties index 0967d935..eec21481 100644 --- a/src/main/java/javax/servlet/http/LocalStrings_ja.properties +++ b/src/main/java/javax/servlet/http/LocalStrings_ja.properties @@ -1,46 +1,5 @@ # -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# -# Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. -# -# The contents of this file are subject to the terms of either the GNU -# General Public License Version 2 only ("GPL") or the Common Development -# and Distribution License("CDDL") (collectively, the "License"). You -# may not use this file except in compliance with the License. You can -# obtain a copy of the License at -# https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html -# or packager/legal/LICENSE.txt. See the License for the specific -# language governing permissions and limitations under the License. -# -# When distributing the software, include this License Header Notice in each -# file and include the License file at packager/legal/LICENSE.txt. -# -# GPL Classpath Exception: -# Oracle designates this particular file as subject to the "Classpath" -# exception as provided by Oracle in the GPL Version 2 section of the License -# file that accompanied this code. -# -# Modifications: -# If applicable, add the following below the License Header, with the fields -# enclosed by brackets [] replaced by your own identifying information: -# "Portions Copyright [year] [name of copyright owner]" -# -# Contributor(s): -# If you wish your version of this file to be governed by only the CDDL or -# only the GPL Version 2, indicate your decision by adding "[Contributor] -# elects to include this software in this distribution under the [CDDL or GPL -# Version 2] license." If you don't indicate a single choice of license, a -# recipient has the option to distribute your version of this file under -# either the CDDL, the GPL Version 2 or to extend the choice of license to -# its licensees as provided above. However, if you add GPL Version 2 code -# and therefore, elected the GPL Version 2 license, then the option applies -# only if the new code is made subject to such option by the copyright -# holder. -# -# -# This file incorporates work covered by the following copyright and -# permission notice: -# +# Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved. # Copyright 2004 The Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/main/java/javax/servlet/http/MappingMatch.java b/src/main/java/javax/servlet/http/MappingMatch.java new file mode 100644 index 00000000..4077cc57 --- /dev/null +++ b/src/main/java/javax/servlet/http/MappingMatch.java @@ -0,0 +1,75 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.servlet.http; + +/** + *

    Enumeration of Servlet mapping types.

    + * + * @since 4.0 + */ +public enum MappingMatch { + /** + *

    This is used when the mapping was achieved + * with an exact match to the application's context root.

    + */ + CONTEXT_ROOT, + /** + *

    This is used when the mapping was achieved + * with an exact match to the default servlet of the application, the '{@code /}' + * character.

    + */ + DEFAULT, + /** + *

    This is used when the mapping was achieved + * with an exact match to the incoming request.

    + */ + EXACT, + /** + *

    This is used when the mapping was achieved + * using an extension, such as "{@code *.xhtml}".

    + */ + EXTENSION, + /** + *

    This is used when the mapping was achieved + * using a path, such as "{@code /faces/*}".

    + */ + PATH +} diff --git a/src/main/java/javax/servlet/http/Part.java b/src/main/java/javax/servlet/http/Part.java index 550247ca..6df50833 100644 --- a/src/main/java/javax/servlet/http/Part.java +++ b/src/main/java/javax/servlet/http/Part.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" @@ -55,7 +55,7 @@ public interface Part { * Gets the content of this part as an InputStream * * @return The content of this part as an InputStream - * @throws IOException If an error occurs in retrieving the contet + * @throws IOException If an error occurs in retrieving the content * as an InputStream */ public InputStream getInputStream() throws IOException; @@ -98,9 +98,15 @@ public interface Part { * example, file renaming, where possible, rather than copying all of the * underlying data, thus gaining a significant performance benefit. * - * @param fileName the name of the file to which the stream will be - * written. The file is created relative to the location as - * specified in the MultipartConfig + * @param fileName The location into which the uploaded part should + be stored. The value may be a file name or a path. The actual + location of the file in the filesystem is relative to {@link + javax.servlet.MultipartConfigElement#getLocation()}. Absolute + paths are used as provided and are relative to + getLocation(). Note: that this is a system + dependent string and URI notation may not be acceptable on all + systems. For portability, this string should be generated with + the File or Path APIs. * * @throws IOException if an error occurs. */ diff --git a/src/main/java/javax/servlet/http/PushBuilder.java b/src/main/java/javax/servlet/http/PushBuilder.java new file mode 100644 index 00000000..08c68cd2 --- /dev/null +++ b/src/main/java/javax/servlet/http/PushBuilder.java @@ -0,0 +1,279 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package javax.servlet.http; + +import java.util.Set; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +/** + * Build a request to be pushed. + * + * According section 8.2 of RFC 7540, a promised request must be cacheable and + * safe without a request body. + * + *

    A PushBuilder is obtained by calling {@link + * HttpServletRequest#newPushBuilder()}. Each call to this method will + * a new instance of a PushBuilder based off the current {@code + * HttpServletRequest}, or null. Any mutations to the returned PushBuilder are + * not reflected on future returns.

    + * + *

    The instance is initialized as follows:

    + * + *
      + * + *
    • The method is initialized to "GET"
    • + * + *
    • The existing request headers of the current {@link HttpServletRequest} + * are added to the builder, except for: + * + *
        + *
      • Conditional headers (defined in RFC 7232) + *
      • Range headers + *
      • Expect headers + *
      • Authorization headers + *
      • Referrer headers + *
      + * + *
    • + * + *
    • If the request was authenticated, an Authorization header will + * be set with a container generated token that will result in equivalent + * Authorization for the pushed request.
    • + * + *
    • The session ID will be the value returned from {@link + * HttpServletRequest#getRequestedSessionId()}, unless {@link + * HttpServletRequest#getSession(boolean)} has previously been called to + * create a new {@link HttpSession} prior to the call to create the + * {@code PushBuilder}, in which case the new session ID will be used as + * the PushBuilder's requested session ID. Note that the session ID + * returned from the request can effectively come from one of two + * "sources": a cookie or the URL (as specified in {@link + * HttpServletRequest#isRequestedSessionIdFromCookie} and {@link + * HttpServletRequest#isRequestedSessionIdFromURL}, respectively). The + * session ID for the {@code PushBuilder} will also come from the same + * source as the request.
    • + * + *
    • The Referer(sic) header will be set to {@link + * HttpServletRequest#getRequestURL()} plus any {@link + * HttpServletRequest#getQueryString()}
    • + * + *
    • If {@link HttpServletResponse#addCookie(Cookie)} has been called + * on the associated response, then a corresponding Cookie header will be added + * to the PushBuilder, unless the {@link Cookie#getMaxAge()} is <=0, in which + * case the Cookie will be removed from the builder.
    • + * + *
    + * + *

    The {@link #path} method must be called on the {@code PushBuilder} + * instance before the call to {@link #push}. Failure to do so must + * cause an exception to be thrown from {@link + * #push}, as specified in that method.

    + * + *

    A PushBuilder can be customized by chained calls to mutator + * methods before the {@link #push()} method is called to initiate an + * asynchronous push request with the current state of the builder. + * After the call to {@link #push()}, the builder may be reused for + * another push, however the implementation must make it so the {@link + * #path(String)} and conditional headers (defined in RFC 7232) + * values are cleared before returning from {@link #push}. + * All other values are retained over calls to {@link #push()}. + * + * @since Servlet 4.0 + */ +public interface PushBuilder { + /** + *

    Set the method to be used for the push.

    + * + * @throws NullPointerException if the argument is {@code null} + * + * @throws IllegalArgumentException if the argument is the empty String, + * or any non-cacheable or unsafe methods defined in RFC 7231, + * which are POST, PUT, DELETE, CONNECT, OPTIONS and TRACE. + * + * @param method the method to be used for the push. + * @return this builder. + */ + public PushBuilder method(String method); + + /** + * Set the query string to be used for the push. + * + * The query string will be appended to any query String included in a call + * to {@link #path(String)}. Any duplicate parameters must be preserved. + * This method should be used instead of a query in {@link #path(String)} + * when multiple {@link #push()} calls are to be made with the same + * query string. + * @param queryString the query string to be used for the push. + * @return this builder. + */ + public PushBuilder queryString(String queryString); + + /** + * Set the SessionID to be used for the push. + * The session ID will be set in the same way it was on the associated request (ie + * as a cookie if the associated request used a cookie, or as a url parameter if + * the associated request used a url parameter). + * Defaults to the requested session ID or any newly assigned session id from + * a newly created session. + * @param sessionId the SessionID to be used for the push. + * @return this builder. + */ + public PushBuilder sessionId(String sessionId); + + /** + *

    Set a request header to be used for the push. If the builder has an + * existing header with the same name, its value is overwritten.

    + * + * @param name The header name to set + * @param value The header value to set + * @return this builder. + */ + public PushBuilder setHeader(String name, String value); + + /** + *

    Add a request header to be used for the push.

    + * @param name The header name to add + * @param value The header value to add + * @return this builder. + */ + public PushBuilder addHeader(String name, String value); + + /** + *

    Remove the named request header. If the header does not exist, take + * no action.

    + * + * @param name The name of the header to remove + * @return this builder. + */ + public PushBuilder removeHeader(String name); + + /** + * Set the URI path to be used for the push. The path may start + * with "/" in which case it is treated as an absolute path, + * otherwise it is relative to the context path of the associated + * request. There is no path default and {@link #path(String)} must + * be called before every call to {@link #push()}. If a query + * string is present in the argument {@code path}, its contents must + * be merged with the contents previously passed to {@link + * #queryString}, preserving duplicates. + * + * @param path the URI path to be used for the push, which may include a + * query string. + * @return this builder. + */ + public PushBuilder path(String path); + + /** + * Push a resource given the current state of the builder, + * the method must be non-blocking. + * + *

    Push a resource based on the current state of the PushBuilder. + * Calling this method does not guarantee the resource will actually + * be pushed, since it is possible the client can decline acceptance + * of the pushed resource using the underlying HTTP/2 protocol.

    + * + *

    If the builder has a session ID, then the pushed request will + * include the session ID either as a Cookie or as a URI parameter + * as appropriate. The builders query string is merged with any + * passed query string.

    + * + *

    Before returning from this method, the builder has its path, + * conditional headers (defined in RFC 7232) nulled. All other fields + * are left as is for possible reuse in another push.

    + * + * @throws IllegalStateException if there was no call to {@link + * #path} on this instance either between its instantiation or the + * last call to {@code push()} that did not throw an + * IllegalStateException. + */ + public void push(); + + /** + * Return the method to be used for the push. + * + * @return the method to be used for the push. + */ + public String getMethod(); + + /** + * Return the query string to be used for the push. + * + * @return the query string to be used for the push. + */ + public String getQueryString(); + + /** + * Return the SessionID to be used for the push. + * + * @return the SessionID to be used for the push. + */ + public String getSessionId(); + + /** + * Return the set of header to be used for the push. + * + *

    The returned set is not backed by the {@code PushBuilder} object, + * so changes in the returned set are not reflected in the + * {@code PushBuilder} object, and vice-versa.

    + * + * @return the set of header to be used for the push. + */ + public Set getHeaderNames(); + + /** + * Return the header of the given name to be used for the push. + * @param name the name of the header + * + * @return the header of the given name to be used for the push. + */ + public String getHeader(String name); + + /** + * Return the URI path to be used for the push. + * + * @return the URI path to be used for the push. + */ + public String getPath(); +} diff --git a/src/main/java/javax/servlet/http/WebConnection.java b/src/main/java/javax/servlet/http/WebConnection.java index 9ca22e16..cf208d50 100644 --- a/src/main/java/javax/servlet/http/WebConnection.java +++ b/src/main/java/javax/servlet/http/WebConnection.java @@ -1,19 +1,19 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2012-2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" diff --git a/src/main/java/javax/servlet/http/package.html b/src/main/java/javax/servlet/http/package.html index 18fcab13..831ffad3 100644 --- a/src/main/java/javax/servlet/http/package.html +++ b/src/main/java/javax/servlet/http/package.html @@ -1,47 +1,6 @@ + + + + ActiveLayerIndex + 0 + ApplicationVersion + + com.omnigroup.OmniGrafflePro + 139.16.0.171715 + + AutoAdjust + + BackgroundGraphic + + Bounds + {{0, 0}, {576, 753.9000244140625}} + Class + SolidGraphic + ID + 2 + Style + + shadow + + Draws + NO + + stroke + + Draws + NO + + + + BaseZoom + 0 + CanvasOrigin + {0, 0} + ColumnAlign + 1 + ColumnSpacing + 36 + CreationDate + 2006-07-19 19:53:09 +0000 + Creator + Edward Burns + DisplayScale + 1 0/72 in = 1.0000 in + GraphDocumentVersion + 8 + GraphicsList + + + Bounds + {{31, 54.125}, {13, 14}} + Class + ShapedGraphic + FitText + YES + Flow + Resize + ID + 3 + Rotation + 66 + Shape + Rectangle + Style + + fill + + Draws + NO + + shadow + + Draws + NO + + stroke + + Draws + NO + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf510 +{\fonttbl\f0\fnil\fcharset0 AmericanTypewriter;} +{\colortbl;\red255\green255\blue255;\red255\green242\blue230;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc + +\f0\fs24 \cf2 } + VerticalPad + 0 + + Wrap + NO + + + GridInfo + + GuidesLocked + NO + GuidesVisible + YES + HPages + 1 + ImageCounter + 1 + KeepToScale + + Layers + + + Lock + NO + Name + Layer 1 + Print + YES + View + YES + + + LayoutInfo + + Animate + NO + circoMinDist + 18 + circoSeparation + 0.0 + layoutEngine + dot + neatoSeparation + 0.0 + twopiSeparation + 0.0 + + LinksVisible + NO + MagnetsVisible + NO + MasterSheets + + ModificationDate + 2012-12-05 21:20:18 +0000 + Modifier + Edward Burns + NotesVisible + NO + Orientation + 2 + OriginVisible + NO + PageBreaks + YES + PrintInfo + + NSBottomMargin + + float + 4.97998 + + NSHorizonalPagination + + coded + BAtzdHJlYW10eXBlZIHoA4QBQISEhAhOU051bWJlcgCEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAFxlwCG + + NSLeftMargin + + float + 18 + + NSPaperSize + + size + {612, 792} + + NSPrintAllPages + + int + 0 + + NSPrintReverseOrientation + + int + 0 + + NSRightMargin + + float + 18 + + NSTopMargin + + float + 33.12 + + + PrintOnePage + + ReadOnly + NO + RowAlign + 1 + RowSpacing + 36 + SheetTitle + Canvas 1 + SmartAlignmentGuidesActive + YES + SmartDistanceGuidesActive + YES + UniqueID + 1 + UseEntirePage + + VPages + 1 + WindowInfo + + CurrentSheet + 0 + ExpandedCanvases + + Frame + {{78, 0}, {591, 828}} + ListView + + OutlineWidth + 142 + RightSidebar + + Sidebar + + SidebarWidth + 138 + VisibleRegion + {{0.5, 1}, {219.5, 359.5}} + Zoom + 2 + ZoomValues + + + Canvas 1 + 2 + 1.5 + + + + + diff --git a/src/main/javadoc/doc-files/expert-draft-bg-blank.png b/src/main/javadoc/doc-files/expert-draft-bg-blank.png new file mode 100644 index 00000000..346a7d8f Binary files /dev/null and b/src/main/javadoc/doc-files/expert-draft-bg-blank.png differ diff --git a/src/main/javadoc/doc-files/expert-draft-bg-non-blank.graffle b/src/main/javadoc/doc-files/expert-draft-bg-non-blank.graffle new file mode 100644 index 00000000..63b54c2f --- /dev/null +++ b/src/main/javadoc/doc-files/expert-draft-bg-non-blank.graffle @@ -0,0 +1,298 @@ + + + + + + + ActiveLayerIndex + 0 + ApplicationVersion + + com.omnigroup.OmniGrafflePro + 139.18.0.187838 + + AutoAdjust + + BackgroundGraphic + + Bounds + {{0, 0}, {578.800048828125, 754.800048828125}} + Class + SolidGraphic + ID + 2 + Style + + shadow + + Draws + NO + + stroke + + Draws + NO + + + + BaseZoom + 0 + CanvasOrigin + {0, 0} + ColumnAlign + 1 + ColumnSpacing + 36 + CreationDate + 2006-07-19 19:53:09 +0000 + Creator + Edward Burns + DisplayScale + 1 0/72 in = 1.0000 in + GraphDocumentVersion + 8 + GraphicsList + + + Bounds + {{-28, 54.125}, {131, 14}} + Class + ShapedGraphic + FitText + YES + Flow + Resize + ID + 1 + Rotation + 66 + Shape + Rectangle + Style + + fill + + Draws + NO + + shadow + + Draws + NO + + stroke + + Draws + NO + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 +\cocoascreenfonts1{\fonttbl\f0\fnil\fcharset0 AmericanTypewriter;} +{\colortbl;\red255\green255\blue255;\red170\green162\blue153;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc + +\f0\fs24 \cf2 Expert Draft Version} + VerticalPad + 0 + + Wrap + NO + + + GridInfo + + GuidesLocked + NO + GuidesVisible + YES + HPages + 1 + ImageCounter + 1 + KeepToScale + + Layers + + + Lock + NO + Name + Layer 1 + Print + YES + View + YES + + + LayoutInfo + + Animate + NO + circoMinDist + 18 + circoSeparation + 0.0 + layoutEngine + dot + neatoSeparation + 0.0 + twopiSeparation + 0.0 + + LinksVisible + NO + MagnetsVisible + NO + MasterSheets + + ModificationDate + 2011-06-16 16:56:40 +0000 + Modifier + Edward Burns + NotesVisible + NO + Orientation + 2 + OriginVisible + NO + PageBreaks + YES + PrintInfo + + NSBottomMargin + + float + 18.6 + + NSHorizonalPagination + + coded + BAtzdHJlYW10eXBlZIHoA4QBQISEhAhOU051bWJlcgCEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAFxlwCG + + NSLeftMargin + + float + 16.6 + + NSPaperSize + + size + {612.00002479553223, 792} + + NSPrintAllPages + + int + 0 + + NSPrintReverseOrientation + + int + 0 + + NSRightMargin + + float + 16.6 + + NSTopMargin + + float + 18.6 + + + PrintOnePage + + ReadOnly + NO + RowAlign + 1 + RowSpacing + 36 + SheetTitle + Canvas 1 + SmartAlignmentGuidesActive + YES + SmartDistanceGuidesActive + YES + UniqueID + 1 + UseEntirePage + + VPages + 1 + WindowInfo + + CurrentSheet + 0 + ExpandedCanvases + + Frame + {{244, 0}, {591, 828}} + ListView + + OutlineWidth + 142 + RightSidebar + + Sidebar + + SidebarWidth + 138 + VisibleRegion + {{0.5, 2}, {219.5, 351.5}} + Zoom + 2 + ZoomValues + + + Canvas 1 + 2 + 1.5 + + + + + diff --git a/src/main/javadoc/doc-files/expert-draft-bg-non-blank.png b/src/main/javadoc/doc-files/expert-draft-bg-non-blank.png new file mode 100644 index 00000000..714e00cb Binary files /dev/null and b/src/main/javadoc/doc-files/expert-draft-bg-non-blank.png differ diff --git a/src/main/javadoc/doc-files/expert-draft-bg.png b/src/main/javadoc/doc-files/expert-draft-bg.png new file mode 100644 index 00000000..497f46cb Binary files /dev/null and b/src/main/javadoc/doc-files/expert-draft-bg.png differ diff --git a/src/main/javadoc/doc-files/speclicense.html b/src/main/javadoc/doc-files/speclicense.html index ebc818da..ceee9d73 100644 --- a/src/main/javadoc/doc-files/speclicense.html +++ b/src/main/javadoc/doc-files/speclicense.html @@ -11,11 +11,11 @@
    Specification Lead: Oracle America, Inc. ("Specification Lead")
    -Release: April 2013 +Release: April 2017

    -Copyright © 2013 Oracle America, Inc. +Copyright © 2017 Oracle America, Inc.
    All rights reserved.
    diff --git a/src/main/javadoc/javax.servlet-api.css b/src/main/javadoc/javax.servlet-api.css new file mode 100644 index 00000000..4062a9fc --- /dev/null +++ b/src/main/javadoc/javax.servlet-api.css @@ -0,0 +1,641 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2011-2017 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +/* background: url(doc-files/expert-draft-bg.png); */ + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; + width:100%; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} + + +/* Change bars from http://www.geocities.com/hentaihelper/2atimlin.htm */ + +/* + .changed_added_4_0 { cursor: url(doc-files/changed_added_4_0_cursor.cur), auto; + background: url(doc-files/changed_added_4_0.png); + padding-left:0.2em; border-left:solid; + border-left-width:thin; border-right:none; + border-top:none; border-bottom:none; border-color:green } + + .changed_modified_4_0 { cursor: url(doc-files/changed_modified_4_0_cursor.cur), auto; + background: url(doc-files/changed_modified_4_0.png); + padding-left:0.2em; border-left:solid; + border-left-width:thin; border-right:none; + border-top:none; border-bottom:none; border-color:orange } + + .changed_deleted_4_0 { cursor: url(doc-files/changed_deleted_4_0_cursor.cur), auto; + background: url(doc-files/changed_deleted_4_0.png); + padding-left:0.2em; border-left:solid; + border-left-width:thin; border-right:none; + border-top:none; border-bottom:none; border-color:red; + text-decoration: line-through; } + +*/ diff --git a/src/main/resources/META-INF/README b/src/main/resources/META-INF/README index 54f53e00..56bb2b5e 100644 --- a/src/main/resources/META-INF/README +++ b/src/main/resources/META-INF/README @@ -1,7 +1,7 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. The contents of this file are subject to the terms of either the GNU General Public License Version 2 only ("GPL") or the Common Development
    First line of HTTP request Returned Value