diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index cdfe614..7630913 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,3 +1,30 @@
-#### :warning:This project is now part of the EE4J initiative. This repository has been archived as all activities are now happening in the [corresponding Eclipse repository](https://github.com/eclipse-ee4j/jsp-api). See [here](https://www.eclipse.org/ee4j/status.php) for the overall EE4J transition status.
+---
---
+
+# 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
deleted file mode 100644
index b1c74f9..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,759 +0,0 @@
-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)
- * The behaviour is identical to that of the JspPage, except for the signature
- * of the _jspService method, which is now expressible in the Java type
- * system and included explicitly in the interface.
- *
- * @see JspPage
- */
-
-public interface HttpJspPage extends JspPage {
-
- /** The _jspService()method corresponds to the body of the JSP page. This
- * method is defined automatically by the JSP container and should never
- * be defined by the JSP page author.
- *
- * If a superclass is specified using the extends attribute, that
- * superclass may choose to perform some actions in its service() method
- * before or after calling the _jspService() method. See using the extends
- * attribute in the JSP_Engine chapter of the JSP specification.
- *
- * @param request Provides client request information to the JSP.
- * @param response Assists the JSP in sending a response to the client.
- * @throws ServletException Thrown if an error occurred during the
- * processing of the JSP and that the container should take
- * appropriate action to clean up the request.
- * @throws IOException Thrown if an error occurred while writing the
- * response for this page.
- */
- public void _jspService(HttpServletRequest request,
- HttpServletResponse response)
- throws ServletException, IOException;
-}
diff --git a/api/src/main/java/javax/servlet/jsp/JspApplicationContext.java b/api/src/main/java/javax/servlet/jsp/JspApplicationContext.java
deleted file mode 100644
index 3369048..0000000
--- a/api/src/main/java/javax/servlet/jsp/JspApplicationContext.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp;
-
-import javax.el.ELResolver;
-import javax.el.ExpressionFactory;
-import javax.el.ELContextListener;
-
-/**
- * Stores application-scoped information relevant to JSP containers.
- *
- * The JSP container must create a single instance of
- * An instance of The {{ site.title | default: site.github.repository_name }}
+
+ {{ site.description | default: site.github.project_tagline }}
+ {% if site.github.is_project_page %}
+
+ {% endif %}
+ JspApplicationContext for each
- * ServletContext instance.JspApplicationContext is obtained by
- * invoking the static {@link JspFactory#getJspApplicationContext} method,
- * passing the ServletContext of the corresponding web
- * application.JspApplicationContext provides the following services
- * to JSP applications:
- *
- *
- * ELResolvers, which are used to
- * resolve variables in EL expressions contained in JSP pages and
- * tag files.ExpressionFactory for those
- * applications or frameworks that need to perform programmatic
- * evaluation of EL expressions instead of allowing the JSP
- * container to do it for them.ELContextListener instances
- * for notification whenever a new ELContext is created.
- * This is necessary when an application wishes to make custom
- * context objects available to their pluggable
- * ELResolvers.
ELResolver to affect the way EL variables
- * and properties are resolved for EL expressions appearing in JSP pages
- * and tag files.
- *
- * For example, in the EL expression ${employee.lastName}, an
- * ELResolver determines what object "employee"
- * references and how to find its "lastName" property.
When evaluating an expression, the JSP container will consult a - * set of standard resolvers as well as any resolvers registered via - * this method. The set of resolvers are consulted in the following - * order: - *
ELResolvers registered via this method, in the
- * order in which they are registered.It is illegal to register an ELResolver after the
- * application has received any request from the client. If an
- * attempt is made to register an ELResolver after that time,
- * an IllegalStateException is thrown.
ELResolvers are in the chain,
- * aside from the standard ones. It is permissible to add
- * ELResolvers before or after initialization to
- * a CompositeELResolver that is already in the chain.
- *
- * It is not possible to remove an ELResolver registered
- * with this method, once it has been registered.
ELResolver
- * @throws IllegalStateException if an attempt is made to
- * call this method after all ServletContextListeners
- * have had their contextInitialized methods invoked.
- */
- public void addELResolver(ELResolver resolver);
-
- /**
- * Returns a factory used to create ValueExpressions and
- * MethodExpressions so that EL expressions can be
- * parsed and evaluated.
- *
- * @return A concrete implementation of the
- * an ExpressionFactory.
- */
- public ExpressionFactory getExpressionFactory();
-
- /**
- * Registers a ELContextListeners so that context objects
- * can be added whenever a new ELContext is created.
- *
- * At a minimum, the ELContext objects created will
- * contain a reference to the JspContext for this request,
- * which is added by the JSP container.
- * This is sufficient for all the
- * default ELResolvers listed in {@link #addELResolver}.
- * Note that JspContext.class is used as the key to ELContext.putContext()
- * for the JspContext object reference.
This method is generally used by frameworks and applications that
- * register their own ELResolver that needs context other
- * than JspContext. The listener will typically add the
- * necessary context to the ELContext provided in the
- * event object. Registering a listener that adds context allows the
- * ELResolvers in the stack to access the context they
- * need when they do a resolution.
ELContext is created.
- */
- public void addELContextListener(ELContextListener listener);
-}
diff --git a/api/src/main/java/javax/servlet/jsp/JspContext.java b/api/src/main/java/javax/servlet/jsp/JspContext.java
deleted file mode 100644
index 4b4aa65..0000000
--- a/api/src/main/java/javax/servlet/jsp/JspContext.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp;
-
-import java.util.Enumeration;
-
-import javax.servlet.jsp.el.ExpressionEvaluator;
-import javax.servlet.jsp.el.VariableResolver;
-
-import javax.el.ELContext;
-
-/**
- *
- * JspContext serves as the base class for the
- * PageContext class and abstracts all information that is not specific
- * to servlets. This allows for Simple Tag Extensions to be used
- * outside of the context of a request/response Servlet.
- *
- * The JspContext provides a number of facilities to the - * page/component author and page implementor, including: - *
Methods Intended for Container Generated Code - *
- * The following methods enable the management of nested JspWriter
- * streams to implement Tag Extensions: pushBody() and
- * popBody()
- *
- *
Methods Intended for JSP authors - *
- * Some methods provide uniform access to the diverse objects
- * representing scopes.
- * The implementation must use the underlying machinery
- * corresponding to that scope, so information can be passed back and
- * forth between the underlying environment (e.g. Servlets) and JSP pages.
- * The methods are:
- * setAttribute(), getAttribute(),
- * findAttribute(), removeAttribute(),
- * getAttributesScope() and
- * getAttributeNamesInScope().
- *
- *
- * The following methods provide convenient access to implicit objects:
- * getOut()
- *
- *
- * The following methods provide programmatic access to the
- * Expression Language evaluator:
- * The The The returned JspWriter must implement all methods and
- * behave as though it were unbuffered. More specifically:
- * getExpressionEvaluator(), getVariableResolver()
- *
- * @since JSP 2.0
- */
-
-public abstract class JspContext {
-
- /**
- * Sole constructor. (For invocation by subclass constructors,
- * typically implicit.)
- */
- public JspContext() {
- }
-
- /**
- * Register the name and value specified with page scope semantics.
- * If the value passed in is null, this has the same
- * effect as calling
- * removeAttribute( name, PageContext.PAGE_SCOPE ).
- *
- * @param name the name of the attribute to set
- * @param value the value to associate with the name, or null if the
- * attribute is to be removed from the page scope.
- * @throws NullPointerException if the name is null
- */
-
- abstract public void setAttribute(String name, Object value);
-
- /**
- * Register the name and value specified with appropriate
- * scope semantics. If the value passed in is null,
- * this has the same effect as calling
- * removeAttribute( name, scope ).
- *
- * @param name the name of the attribute to set
- * @param value the object to associate with the name, or null if
- * the attribute is to be removed from the specified scope.
- * @param scope the scope with which to associate the name/object
- *
- * @throws NullPointerException if the name is null
- * @throws IllegalArgumentException if the scope is invalid
- * @throws IllegalStateException if the scope is
- * PageContext.SESSION_SCOPE but the page that was requested
- * does not participate in a session or the session has been
- * invalidated.
- */
-
- abstract public void setAttribute(String name, Object value, int scope);
-
- /**
- * Returns the object associated with the name in the page scope or null
- * if not found.
- *
- * @param name the name of the attribute to get
- * @return the object associated with the name in the page scope
- * or null if not found.
- *
- * @throws NullPointerException if the name is null
- */
-
- abstract public Object getAttribute(String name);
-
- /**
- * Return the object associated with the name in the specified
- * scope or null if not found.
- *
- * @param name the name of the attribute to set
- * @param scope the scope with which to associate the name/object
- * @return the object associated with the name in the specified
- * scope or null if not found.
- *
- * @throws NullPointerException if the name is null
- * @throws IllegalArgumentException if the scope is invalid
- * @throws IllegalStateException if the scope is
- * PageContext.SESSION_SCOPE but the page that was requested
- * does not participate in a session or the session has been
- * invalidated.
- */
-
- abstract public Object getAttribute(String name, int scope);
-
- /**
- * Searches for the named attribute in page, request, session (if valid),
- * and application scope(s) in order and returns the value associated or
- * null.
- *
- * @param name the name of the attribute to search for
- * @return the value associated or null
- * @throws NullPointerException if the name is null
- */
-
- abstract public Object findAttribute(String name);
-
- /**
- * Remove the object reference associated with the given name
- * from all scopes. Does nothing if there is no such object.
- *
- * @param name The name of the object to remove.
- * @throws NullPointerException if the name is null
- */
-
- abstract public void removeAttribute(String name);
-
- /**
- * Remove the object reference associated with the specified name
- * in the given scope. Does nothing if there is no such object.
- *
- * @param name The name of the object to remove.
- * @param scope The scope where to look.
- * @throws IllegalArgumentException if the scope is invalid
- * @throws IllegalStateException if the scope is
- * PageContext.SESSION_SCOPE but the page that was requested
- * does not participate in a session or the session has been
- * invalidated.
- * @throws NullPointerException if the name is null
- */
-
- abstract public void removeAttribute(String name, int scope);
-
- /**
- * Get the scope where a given attribute is defined.
- *
- * @param name the name of the attribute to return the scope for
- * @return the scope of the object associated with the name specified or 0
- * @throws NullPointerException if the name is null
- */
-
- abstract public int getAttributesScope(String name);
-
- /**
- * Enumerate all the attributes in a given scope.
- *
- * @param scope the scope to enumerate all the attributes for
- * @return an enumeration of names (java.lang.String) of all the
- * attributes the specified scope
- * @throws IllegalArgumentException if the scope is invalid
- * @throws IllegalStateException if the scope is
- * PageContext.SESSION_SCOPE but the page that was requested
- * does not participate in a session or the session has been
- * invalidated.
- */
-
- abstract public EnumerationjspContext.getELContext().getELResolver().
- * @return A valid instance of a VariableResolver.
- * @since JSP 2.0
- */
- public abstract VariableResolver getVariableResolver();
-
- /**
- * Returns the ELContext associated with this
- * JspContext.
- *
- * ELContext is created lazily and is reused if
- * it already exists. There is a new ELContext for each
- * JspContext.ELContext must contain the ELResolver
- * described in the JSP specification (and in the javadocs for
- * {@link JspApplicationContext#addELResolver}).ELContext associated with this
- * JspContext.
- * @since JSP 2.1
- */
- public abstract ELContext getELContext();
-
- /**
- * Return a new JspWriter object that sends output to the
- * provided Writer. Saves the current "out" JspWriter,
- * and updates the value of the "out" attribute in the
- * page scope attribute namespace of the JspContext.
- *
- *
- *
- * Specification version numbers that consists of positive decimal integers - * separated by periods ".", for example, "2.0" or "1.2.3.4.5.6.7". - * This allows an extensible number to be used to - * represent major, minor, micro, etc versions. - * The version number must begin with a number. - *
- * - * @return the specification version, null is returned if it is not known - */ - - public abstract String getSpecificationVersion(); -} diff --git a/api/src/main/java/javax/servlet/jsp/JspException.java b/api/src/main/java/javax/servlet/jsp/JspException.java deleted file mode 100644 index d1ec280..0000000 --- a/api/src/main/java/javax/servlet/jsp/JspException.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp; - -/** - * A generic exception known to the JSP engine; uncaught - * JspExceptions will result in an invocation of the errorpage - * machinery. - */ - -public class JspException extends Exception { - - /** - * Construct a JspException. - */ - public JspException() { - } - - - /** - * Constructs a new JSP exception with the - * specified message. The message can be written - * to the server log and/or displayed for the user. - * - * @param msg aString
- * specifying the text of
- * the exception message
- *
- */
- public JspException(String msg) {
- super(msg);
- }
-
-
- /**
- * Constructs a new JspException with the specified detail
- * message and cause.
- *
- * The cause is saved for later retrieval by the
- * {@link #getCause()} and {@link #getRootCause()} methods.
- *
- * @see java.lang.Exception#Exception(String, Throwable)
- */
- public JspException(String message, Throwable cause) {
- super(message, cause);
- }
-
-
- /**
- * Constructs a new JspException with the specified cause.
- *
- * The cause is saved for later retrieval by the
- * {@link #getCause()} and {@link #getRootCause()} methods.
- *
- * @see java.lang.Exception#Exception(Throwable)
- */
- public JspException(Throwable cause) {
- super(cause);
- }
-
-
- /**
- * Returns the exception that caused this JSP exception.
- *
- * @return the Throwable
- * that caused this JSP exception
- *
- * @deprecated As of JSP 2.1, replaced by {@link #getCause()}
- */
-
- public Throwable getRootCause() {
- return getCause();
- }
-}
diff --git a/api/src/main/java/javax/servlet/jsp/JspFactory.java b/api/src/main/java/javax/servlet/jsp/JspFactory.java
deleted file mode 100644
index b666114..0000000
--- a/api/src/main/java/javax/servlet/jsp/JspFactory.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.ServletContext;
-import javax.servlet.jsp.PageContext;
-
-/**
- * - * The JspFactory is an abstract class that defines a number of factory - * methods available to a JSP page at runtime for the purposes of creating - * instances of various interfaces and classes used to support the JSP - * implementation. - *
- * A conformant JSP Engine implementation will, during it's initialization
- * instantiate an implementation dependent subclass of this class, and make
- * it globally available for use by JSP implementation classes by registering
- * the instance created with this class via the
- * static setDefaultFactory() method.
- *
- * The only implementation-dependent classes that can be created from the - * factory are: - * PageContext, - * JspEngineInfo, and - * JspApplicationContext. - *
- * With the exception of JspApplicationContext, - * JspFactory objects should not be used by JSP application developers. - */ - -public abstract class JspFactory { - - private static volatile JspFactory deflt = null; - - /** - * Sole constructor. (For invocation by subclass constructors, - * typically implicit.) - */ - public JspFactory() { - } - - /** - *
- * set the default factory for this implementation. It is illegal for - * any principal other than the JSP Engine runtime to call this method. - *
- * - * @param deflt The default factory implementation - */ - - public static void setDefaultFactory(JspFactory deflt) { - JspFactory.deflt = deflt; - } - - /** - * Returns the default factory for this implementation. - * - * @return the default factory for this implementation - */ - - public static JspFactory getDefaultFactory() { - return deflt; - } - - /** - *- * obtains an instance of an implementation dependent - * javax.servlet.jsp.PageContext abstract class for the calling Servlet - * and currently pending request and response. - *
- * - *- * This method is typically called early in the processing of the - * _jspService() method of a JSP implementation class in order to - * obtain a PageContext object for the request being processed. - *
- *- * Invoking this method shall result in the PageContext.initialize() - * method being invoked. The PageContext returned is properly initialized. - *
- *- * All PageContext objects obtained via this method shall be released - * by invoking releasePageContext(). - *
- * - * @param servlet the requesting servlet - * @param request the current request pending on the servlet - * @param response the current response pending on the servlet - * @param errorPageURL the URL of the error page for the requesting JSP, or null - * @param needsSession true if the JSP participates in a session - * @param buffer size of buffer in bytes, JspWriter.NO_BUFFER if no buffer, - * JspWriter.DEFAULT_BUFFER if implementation default. - * @param autoflush should the buffer autoflush to the output stream on buffer - * overflow, or throw an IOException? - * - * @return the page context - * - * @see javax.servlet.jsp.PageContext - */ - - public abstract PageContext getPageContext(Servlet servlet, - ServletRequest request, - ServletResponse response, - String errorPageURL, - boolean needsSession, - int buffer, - boolean autoflush); - - /** - *- * called to release a previously allocated PageContext object. - * Results in PageContext.release() being invoked. - * This method should be invoked prior to returning from the _jspService() method of a JSP implementation - * class. - *
- * - * @param pc A PageContext previously obtained by getPageContext() - */ - - public abstract void releasePageContext(PageContext pc); - - /** - *- * called to get implementation-specific information on the current JSP engine. - *
- * - * @return a JspEngineInfo object describing the current JSP engine - */ - - public abstract JspEngineInfo getEngineInfo(); - - /** - * Obtains theJspApplicationContext instance associated
- * with the web application for the given ServletContext.
- *
- * @param context The ServletContext for the web
- * application the desired JspApplicationContext is
- * associated with.
- * @return The JspApplicationContext associated with the
- * web application.
- * @since 2.1
- */
- public abstract JspApplicationContext getJspApplicationContext(
- ServletContext context);
-}
diff --git a/api/src/main/java/javax/servlet/jsp/JspPage.java b/api/src/main/java/javax/servlet/jsp/JspPage.java
deleted file mode 100644
index 93da4ee..0000000
--- a/api/src/main/java/javax/servlet/jsp/JspPage.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp;
-
-import javax.servlet.*;
-
-/**
- * The JspPage interface describes the generic interaction that a JSP Page
- * Implementation class must satisfy; pages that use the HTTP protocol
- * are described by the HttpJspPage interface.
- *
- * Two plus One Methods - *
- * The interface defines a protocol with 3 methods; only two of - * them: jspInit() and jspDestroy() are part of this interface as - * the signature of the third method: _jspService() depends on - * the specific protocol used and cannot be expressed in a generic - * way in Java. - *
- * A class implementing this interface is responsible for invoking - * the above methods at the appropriate time based on the - * corresponding Servlet-based method invocations. - *
- * The jspInit() and jspDestroy() methods can be defined by a JSP - * author, but the _jspService() method is defined automatically - * by the JSP processor based on the contents of the JSP page. - * - *
_jspService() - *
- * The _jspService()method corresponds to the body of the JSP page. This - * method is defined automatically by the JSP container and should never - * be defined by the JSP page author. - *
- * If a superclass is specified using the extends attribute, that - * superclass may choose to perform some actions in its service() method - * before or after calling the _jspService() method. See using the extends - * attribute in the JSP_Engine chapter of the JSP specification. - *
- * The specific signature depends on the protocol supported by the JSP page. - * - *
- * public void _jspService(ServletRequestSubtype request, - * ServletResponseSubtype response) - * throws ServletException, IOException; - *- */ - - -public interface JspPage extends Servlet { - - /** - * The jspInit() method is invoked when the JSP page is initialized. It - * is the responsibility of the JSP implementation (and of the class - * mentioned by the extends attribute, if present) that at this point - * invocations to the getServletConfig() method will return the desired - * value. - * - * A JSP page can override this method by including a definition for it - * in a declaration element. - * - * A JSP page should redefine the init() method from Servlet. - */ - public void jspInit(); - - /** - * The jspDestroy() method is invoked when the JSP page is about to be - * destroyed. - * - * A JSP page can override this method by including a definition for it - * in a declaration element. - * - * A JSP page should redefine the destroy() method from Servlet. - */ - public void jspDestroy(); - -} diff --git a/api/src/main/java/javax/servlet/jsp/JspTagException.java b/api/src/main/java/javax/servlet/jsp/JspTagException.java deleted file mode 100644 index f017445..0000000 --- a/api/src/main/java/javax/servlet/jsp/JspTagException.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp; - -/** - * Exception to be used by a Tag Handler to indicate some unrecoverable - * error. - * This error is to be caught by the top level of the JSP page and will result - * in an error page. - */ - -public class JspTagException extends JspException { - /** - * Constructs a new JspTagException with the specified message. - * The message can be written to the server log and/or displayed - * for the user. - * - * @param msg a
String specifying the text of
- * the exception message
- */
- public JspTagException(String msg) {
- super( msg );
- }
-
- /**
- * Constructs a new JspTagException with no message.
- */
- public JspTagException() {
- super();
- }
-
- /**
- * Constructs a new JspTagException when the JSP Tag
- * needs to throw an exception and include a message
- * about the "root cause" exception that interfered with its
- * normal operation, including a description message.
- *
- *
- * @param message a String containing
- * the text of the exception message
- *
- * @param rootCause the Throwable exception
- * that interfered with the JSP Tag's
- * normal operation, making this JSP Tag
- * exception necessary
- *
- * @since JSP 2.0
- */
- public JspTagException(String message, Throwable rootCause) {
- super( message, rootCause );
- }
-
-
- /**
- * Constructs a new JSP Tag exception when the JSP Tag
- * needs to throw an exception and include a message
- * about the "root cause" exception that interfered with its
- * normal operation. The exception's message is based on the localized
- * message of the underlying exception.
- *
- * This method calls the getLocalizedMessage method
- * on the Throwable exception to get a localized exception
- * message. When subclassing JspTagException,
- * this method can be overridden to create an exception message
- * designed for a specific locale.
- *
- * @param rootCause the Throwable exception
- * that interfered with the JSP Tag's
- * normal operation, making the JSP Tag
- * exception necessary
- *
- * @since JSP 2.0
- */
-
- public JspTagException(Throwable rootCause) {
- super( rootCause );
- }
-
-}
diff --git a/api/src/main/java/javax/servlet/jsp/JspWriter.java b/api/src/main/java/javax/servlet/jsp/JspWriter.java
deleted file mode 100644
index d43ab89..0000000
--- a/api/src/main/java/javax/servlet/jsp/JspWriter.java
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp;
-
-import java.io.IOException;
-
-/**
- *
- * The actions and template data in a JSP page is written using the - * JspWriter object that is referenced by the implicit variable out which - * is initialized automatically using methods in the PageContext object. - *
- * This abstract class emulates some of the functionality found in the - * java.io.BufferedWriter and java.io.PrintWriter classes, - * however it differs in that it throws java.io.IOException from the print - * methods while PrintWriter does not. - *
Buffering - *
- * The initial JspWriter object is associated with the PrintWriter object - * of the ServletResponse in a way that depends on whether the page is or - * is not buffered. If the page is not buffered, output written to this - * JspWriter object will be written through to the PrintWriter directly, - * which will be created if necessary by invoking the getWriter() method - * on the response object. But if the page is buffered, the PrintWriter - * object will not be created until the buffer is flushed and - * operations like setContentType() are legal. Since this flexibility - * simplifies programming substantially, buffering is the default for JSP - * pages. - *
- * Buffering raises the issue of what to do when the buffer is - * exceeded. Two approaches can be taken: - *
- * Both approaches are valid, and thus both are supported in the JSP - * technology. The behavior of a page is controlled by the autoFlush - * attribute, which defaults to true. In general, JSP pages that need to - * be sure that correct and complete data has been sent to their client - * may want to set autoFlush to false, with a typical case being that - * where the client is an application itself. On the other hand, JSP - * pages that send data that is meaningful even when partially - * constructed may want to set autoFlush to true; such as when the - * data is sent for immediate display through a browser. Each application - * will need to consider their specific needs. - *
- * An alternative considered was to make the buffer size unbounded; but, - * this had the disadvantage that runaway computations would consume an - * unbounded amount of resources. - *
- * The "out" implicit variable of a JSP implementation class is of this type.
- * If the page directive selects autoflush="true" then all the I/O operations
- * on this class shall automatically flush the contents of the buffer if an
- * overflow condition would result if the current operation were performed
- * without a flush. If autoflush="false" then all the I/O operations on this
- * class shall throw an IOException if performing the current operation would
- * result in a buffer overflow condition.
- *
- * @see java.io.Writer
- * @see java.io.BufferedWriter
- * @see java.io.PrintWriter
- */
-
-abstract public class JspWriter extends java.io.Writer {
-
- /**
- * Constant indicating that the Writer is not buffering output.
- */
-
- public static final int NO_BUFFER = 0;
-
- /**
- * Constant indicating that the Writer is buffered and is using the
- * implementation default buffer size.
- */
-
- public static final int DEFAULT_BUFFER = -1;
-
- /**
- * Constant indicating that the Writer is buffered and is unbounded; this
- * is used in BodyContent.
- */
-
- public static final int UNBOUNDED_BUFFER = -2;
-
- /**
- * Protected constructor.
- *
- * @param bufferSize the size of the buffer to be used by the JspWriter
- * @param autoFlush whether the JspWriter should be autoflushing
- */
-
- protected JspWriter(int bufferSize, boolean autoFlush) {
- this.bufferSize = bufferSize;
- this.autoFlush = autoFlush;
- }
-
- /**
- * Write a line separator. The line separator string is defined by the
- * system property line.separator, and is not necessarily a single
- * newline ('\n') character.
- *
- * @exception IOException If an I/O error occurs
- */
-
- abstract public void newLine() throws IOException;
-
- /**
- * Print a boolean value. The string produced by {@link
- * java.lang.String#valueOf(boolean)} is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param b The boolean to be printed
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void print(boolean b) throws IOException;
-
- /**
- * Print a character. The character is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param c The char to be printed
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void print(char c) throws IOException;
-
- /**
- * Print an integer. The string produced by {@link
- * java.lang.String#valueOf(int)} is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param i The int to be printed
- * @see java.lang.Integer#toString(int)
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void print(int i) throws IOException;
-
- /**
- * Print a long integer. The string produced by {@link
- * java.lang.String#valueOf(long)} is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param l The long to be printed
- * @see java.lang.Long#toString(long)
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void print(long l) throws IOException;
-
- /**
- * Print a floating-point number. The string produced by {@link
- * java.lang.String#valueOf(float)} is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param f The float to be printed
- * @see java.lang.Float#toString(float)
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void print(float f) throws IOException;
-
- /**
- * Print a double-precision floating-point number. The string produced by
- * {@link java.lang.String#valueOf(double)} is written to
- * the JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param d The double to be printed
- * @see java.lang.Double#toString(double)
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void print(double d) throws IOException;
-
- /**
- * Print an array of characters. The characters are written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param s The array of chars to be printed
- *
- * @throws NullPointerException If s is null
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void print(char s[]) throws IOException;
-
- /**
- * Print a string. If the argument is null then the string
- * "null" is printed. Otherwise, the string's characters are
- * written to the JspWriter's buffer or, if no buffer is used, directly
- * to the underlying writer.
- *
- * @param s The String to be printed
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void print(String s) throws IOException;
-
- /**
- * Print an object. The string produced by the {@link
- * java.lang.String#valueOf(Object)} method is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param obj The Object to be printed
- * @see java.lang.Object#toString()
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void print(Object obj) throws IOException;
-
- /**
- * Terminate the current line by writing the line separator string. The
- * line separator string is defined by the system property
- * line.separator, and is not necessarily a single newline
- * character ('\n').
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void println() throws IOException;
-
- /**
- * Print a boolean value and then terminate the line. This method behaves
- * as though it invokes {@link #print(boolean)} and then
- * {@link #println()}.
- *
- * @param x the boolean to write
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void println(boolean x) throws IOException;
-
- /**
- * Print a character and then terminate the line. This method behaves as
- * though it invokes {@link #print(char)} and then {@link
- * #println()}.
- *
- * @param x the char to write
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void println(char x) throws IOException;
-
- /**
- * Print an integer and then terminate the line. This method behaves as
- * though it invokes {@link #print(int)} and then {@link
- * #println()}.
- *
- * @param x the int to write
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void println(int x) throws IOException;
-
- /**
- * Print a long integer and then terminate the line. This method behaves
- * as though it invokes {@link #print(long)} and then
- * {@link #println()}.
- *
- * @param x the long to write
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void println(long x) throws IOException;
-
- /**
- * Print a floating-point number and then terminate the line. This method
- * behaves as though it invokes {@link #print(float)} and then
- * {@link #println()}.
- *
- * @param x the float to write
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void println(float x) throws IOException;
-
- /**
- * Print a double-precision floating-point number and then terminate the
- * line. This method behaves as though it invokes {@link
- * #print(double)} and then {@link #println()}.
- *
- * @param x the double to write
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void println(double x) throws IOException;
-
- /**
- * Print an array of characters and then terminate the line. This method
- * behaves as though it invokes print(char[]) and then
- * println().
- *
- * @param x the char[] to write
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void println(char x[]) throws IOException;
-
- /**
- * Print a String and then terminate the line. This method behaves as
- * though it invokes {@link #print(String)} and then
- * {@link #println()}.
- *
- * @param x the String to write
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void println(String x) throws IOException;
-
- /**
- * Print an Object and then terminate the line. This method behaves as
- * though it invokes {@link #print(Object)} and then
- * {@link #println()}.
- *
- * @param x the Object to write
- * @throws java.io.IOException If an error occured while writing
- */
-
- abstract public void println(Object x) throws IOException;
-
-
- /**
- * Clear the contents of the buffer. If the buffer has been already
- * been flushed then the clear operation shall throw an IOException
- * to signal the fact that some data has already been irrevocably
- * written to the client response stream.
- *
- * @throws IOException If an I/O error occurs
- */
-
- abstract public void clear() throws IOException;
-
- /**
- * Clears the current contents of the buffer. Unlike clear(), this
- * method will not throw an IOException if the buffer has already been
- * flushed. It merely clears the current content of the buffer and
- * returns.
- *
- * @throws IOException If an I/O error occurs
- */
-
- abstract public void clearBuffer() throws IOException;
-
- /**
- * Flush the stream. If the stream has saved any characters from the
- * various write() methods in a buffer, write them immediately to their
- * intended destination. Then, if that destination is another character or
- * byte stream, flush it. Thus one flush() invocation will flush all the
- * buffers in a chain of Writers and OutputStreams.
- *
- * The method may be invoked indirectly if the buffer size is exceeded. - *
- * Once a stream has been closed, - * further write() or flush() invocations will cause an IOException to be - * thrown. - * - * @exception IOException If an I/O error occurs - */ - - abstract public void flush() throws IOException; - - /** - * Close the stream, flushing it first. - *
- * This method needs not be invoked explicitly for the initial JspWriter - * as the code generated by the JSP container will automatically - * include a call to close(). - *
- * Closing a previously-closed stream, unlike flush(), has no effect. - * - * @exception IOException If an I/O error occurs - */ - - abstract public void close() throws IOException; - - /** - * This method returns the size of the buffer used by the JspWriter. - * - * @return the size of the buffer in bytes, or 0 is unbuffered. - */ - - public int getBufferSize() { return bufferSize; } - - /** - * This method returns the number of unused bytes in the buffer. - * - * @return the number of bytes unused in the buffer - */ - - abstract public int getRemaining(); - - /** - * This method indicates whether the JspWriter is autoFlushing. - * - * @return if this JspWriter is auto flushing or throwing IOExceptions - * on buffer overflow conditions - */ - - public boolean isAutoFlush() { return autoFlush; } - - /* - * fields - */ - - /** - * The size of the buffer used by the JspWriter. - */ - protected int bufferSize; - - /** - * Whether the JspWriter is autoflushing. - */ - protected boolean autoFlush; -} diff --git a/api/src/main/java/javax/servlet/jsp/PageContext.java b/api/src/main/java/javax/servlet/jsp/PageContext.java deleted file mode 100644 index e29d32d..0000000 --- a/api/src/main/java/javax/servlet/jsp/PageContext.java +++ /dev/null @@ -1,564 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp; - -import java.io.IOException; - -import javax.servlet.Servlet; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; - -import javax.servlet.http.HttpSession; - -import javax.servlet.jsp.tagext.BodyContent; - -/** - *
- * PageContext extends JspContext to provide useful context information for - * when JSP technology is used in a Servlet environment. - *
- * A PageContext instance provides access to all the namespaces associated - * with a JSP page, provides access to several page attributes, as well as - * a layer above the implementation details. Implicit objects are added - * to the pageContext automatically. - * - *
The PageContext class is an abstract class, designed to be
- * extended to provide implementation dependent implementations thereof, by
- * conformant JSP engine runtime environments. A PageContext instance is
- * obtained by a JSP implementation class by calling the
- * JspFactory.getPageContext() method, and is released by calling
- * JspFactory.releasePageContext().
- *
- *
An example of how PageContext, JspFactory, and other classes can be - * used within a JSP Page Implementation object is given elsewhere. - * - *
- * The PageContext provides a number of facilities to the page/component - * author and page implementor, including: - *
Methods Intended for Container Generated Code - *
Some methods are intended to be used by the code generated by the - * container, not by code written by JSP page authors, or JSP tag library - * authors. - *
The methods supporting lifecycle are initialize()
- * and release()
- *
- *
- * The following methods enable the management of nested JspWriter
- * streams to implement Tag Extensions: pushBody()
- *
- *
Methods Intended for JSP authors - *
- * The following methods provide convenient access to implicit objects:
- * getException(), getPage()
- * getRequest(), getResponse(),
- * getSession(), getServletConfig()
- * and getServletContext().
- *
- *
- * The following methods provide support for forwarding, inclusion
- * and error handling:
- * forward(), include(),
- * and handlePageException().
- */
-
-abstract public class PageContext
- extends JspContext
-{
-
- /**
- * Sole constructor. (For invocation by subclass constructors,
- * typically implicit.)
- */
- public PageContext() {
- }
-
- /**
- * Page scope: (this is the default) the named reference remains available
- * in this PageContext until the return from the current Servlet.service()
- * invocation.
- */
-
- public static final int PAGE_SCOPE = 1;
-
- /**
- * Request scope: the named reference remains available from the
- * ServletRequest associated with the Servlet until the current request
- * is completed.
- */
-
- public static final int REQUEST_SCOPE = 2;
-
- /**
- * Session scope (only valid if this page participates in a session):
- * the named reference remains available from the HttpSession (if any)
- * associated with the Servlet until the HttpSession is invalidated.
- */
-
- public static final int SESSION_SCOPE = 3;
-
- /**
- * Application scope: named reference remains available in the
- * ServletContext until it is reclaimed.
- */
-
- public static final int APPLICATION_SCOPE = 4;
-
- /**
- * Name used to store the Servlet in this PageContext's nametables.
- */
-
- public static final String PAGE = "javax.servlet.jsp.jspPage";
-
- /**
- * Name used to store this PageContext in it's own name table.
- */
-
- public static final String PAGECONTEXT = "javax.servlet.jsp.jspPageContext";
-
- /**
- * Name used to store ServletRequest in PageContext name table.
- */
-
- public static final String REQUEST = "javax.servlet.jsp.jspRequest";
-
- /**
- * Name used to store ServletResponse in PageContext name table.
- */
-
- public static final String RESPONSE = "javax.servlet.jsp.jspResponse";
-
- /**
- * Name used to store ServletConfig in PageContext name table.
- */
-
- public static final String CONFIG = "javax.servlet.jsp.jspConfig";
-
- /**
- * Name used to store HttpSession in PageContext name table.
- */
-
- public static final String SESSION = "javax.servlet.jsp.jspSession";
- /**
- * Name used to store current JspWriter in PageContext name table.
- */
-
- public static final String OUT = "javax.servlet.jsp.jspOut";
-
- /**
- * Name used to store ServletContext in PageContext name table.
- */
-
- public static final String APPLICATION = "javax.servlet.jsp.jspApplication";
-
- /**
- * Name used to store uncaught exception in ServletRequest attribute
- * list and PageContext name table.
- */
-
- public static final String EXCEPTION = "javax.servlet.jsp.jspException";
-
- /**
- *
- * The initialize method is called to initialize an uninitialized PageContext - * so that it may be used by a JSP Implementation class to service an - * incoming request and response within it's _jspService() method. - * - *
- * This method is typically called from JspFactory.getPageContext() in - * order to initialize state. - * - *
- * This method is required to create an initial JspWriter, and associate - * the "out" name in page scope with this newly created object. - * - *
- * This method should not be used by page or tag library authors. - * - * @param servlet The Servlet that is associated with this PageContext - * @param request The currently pending request for this Servlet - * @param response The currently pending response for this Servlet - * @param errorPageURL The value of the errorpage attribute from the page - * directive or null - * @param needsSession The value of the session attribute from the - * page directive - * @param bufferSize The value of the buffer attribute from the page - * directive - * @param autoFlush The value of the autoflush attribute from the page - * directive - * - * @throws IOException during creation of JspWriter - * @throws IllegalStateException if out not correctly initialized - * @throws IllegalArgumentException If one of the given parameters - * is invalid - */ - - abstract public void initialize(Servlet servlet, ServletRequest request, - ServletResponse response, String errorPageURL, boolean needsSession, - int bufferSize, boolean autoFlush) - throws IOException, IllegalStateException, IllegalArgumentException; - - /** - *
- * This method shall "reset" the internal state of a PageContext, releasing - * all internal references, and preparing the PageContext for potential - * reuse by a later invocation of initialize(). This method is typically - * called from JspFactory.releasePageContext(). - * - *
- * Subclasses shall envelope this method. - * - *
- * This method should not be used by page or tag library authors. - * - */ - - abstract public void release(); - - /** - * The current value of the session object (an HttpSession). - * - * @return the HttpSession for this PageContext or null - */ - - abstract public HttpSession getSession(); - - /** - * The current value of the page object (In a Servlet environment, - * this is an instance of javax.servlet.Servlet). - * - * @return the Page implementation class instance associated - * with this PageContext - */ - - abstract public Object getPage(); - - - /** - * The current value of the request object (a ServletRequest). - * - * @return The ServletRequest for this PageContext - */ - - abstract public ServletRequest getRequest(); - - /** - * The current value of the response object (a ServletResponse). - * - * @return the ServletResponse for this PageContext - */ - - abstract public ServletResponse getResponse(); - - /** - * The current value of the exception object (an Exception). - * - * @return any exception passed to this as an errorpage - */ - - abstract public Exception getException(); - - /** - * The ServletConfig instance. - * - * @return the ServletConfig for this PageContext - */ - - abstract public ServletConfig getServletConfig(); - - /** - * The ServletContext instance. - * - * @return the ServletContext for this PageContext - */ - - abstract public ServletContext getServletContext(); - - /** - *
- * This method is used to re-direct, or "forward" the current - * ServletRequest and ServletResponse to another active component in - * the application. - *
- *
- * If the relativeUrlPath begins with a "/" then the URL specified
- * is calculated relative to the DOCROOT of the ServletContext
- * for this JSP. If the path does not begin with a "/" then the URL
- * specified is calculated relative to the URL of the request that was
- * mapped to the calling JSP.
- *
- * It is only valid to call this method from a Thread
- * executing within a _jspService(...) method of a JSP.
- *
- * Once this method has been called successfully, it is illegal for the
- * calling Thread to attempt to modify the
- * ServletResponse object. Any such attempt to do so, shall result
- * in undefined behavior. Typically, callers immediately return from
- * _jspService(...) after calling this method.
- *
ServletResponse is not
- * in a state where a forward can be performed
- * @throws ServletException if the page that was forwarded to throws
- * a ServletException
- * @throws IOException if an I/O error occurred while forwarding
- */
-
- abstract public void forward(String relativeUrlPath)
- throws ServletException, IOException;
-
- /**
- * - * Causes the resource specified to be processed as part of the current - * ServletRequest and ServletResponse being processed by the calling Thread. - * The output of the target resources processing of the request is written - * directly to the ServletResponse output stream. - *
- *- * The current JspWriter "out" for this JSP is flushed as a side-effect - * of this call, prior to processing the include. - *
- *
- * If the relativeUrlPath begins with a "/" then the URL specified
- * is calculated relative to the DOCROOT of the ServletContext
- * for this JSP. If the path does not begin with a "/" then the URL
- * specified is calculated relative to the URL of the request that was
- * mapped to the calling JSP.
- *
- * It is only valid to call this method from a Thread
- * executing within a _jspService(...) method of a JSP.
- *
- * Causes the resource specified to be processed as part of the current - * ServletRequest and ServletResponse being processed by the calling Thread. - * The output of the target resources processing of the request is written - * directly to the current JspWriter returned by a call to getOut(). - *
- *- * If flush is true, The current JspWriter "out" for this JSP - * is flushed as a side-effect of this call, prior to processing - * the include. Otherwise, the JspWriter "out" is not flushed. - *
- *
- * If the relativeUrlPath begins with a "/" then the URL specified
- * is calculated relative to the DOCROOT of the ServletContext
- * for this JSP. If the path does not begin with a "/" then the URL
- * specified is calculated relative to the URL of the request that was
- * mapped to the calling JSP.
- *
- * It is only valid to call this method from a Thread
- * executing within a _jspService(...) method of a JSP.
- *
- * This method is intended to process an unhandled 'page' level - * exception by forwarding the exception to the specified - * error page for this JSP. If forwarding is not possible (for - * example because the response has already been committed), an - * implementation dependent mechanism should be used to invoke - * the error page (e.g. "including" the error page instead). - * - *
- * If no error page is defined in the page, the exception should - * be rethrown so that the standard servlet error handling - * takes over. - * - *
- * A JSP implementation class shall typically clean up any local state - * prior to invoking this and will return immediately thereafter. It is - * illegal to generate any output to the client, or to modify any - * ServletResponse state after invoking this call. - * - *
- * This method is kept for backwards compatiblity reasons. Newly - * generated code should use PageContext.handlePageException(Throwable). - * - * @param e the exception to be handled - * - * @throws ServletException if an error occurs while invoking the error page - * @throws IOException if an I/O error occurred while invoking the error - * page - * @throws NullPointerException if the exception is null - * - * @see #handlePageException(Throwable) - */ - - abstract public void handlePageException(Exception e) - throws ServletException, IOException; - - /** - *
- * This method is intended to process an unhandled 'page' level - * exception by forwarding the exception to the specified - * error page for this JSP. If forwarding is not possible (for - * example because the response has already been committed), an - * implementation dependent mechanism should be used to invoke - * the error page (e.g. "including" the error page instead). - * - *
- * If no error page is defined in the page, the exception should - * be rethrown so that the standard servlet error handling - * takes over. - * - *
- * This method is intended to process an unhandled "page" level exception - * by redirecting the exception to either the specified error page for this - * JSP, or if none was specified, to perform some implementation dependent - * action. - * - *
- * A JSP implementation class shall typically clean up any local state - * prior to invoking this and will return immediately thereafter. It is - * illegal to generate any output to the client, or to modify any - * ServletResponse state after invoking this call. - * - * @param t the throwable to be handled - * - * @throws ServletException if an error occurs while invoking the error page - * @throws IOException if an I/O error occurred while invoking the error - * page - * @throws NullPointerException if the exception is null - * - * @see #handlePageException(Exception) - */ - - abstract public void handlePageException(Throwable t) - throws ServletException, IOException; - - /** - * Return a new BodyContent object, save the current "out" JspWriter, - * and update the value of the "out" attribute in the page scope - * attribute namespace of the PageContext. - * - * @return the new BodyContent - */ - - public BodyContent pushBody() { - return null; // XXX to implement - } - - - /** - * Provides convenient access to error information. - * - * @return an ErrorData instance containing information about the - * error, as obtained from the request attributes, as per the - * Servlet specification. If this is not an error page (that is, - * if the isErrorPage attribute of the page directive is not set - * to "true"), the information is meaningless. - * - * @since JSP 2.0 - */ - public ErrorData getErrorData() { - return new ErrorData( - (Throwable)getRequest().getAttribute( "javax.servlet.error.exception" ), - ((Integer)getRequest().getAttribute( - "javax.servlet.error.status_code" )).intValue(), - (String)getRequest().getAttribute( "javax.servlet.error.request_uri" ), - (String)getRequest().getAttribute( "javax.servlet.error.servlet_name" ) ); - } - -} diff --git a/api/src/main/java/javax/servlet/jsp/SkipPageException.java b/api/src/main/java/javax/servlet/jsp/SkipPageException.java deleted file mode 100644 index ef72f02..0000000 --- a/api/src/main/java/javax/servlet/jsp/SkipPageException.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp; - -/** - * Exception to indicate the calling page must cease evaluation. - * Thrown by a simple tag handler to indicate that the remainder of - * the page must not be evaluated. The result is propagated back to - * the pagein the case where one tag invokes another (as can be - * the case with tag files). The effect is similar to that of a - * Classic Tag Handler returning Tag.SKIP_PAGE from doEndTag(). - * Jsp Fragments may also throw this exception. This exception - * should not be thrown manually in a JSP page or tag file - the behavior is - * undefined. The exception is intended to be thrown inside - * SimpleTag handlers and in JSP fragments. - * - * @see javax.servlet.jsp.tagext.SimpleTag#doTag - * @see javax.servlet.jsp.tagext.JspFragment#invoke - * @see javax.servlet.jsp.tagext.Tag#doEndTag - * @since JSP 2.0 - */ -public class SkipPageException - extends JspException -{ - /** - * Creates a SkipPageException with no message. - */ - public SkipPageException() { - super(); - } - - /** - * Creates a SkipPageException with the provided message. - * - * @param message the detail message - */ - public SkipPageException( String message ) { - super( message ); - } - - /** - * Creates a SkipPageException with the provided message and root cause. - * - * @param message the detail message - * @param rootCause the originating cause of this exception - */ - public SkipPageException( String message, Throwable rootCause ) { - super( message, rootCause ); - } - - /** - * Creates a SkipPageException with the provided root cause. - * - * @param rootCause the originating cause of this exception - */ - public SkipPageException( Throwable rootCause ) { - super( rootCause ); - } - -} - - diff --git a/api/src/main/java/javax/servlet/jsp/el/ELException.java b/api/src/main/java/javax/servlet/jsp/el/ELException.java deleted file mode 100644 index 71199e5..0000000 --- a/api/src/main/java/javax/servlet/jsp/el/ELException.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.el; - - -/** - * Represents any of the exception conditions that arise during the - * operation evaluation of the evaluator. - * - * @deprecated As of JSP 2.1, replaced by {@link javax.el.ELException} - * @since JSP 2.0 - */ -public class ELException - extends Exception -{ - //------------------------------------- - // Member variables - //------------------------------------- - - private Throwable mRootCause; - - //------------------------------------- - /** - * Creates an ELException with no detail message. - **/ - public ELException () - { - super (); - } - - //------------------------------------- - /** - * Creates an ELException with the provided detail message. - * - * @param pMessage the detail message - **/ - public ELException (String pMessage) - { - super (pMessage); - } - - //------------------------------------- - /** - * Creates an ELException with the given root cause. - * - * @param pRootCause the originating cause of this exception - **/ - public ELException (Throwable pRootCause) - { - super( pRootCause.getLocalizedMessage() ); - mRootCause = pRootCause; - } - - //------------------------------------- - /** - * Creates an ELException with the given detail message and root cause. - * - * @param pMessage the detail message - * @param pRootCause the originating cause of this exception - **/ - public ELException (String pMessage, - Throwable pRootCause) - { - super (pMessage); - mRootCause = pRootCause; - } - - //------------------------------------- - /** - * Returns the root cause. - * - * @return the root cause of this exception - */ - public Throwable getRootCause () - { - return mRootCause; - } -} diff --git a/api/src/main/java/javax/servlet/jsp/el/ELParseException.java b/api/src/main/java/javax/servlet/jsp/el/ELParseException.java deleted file mode 100644 index 78b7348..0000000 --- a/api/src/main/java/javax/servlet/jsp/el/ELParseException.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.el; - - -/** - * Represents a parsing error encountered while parsing an EL expression. - * - * @deprecated As of JSP 2.1, replaced by {@link javax.el.ELException} - * @since JSP 2.0 - */ - -public class ELParseException extends ELException { - - //------------------------------------- - /** - * Creates an ELParseException with no detail message. - */ - public ELParseException () - { - super (); - } - - //------------------------------------- - /** - * Creates an ELParseException with the provided detail message. - * - * @param pMessage the detail message - **/ - public ELParseException (String pMessage) - { - super (pMessage); - } - - //------------------------------------- -} diff --git a/api/src/main/java/javax/servlet/jsp/el/Expression.java b/api/src/main/java/javax/servlet/jsp/el/Expression.java deleted file mode 100644 index 69e77b0..0000000 --- a/api/src/main/java/javax/servlet/jsp/el/Expression.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.el; - - -/** - *
The abstract class for a prepared expression.
- * - *An instance of an Expression can be obtained via from an - * ExpressionEvaluator instance.
- * - *An Expression may or not have done a syntactic parse of the expression. - * A client invoking the evaluate() method should be ready for the case - * where ELParseException exceptions are raised.
- * - * @deprecated As of JSP 2.1, replaced by {@link javax.el.ValueExpression} - * @since JSP 2.0 - */ -public abstract class Expression { - - /** - * Evaluates an expression that was previously prepared. In some - * implementations preparing an expression involves full syntactic - * validation, but others may not do so. Evaluating the expression may - * raise an ELParseException as well as other ELExceptions due to - * run-time evaluation. - * - * @param vResolver A VariableResolver instance that can be used at - * runtime to resolve the name of implicit objects into Objects. - * @return The result of the expression evaluation. - * - * @exception ELException Thrown if the expression evaluation failed. - */ - public abstract Object evaluate( VariableResolver vResolver ) - throws ELException; -} - diff --git a/api/src/main/java/javax/servlet/jsp/el/ExpressionEvaluator.java b/api/src/main/java/javax/servlet/jsp/el/ExpressionEvaluator.java deleted file mode 100644 index 4bec784..0000000 --- a/api/src/main/java/javax/servlet/jsp/el/ExpressionEvaluator.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.el; - - -/** - *The abstract base class for an expression-language evaluator. - * Classes that implement an expression language expose their functionality - * via this abstract class.
- * - *An instance of the ExpressionEvaluator can be obtained via the - * JspContext / PageContext
- * - *The parseExpression() and evaluate() methods must be thread-safe. - * That is, multiple threads may call these methods on the same - * ExpressionEvaluator object simultaneously. Implementations should - * synchronize access if they depend on transient state. Implementations - * should not, however, assume that only one object of each - * ExpressionEvaluator type will be instantiated; global caching should - * therefore be static.
- * - *Only a single EL expression, starting with '${' and ending with
- * '}', can be parsed or evaluated at a time. EL expressions
- * cannot be mixed with static text. For example, attempting to
- * parse or evaluate "abc${1+1}def${1+1}ghi" or even
- * "${1+1}${1+1}" will cause an ELException to
- * be thrown.
The following are examples of syntactically legal EL expressions: - * - *
${person.lastName}${8 * 8}${my:reverse('hello')}parseExpression(). The
- * Expression object returned must invoke the same
- * functions regardless of whether the mappings in the
- * provided FunctionMapper instance change between
- * calling ExpressionEvaluator.parseExpression()
- * and Expression.evaluate().
- * @return The Expression object encapsulating the arguments.
- *
- * @exception ELException Thrown if parsing errors were found.
- */
- public abstract Expression parseExpression( String expression,
- Class expectedType,
- FunctionMapper fMapper )
- throws ELException;
-
-
- /**
- * Evaluates an expression. This method may perform some syntactic
- * validation and, if so, it should raise an ELParseException error if
- * it encounters syntactic errors. EL evaluation errors should cause
- * an ELException to be raised.
- *
- * @param expression The expression to be evaluated.
- * @param expectedType The expected type of the result of the evaluation
- * @param vResolver A VariableResolver instance that can be used at
- * runtime to resolve the name of implicit objects into Objects.
- * @param fMapper A FunctionMapper to resolve functions found in
- * the expression. It can be null, in which case no functions
- * are supported for this invocation.
- * @return The result of the expression evaluation.
- *
- * @exception ELException Thrown if the expression evaluation failed.
- */
- public abstract Object evaluate( String expression,
- Class expectedType,
- VariableResolver vResolver,
- FunctionMapper fMapper )
- throws ELException;
-}
-
diff --git a/api/src/main/java/javax/servlet/jsp/el/FunctionMapper.java b/api/src/main/java/javax/servlet/jsp/el/FunctionMapper.java
deleted file mode 100644
index 8abae06..0000000
--- a/api/src/main/java/javax/servlet/jsp/el/FunctionMapper.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp.el;
-
-/**
- * The interface to a map between EL function names and methods.
- * - *Classes implementing this interface may, for instance, consult tag library - * information to resolve the map.
- * - * @deprecated As of JSP 2.1, replaced by {@link javax.el.FunctionMapper} - * @since JSP 2.0 - */ -public interface FunctionMapper { - /** - * Resolves the specified local name and prefix into a Java.lang.Method. - * Returns null if the prefix and local name are not found. - * - * @param prefix the prefix of the function, or "" if no prefix. - * @param localName the short name of the function - * @return the result of the method mapping. Null means no entry found. - **/ - public java.lang.reflect.Method resolveFunction(String prefix, - String localName); -} diff --git a/api/src/main/java/javax/servlet/jsp/el/ImplicitObjectELResolver.java b/api/src/main/java/javax/servlet/jsp/el/ImplicitObjectELResolver.java deleted file mode 100644 index a4d2ac8..0000000 --- a/api/src/main/java/javax/servlet/jsp/el/ImplicitObjectELResolver.java +++ /dev/null @@ -1,1266 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.el; - -import java.beans.FeatureDescriptor; -import java.util.Iterator; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.servlet.ServletContext; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.jsp.PageContext; -import javax.servlet.jsp.JspContext; - -import javax.el.PropertyNotWritableException; -import javax.el.ELContext; -import javax.el.ELResolver; - -/** - * Defines variable resolution behavior for the EL implicit objects - * defined in the JSP specification. - * - *The following variables are resolved by this ELResolver,
- * as per the JSP specification:
- *
pageContext - the PageContext object.pageScope - a Map that maps page-scoped
- * attribute names to their values.requestScope - a Map that maps
- * request-scoped attribute names to their values.sessionScope - a Map that maps
- * session-scoped attribute names to their values.applicationScope - a Map that maps
- * application-scoped attribute names to their values.param - a Map that maps parameter
- * names to a single String parameter value (obtained by calling
- * ServletRequest.getParameter(String name)).paramValues - a Map that maps parameter
- * names to a String[] of all values for that
- * parameter (obtained by calling
- * ServletRequest.getParameterValues(String name)).header - a Map that maps header names
- * to a single String header value (obtained by calling
- * HttpServletRequest.getHeader(String name)).headerValues - a Map that maps header
- * names to a String[] of all values for that header
- * (obtained by calling
- * HttpServletRequest.getHeaders(String)).cookie - a Map that maps cookie names
- * to a single Cookie object. Cookies are retrieved
- * according to the semantics of
- * HttpServletRequest.getCookies(). If the same name
- * is shared by multiple cookies, an implementation must use the
- * first one encountered in the array of Cookie objects
- * returned by the getCookies() method. However, users
- * of the cookie implicit object must be aware that the ordering
- * of cookies is currently unspecified in the servlet
- * specification.initParam - a Map that maps context
- * initialization parameter names to their String parameter
- * value (obtained by calling
- * ServletContext.getInitParameter(String name)).null, and the property matches
- * the name of a JSP implicit object, returns the implicit object.
- *
- * The propertyResolved property of the
- * ELContext object must be set to true by
- * this resolver before returning if an implicit object is matched. If
- * this property is not true after this method is called,
- * the caller should ignore the return value.
null is handled by this resolver.
- * Other values will result in an immediate return.
- * @param property The name of the implicit object to resolve.
- * @return If the propertyResolved property of
- * ELContext was set to true, then
- * the implicit object; otherwise undefined.
- * @throws NullPointerException if context is null
- * @throws ELException if an exception was thrown while performing
- * the property or variable resolution. The thrown exception
- * must be included as the cause property of this exception, if
- * available.
- */
- public Object getValue(ELContext context,
- Object base,
- Object property) {
-
- if (context == null) {
- throw new NullPointerException();
- }
-
- if (base != null) {
- return null;
- }
-
- PageContext ctxt = (PageContext)context.getContext(JspContext.class);
-
- if ("pageContext".equals(property)) {
- context.setPropertyResolved(true);
- return ctxt;
- }
- ImplicitObjects implicitObjects =
- ImplicitObjects.getImplicitObjects(ctxt);
- if ("pageScope".equals(property)) {
- context.setPropertyResolved(true);
- return implicitObjects.getPageScopeMap();
- }
- if ("requestScope".equals(property)) {
- context.setPropertyResolved(true);
- return implicitObjects.getRequestScopeMap();
- }
- if ("sessionScope".equals(property)) {
- context.setPropertyResolved(true);
- return implicitObjects.getSessionScopeMap();
- }
- if ("applicationScope".equals (property)) {
- context.setPropertyResolved(true);
- return implicitObjects.getApplicationScopeMap ();
- }
- if ("param".equals (property)) {
- context.setPropertyResolved(true);
- return implicitObjects.getParamMap();
- }
- if ("paramValues".equals (property)) {
- context.setPropertyResolved(true);
- return implicitObjects.getParamsMap();
- }
- if ("header".equals (property)) {
- context.setPropertyResolved(true);
- return implicitObjects.getHeaderMap();
- }
- if ("headerValues".equals (property)) {
- context.setPropertyResolved(true);
- return implicitObjects.getHeadersMap();
- }
- if ("initParam".equals (property)) {
- context.setPropertyResolved(true);
- return implicitObjects.getInitParamMap ();
- }
- if ("cookie".equals (property)) {
- context.setPropertyResolved(true);
- return implicitObjects.getCookieMap ();
- }
- return null;
- }
-
- /**
- * If the base object is null, and the property matches
- * the name of a JSP implicit object, returns null to
- * indicate that no types are ever accepted to setValue().
- *
- * The propertyResolved property of the
- * ELContext object must be set to true by
- * this resolver before returning if an implicit object is matched. If
- * this property is not true after this method is called,
- * the caller should ignore the return value.
null is handled by this resolver.
- * Other values will result in an immediate return.
- * @param property The name of the implicit object to resolve.
- * @return If the propertyResolved property of
- * ELContext was set to true, then
- * null; otherwise undefined.
- * @throws NullPointerException if context is null
- * @throws ELException if an exception was thrown while performing
- * the property or variable resolution. The thrown exception
- * must be included as the cause property of this exception, if
- * available.
- */
- public Class getType(ELContext context,
- Object base,
- Object property) {
-
- if (context == null) {
- throw new NullPointerException();
- }
-
- if ((base == null) && ("pageContext".equals(property) ||
- "pageScope".equals(property)) ||
- "requestScope".equals(property) ||
- "sessionScope".equals(property) ||
- "applicationScope".equals (property) ||
- "param".equals (property) ||
- "paramValues".equals (property) ||
- "header".equals (property) ||
- "headerValues".equals (property) ||
- "initParam".equals (property) ||
- "cookie".equals (property)) {
- context.setPropertyResolved(true);
- }
- return null;
- }
-
- /**
- * If the base object is null, and the property matches
- * the name of a JSP implicit object, throws
- * PropertyNotWritableException to indicate that implicit
- * objects cannot be overwritten.
- *
- * The propertyResolved property of the
- * ELContext object must be set to true by
- * this resolver before returning if an implicit object is matched. If
- * this property is not true after this method is called,
- * the caller should ignore the return value.
null is handled by this resolver.
- * Other values will result in an immediate return.
- * @param property The name of the implicit object.
- * @param val The value to be associated with the implicit object.
- * @throws NullPointerException if context is null.
- * @throws PropertyNotWritableException always thrown, if the
- * implicit object name is recognized by this resolver.
- * @throws ELException if an exception was thrown while performing
- * the property or variable resolution. The thrown exception
- * must be included as the cause property of this exception, if
- * available.
- */
- public void setValue(ELContext context,
- Object base,
- Object property,
- Object val) {
-
- if (context == null) {
- throw new NullPointerException();
- }
-
- if ((base == null) && ("pageContext".equals(property) ||
- "pageScope".equals(property)) ||
- "requestScope".equals(property) ||
- "sessionScope".equals(property) ||
- "applicationScope".equals (property) ||
- "param".equals (property) ||
- "paramValues".equals (property) ||
- "header".equals (property) ||
- "headerValues".equals (property) ||
- "initParam".equals (property) ||
- "cookie".equals (property)) {
- throw new PropertyNotWritableException();
- }
- }
-
- /**
- * If the base object is null, and the property matches
- * the name of a JSP implicit object, returns true
- * to indicate that implicit objects cannot be overwritten.
- *
- * The propertyResolved property of the
- * ELContext object must be set to true by
- * this resolver before returning if an implicit object is matched. If
- * this property is not true after this method is called,
- * the caller should ignore the return value.
null is handled by this resolver.
- * Other values will result in an immediate return.
- * @param property The name of the implicit object.
- * @return If the propertyResolved property of
- * ELContext was set to true, then
- * true; otherwise undefined.
- * @throws NullPointerException if context is null.
- * @throws ELException if an exception was thrown while performing
- * the property or variable resolution. The thrown exception
- * must be included as the cause property of this exception, if
- * available.
- */
- public boolean isReadOnly(ELContext context,
- Object base,
- Object property) {
- if (context == null) {
- throw new NullPointerException();
- }
-
- if ((base == null) && ("pageContext".equals(property) ||
- "pageScope".equals(property)) ||
- "requestScope".equals(property) ||
- "sessionScope".equals(property) ||
- "applicationScope".equals (property) ||
- "param".equals (property) ||
- "paramValues".equals (property) ||
- "header".equals (property) ||
- "headerValues".equals (property) ||
- "initParam".equals (property) ||
- "cookie".equals (property)) {
- context.setPropertyResolved(true);
- return true;
- }
- return false; // Doesn't matter
- }
-
- /**
- * If the base object is null, and the property matches
- * the name of a JSP implicit object, returns an Iterator
- * containing FeatureDescriptor objects with information
- * about each JSP implicit object resolved by this resolver. Otherwise,
- * returns null.
- *
- * The Iterator returned must contain one instance of
- * {@link java.beans.FeatureDescriptor} for each of the EL implicit objects
- * defined by the JSP spec. Each info object contains information about
- * a single implicit object, and is initialized as follows:
- *
falsefalsetrueFeatureDescriptors:
- * true.null is handled by this resolver.
- * Other values will result in a null return value.
- * @return An Iterator containing one
- * FeatureDescriptor object for each implicit object, or
- * null if base is not null.
- */
- public Iteratornull, returns
- * String.class. Otherwise, returns null.
- *
- * @param context The context of this evaluation.
- * @param base Only null is handled by this resolver.
- * Other values will result in a null return value.
- * @return null if base is not null; otherwise
- * String.class.
- */
- public ClassThis class is used to generate the implicit Map and List objects
- * that wrap various elements of the PageContext. It also returns the
- * correct implicit object for a given implicit object name.
- *
- * @author Nathan Abramson - Art Technology Group
- **/
- private static class ImplicitObjects
- {
- //-------------------------------------
- // Constants
- //-------------------------------------
-
-
- // XXX - This probably needs to change, now that this is in a
- // standard pkg.
- static final String sAttributeName =
- "org.apache.taglibs.standard.ImplicitObjects";
-
- //-------------------------------------
- // Member variables
- //-------------------------------------
-
- PageContext mContext;
- Map This is a Map implementation driven by a data source that only
- * provides an enumeration of keys and a getValue(key) method. This
- * class must be subclassed to implement those methods.
- *
- * Some of the methods may incur a performance penalty that
- * involves enumerating the entire data source. In these cases, the
- * Map will try to save the results of that enumeration, but only if
- * the underlying data source is immutable.
- *
- * @author Nathan Abramson - Art Technology Group
- **/
- private static abstract class EnumeratedMap This resolver handles all variable resolutions (where The The This class is used to customize the way an ExpressionEvaluator resolves
- * variable references at evaluation time. For example, instances of this class can
- * implement their own variable lookup mechanisms, or introduce the
- * notion of "implicit variables" which override any other variables.
- * An instance of this class should be passed when evaluating
- * an expression. An instance of this class includes the context against which resolution
- * will happen
-The package also defines programmatic access to the old Expression Language
-evaluator (pre JSP 2.1).
-
-Please note
-that as of JSP 2.1, all classes and interfaces that were in package
-
-While a JSP container must still support the deprecated APIs defined
-in
-Two ELResolver classes have been added in JSP 2.1 to implement
-object resolution rules that must be supported by a JSP container
-with the new unified Expression Language:
-{@link javax.servlet.jsp.el.ImplicitObjectELResolver} and
-{@link javax.servlet.jsp.el.ScopedAttributeELResolver}.
-
-The JavaServer Pages(tm) (JSP) 2.0 specification provides a portable
-API for evaluating "EL Expressions". As of JSP 2.0, EL expressions can
-be placed directly in the template text of JSP pages and tag files.
-
-This package contains a number of classes and interfaces that describe
-and define programmatic access to the Expression Language evaluator.
-This API can also be used by an implementation of JSP to evaluate the
-expressions, but other implementations, like open-coding into Java
-bytecodes, are allowed. This package is intended to have no dependencies
-on other portions of the JSP 2.0 specification.
-
- An The parsing of an expression string is done against a target type,
-a default prefix (that applies when a function has no prefix), and
-a The interpretation or evaluation of a parsed expression is done
-using a
-The Parsing errors are conveyed as exceptions to simplify the API. It
-is expected that many JSP containers will use additional mechanisms to
-parse EL expressions and report their errors - a run-time API cannot
-provide accurate line-error numbers without additional machinery.
-Below is a non-normative code fragment outlining how the APIs can be used.
-The javax.servlet.jsp package contains a number of classes and
-interfaces that describe and define the contracts between a JSP page
-implementation class and the runtime environment provided for an
-instance of such a class by a conforming JSP container.
-
-This section describes the basic contract between a JSP Page
-implementation object and its container.
-
-The main contract is defined by the classes
-{@link javax.servlet.jsp.JspPage}
-and {@link javax.servlet.jsp.HttpJspPage}.
-The {@link javax.servlet.jsp.JspFactory} class describes the mechanism to
-portably instantiate all needed runtime objects,
-and {@link javax.servlet.jsp.JspEngineInfo} provides basic information on
-the current JSP container. Class {@link javax.servlet.jsp.JspApplicationContext}
-stores application-scoped information relevant to JSP containers.
-It was added in JSP 2.1 to support the integration of the unified
-Expression Language.
-
-None of these classes are intended to be used
-by JSP page authors; an example of how these classes may be
-used is included below.
-
-The {@link javax.servlet.jsp.JspException} class is the base class for all JSP
-exceptions. The {@link javax.servlet.jsp.JspTagException} and
-{@link javax.servlet.jsp.SkipPageException} exceptions are used by the
-tag extension mechanism.base
- * is null. It searches PageContext.findAttribute()
- * for a matching attribute. If not found, it will return null,
- * or in the case of setValue it will create a new attribute
- * in the page scope with the given name.null, searches the page,
- * request, session and application scopes for an attribute with
- * the given name and returns it, or null if no
- * attribute exists with the current name.
- *
- * propertyResolved property of the
- * ELContext object must be set to true by
- * this resolver before returning if base is null. If
- * this property is not true after this method is called,
- * the caller should ignore the return value.null is handled by this resolver.
- * Other values will result in an immediate return.
- * @param property The name of the scoped attribute to resolve.
- * @return If the propertyResolved property of
- * ELContext was set to true, then
- * the scoped attribute; otherwise undefined.
- * @throws NullPointerException if context is null
- * @throws ELException if an exception was thrown while performing
- * the property or variable resolution. The thrown exception
- * must be included as the cause property of this exception, if
- * available.
- */
- public Object getValue(ELContext context,
- Object base,
- Object property) {
-
- if (context == null) {
- throw new NullPointerException();
- }
-
- if (base == null) {
- context.setPropertyResolved(true);
- if (property instanceof String) {
- String attribute = (String) property;
- PageContext ctxt = (PageContext)
- context.getContext(JspContext.class);
- Object value = ctxt.findAttribute(attribute);
- // To support reference of static fields for imported class in
- // EL 3.0, if a scoped attribute returns null, this attribute
- // is further checked to see if it is the name of an imported
- // class. If so, an ELClass instance is returned.
- // Note: the JSP spec needs to be updated for this behavior. Note
- // also that this behavior is not backward compatible with JSP 2.2
- // and a runtime switch may be needed to force backward
- // compatility.
- if (value == null) {
- // check to see if the property is an imported class
- if (context.getImportHandler() != null) {
- Class> c = context.getImportHandler().resolveClass(attribute);
- if (c != null) {
- value = new ELClass(c);
- // A possible optimization is to set the ELClass
- // instance in an attribute map.
- }
- }
- }
- return value;
- }
- }
- return null;
- }
-
- /**
- * If the base object is null, returns
- * Object.class to indicate that any type is valid to
- * set for a scoped attribute.
- *
- * propertyResolved property of the
- * ELContext object must be set to true by
- * this resolver before returning if base is null. If
- * this property is not true after this method is called,
- * the caller should ignore the return value.null is handled by this resolver.
- * Other values will result in an immediate return.
- * @param property The name of the scoped attribute to resolve.
- * @return If the propertyResolved property of
- * ELContext was set to true, then
- * Object.class; otherwise undefined.
- * @throws NullPointerException if context is null
- * @throws ELException if an exception was thrown while performing
- * the property or variable resolution. The thrown exception
- * must be included as the cause property of this exception, if
- * available.
- */
- public Classnull is handled by this resolver.
- * Other values will result in a null return value.
- * @return An Iterator containing one
- * FeatureDescriptor object for each scoped attribute, or
- * null if base is not null.
- */
- public Iteratornull, returns
- * String.class. Otherwise, returns null.
- *
- * @param context The context of this evaluation.
- * @param base Only null is handled by this resolver.
- * Other values will result in a null return value.
- * @return null if base is not null; otherwise
- * String.class.
- */
- public ClassELResolver classes that define the
-object resolution rules that must be supported by a JSP container
-with the new unified Expression Language.
-javax.servlet.jsp.el have been deprecated in favor of the new unified
-Expression Language APIs (javax.el). See the Expression Language
-specification document for more details.
-javax.servlet.jsp.el, developers should only rely on the
-new javax.el APIs
-for new development work.
-Documentation on the old and deprecated API
-
-Expression Evaluator
-
-Programmatic access to the EL Expression Evaluator is provided
-through the following types:
-
-
-
-
-ExpressionEvaluatorExpressionFunctionMapperVariableResolverExpressionEvaluator object can be obtained from a
-JspContext object through the getExpressionEvaluator
-method. An ExpressionEvaluator encapsulates the EL processor. An EL
-expression provided as a String can then be evaluated directly, or it
-can be parsed first into an Expression object. The parse
-step, can be used to factor out the cost of parsing the expression, or
-even the cost of optimizing the implementation.FunctionMapper. The FunctionMapper object
-maps a prefix and a local name part into a
-java.lang.reflect.Method object.VariableResolver object. This object resolves
-top level object names into Objects. A VariableResolver
-can be obtained from a JspContext object through the
-getVariableResolver method.Exceptions
-
-ELException exception is used by the expression
-language to denote any exception that may arise during the parsing or
-evaluation of an expression.
-The ELParseException exception is a subclass of
-ELException that corresponds to parsing errorsCode Fragment
-
-
-// Get an instance of an ExpressionEvaluator
-
-
-ExpressionEvaluator ee = myJspContext.getExpressionEvaluator();
-VariableResolver vr = myJspContext.getVariableResolver();
-
-FunctionMapper fm; // we don't have a portable implementation yet
-
-// Example of compiling an expression. See [ISSUE-2]
-// Errors detected this way may have higher quality than those
-// found with a simple validate() invocation.
-
-ExpressionCompilation ce;
-
-try {
- ce = ee.prepareExpression(expr,
- targetClass,
- fm,
- null // no prefixes
- );
-} catch (ELParseException e) {
- log (e.getMessage());
-}
-
-try {
- ce.evaluate(vr);
-} catch (ElException e) {
- log (e);
-}
-
-
-
-
-
-
diff --git a/api/src/main/java/javax/servlet/jsp/package.html b/api/src/main/java/javax/servlet/jsp/package.html
deleted file mode 100644
index 5e759e5..0000000
--- a/api/src/main/java/javax/servlet/jsp/package.html
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
-
-
-
-Classes and interfaces for the Core JSP 2.3 API.
-JSP Page Implementation Object Contract
-Implicit Objects
-
-The {@link javax.servlet.jsp.PageContext} object and the
-{@link javax.servlet.jsp.JspWriter}
-are available by default as implicit objects.
-
-Exceptions
-
-
An instance of an implementation dependent subclass of the
-{@link javax.servlet.jsp.PageContext}
-abstract base class can be created by a JSP implementation class at
-the beginning of it's _jspService() method via an
-implementation default {@link javax.servlet.jsp.JspFactory}.
-
-
Here is one example of how to use these classes - -
-
-
-
-
-
diff --git a/api/src/main/java/javax/servlet/jsp/tagext/BodyContent.java b/api/src/main/java/javax/servlet/jsp/tagext/BodyContent.java
deleted file mode 100644
index a4c6550..0000000
--- a/api/src/main/java/javax/servlet/jsp/tagext/BodyContent.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp.tagext;
-
-import java.io.Reader;
-import java.io.Writer;
-import java.io.IOException;
-import javax.servlet.jsp.*;
-
-/**
- * An encapsulation of the evaluation of the body of an action so it is
- * available to a tag handler. BodyContent is a subclass of JspWriter.
- *
- *
- public class foo implements Servlet {
-
- // ...
-
-public void _jspService(HttpServletRequest request,
- HttpServletResponse response)
- throws IOException, ServletException {
-
- JspFactory factory = JspFactory.getDefaultFactory();
- PageContext pageContext = factory.getPageContext(
- this,
- request,
- response,
- null, // errorPageURL
- false, // needsSession
- JspWriter.DEFAULT_BUFFER,
- true // autoFlush
- );
-
- // initialize implicit variables for scripting env ...
-
- HttpSession session = pageContext.getSession();
- JspWriter out = pageContext.getOut();
- Object page = this;
-
- try {
- // body of translated JSP here ...
- } catch (Exception e) {
- out.clear();
- pageContext.handlePageException(e);
- } finally {
- out.close();
- factory.releasePageContext(pageContext);
- }
-}
-
-
- * Note that the content of BodyContent is the result of evaluation, so - * it will not contain actions and the like, but the result of their - * invocation. - * - *
- * BodyContent has methods to convert its contents into - * a String, to read its contents, and to clear the contents. - * - *
- * The buffer size of a BodyContent object is unbounded. A - * BodyContent object cannot be in autoFlush mode. It is not possible to - * invoke flush on a BodyContent object, as there is no backing stream. - * - *
- * Instances of BodyContent are created by invoking the pushBody and - * popBody methods of the PageContext class. A BodyContent is enclosed - * within another JspWriter (maybe another BodyContent object) following - * the structure of their associated actions. - * - *
- * A BodyContent is made available to a BodyTag through a setBodyContent() - * call. The tag handler can use the object until after the call to - * doEndTag(). - */ - -public abstract class BodyContent extends JspWriter { - - /** - * Protected constructor. - * - * Unbounded buffer, no autoflushing. - * - * @param e the enclosing JspWriter - */ - - protected BodyContent(JspWriter e) { - super(UNBOUNDED_BUFFER , false); - this.enclosingWriter = e; - } - - /** - * Redefined flush() so it is not legal. - * - *
- * It is not valid to flush a BodyContent because there is no backing - * stream behind it. - * - * @throws IOException always thrown - */ - - public void flush() throws IOException { - throw new IOException("Illegal to flush within a custom tag"); - } - - /** - * Clear the body without throwing any exceptions. - */ - - public void clearBody() { - try { - this.clear(); - } catch (IOException ex) { - // TODO -- clean this one up. - throw new Error("internal error!;"); - } - } - - /** - * Return the value of this BodyContent as a Reader. - * - * @return the value of this BodyContent as a Reader - */ - public abstract Reader getReader(); - - - /** - * Return the value of the BodyContent as a String. - * - * @return the value of the BodyContent as a String - */ - public abstract String getString(); - - - /** - * Write the contents of this BodyContent into a Writer. - * Subclasses may optimize common invocation patterns. - * - * @param out The writer into which to place the contents of - * this body evaluation - * @throws IOException if an I/O error occurred while writing the - * contents of this BodyContent to the given Writer - */ - - public abstract void writeOut(Writer out) throws IOException; - - - /** - * Get the enclosing JspWriter. - * - * @return the enclosing JspWriter passed at construction time - */ - - public JspWriter getEnclosingWriter() { - return enclosingWriter; - } - - - // private fields - - private JspWriter enclosingWriter; - } diff --git a/api/src/main/java/javax/servlet/jsp/tagext/BodyTag.java b/api/src/main/java/javax/servlet/jsp/tagext/BodyTag.java deleted file mode 100644 index 4f12539..0000000 --- a/api/src/main/java/javax/servlet/jsp/tagext/BodyTag.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.tagext; - -import javax.servlet.jsp.*; - -/** - * The BodyTag interface extends IterationTag by defining additional - * methods that let a tag handler manipulate the content of evaluating its body. - * - *
- * It is the responsibility of the tag handler to manipulate the body - * content. For example the tag handler may take the body content, - * convert it into a String using the bodyContent.getString - * method and then use it. Or the tag handler may take the body - * content and write it out into its enclosing JspWriter using - * the bodyContent.writeOut method. - * - *
A tag handler that implements BodyTag is treated as one that - * implements IterationTag, except that the doStartTag method can - * return SKIP_BODY, EVAL_BODY_INCLUDE or EVAL_BODY_BUFFERED. - * - *
- * If EVAL_BODY_INCLUDE is returned, then evaluation happens - * as in IterationTag. - * - *
- * If EVAL_BODY_BUFFERED is returned, then a BodyContent object will be - * created (by code generated by the JSP compiler) to capture the body - * evaluation. - * The code generated by the JSP compiler obtains the BodyContent object by - * calling the pushBody method of the current pageContext, which - * additionally has the effect of saving the previous out value. - * The page compiler returns this object by calling the popBody - * method of the PageContext class; - * the call also restores the value of out. - * - *
- * The interface provides one new property with a setter method and one - * new action method. - * - *
Properties - *
There is a new property: bodyContent, to contain the BodyContent - * object, where the JSP Page implementation object will place the - * evaluation (and reevaluation, if appropriate) of the body. The setter - * method (setBodyContent) will only be invoked if doStartTag() returns - * EVAL_BODY_BUFFERED and the corresponding action element does not have - * an empty body. - * - *
Methods - *
In addition to the setter method for the bodyContent property, there - * is a new action method: doInitBody(), which is invoked right after - * setBodyContent() and before the body evaluation. This method is only - * invoked if doStartTag() returns EVAL_BODY_BUFFERED. - * - *
Lifecycle - *
Lifecycle details are described by the transition diagram below. - * Exceptions that are thrown during the computation of doStartTag(), - * setBodyContent(), doInitBody(), BODY, doAfterBody() interrupt the - * execution sequence and are propagated up the stack, unless the - * tag handler implements the TryCatchFinally interface; see that - * interface for details. - *
- *
- *
- *
Empty and Non-Empty Action - *
If the TagLibraryDescriptor file indicates that the action must - * always have an empty element body, by an <body-content> entry - * of "empty", then the doStartTag() method must return SKIP_BODY. - * Otherwise, the doStartTag() method may return SKIP_BODY, - * EVAL_BODY_INCLUDE, or EVAL_BODY_BUFFERED. - * - *
Note that which methods are invoked after the doStartTag() depends on - * both the return value and on if the custom action element is empty - * or not in the JSP page, not how it's declared in the TLD. - * - *
- * If SKIP_BODY is returned the body is not evaluated, and doEndTag() is - * invoked. - * - *
- * If EVAL_BODY_INCLUDE is returned, and the custom action element is not - * empty, setBodyContent() is not invoked, - * doInitBody() is not invoked, the body is evaluated and - * "passed through" to the current out, doAfterBody() is invoked - * and then, after zero or more iterations, doEndTag() is invoked. - * If the custom action element is empty, only doStart() and - * doEndTag() are invoked. - * - *
- * If EVAL_BODY_BUFFERED is returned, and the custom action element is not - * empty, setBodyContent() is invoked, - * doInitBody() is invoked, the body is evaluated, doAfterBody() is - * invoked, and then, after zero or more iterations, doEndTag() is invoked. - * If the custom action element is empty, only doStart() and doEndTag() - * are invoked. - */ - -public interface BodyTag extends IterationTag { - - /** - * Deprecated constant that has the same value as EVAL_BODY_BUFFERED - * and EVAL_BODY_AGAIN. This name has been marked as deprecated - * to encourage the use of the two different terms, which are much - * more descriptive. - * - * @deprecated As of Java JSP API 1.2, use BodyTag.EVAL_BODY_BUFFERED - * or IterationTag.EVAL_BODY_AGAIN. - */ - - public final static int EVAL_BODY_TAG = 2; - - /** - * Request the creation of new buffer, a BodyContent on which to - * evaluate the body of this tag. - * - * Returned from doStartTag when it implements BodyTag. - * This is an illegal return value for doStartTag when the class - * does not implement BodyTag. - */ - - public final static int EVAL_BODY_BUFFERED = 2; - - - /** - * Set the bodyContent property. - * This method is invoked by the JSP page implementation object at - * most once per action invocation. - * This method will be invoked before doInitBody. - * This method will not be invoked for empty tags or for non-empty - * tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE. - * - *
- * When setBodyContent is invoked, the value of the implicit object out - * has already been changed in the pageContext object. The BodyContent - * object passed will have not data on it but may have been reused - * (and cleared) from some previous invocation. - * - *
- * The BodyContent object is available and with the appropriate content - * until after the invocation of the doEndTag method, at which case it - * may be reused. - * - * @param b the BodyContent - * @see #doInitBody - * @see #doAfterBody - */ - - void setBodyContent(BodyContent b); - - - /** - * Prepare for evaluation of the body. - * This method is invoked by the JSP page implementation object - * after setBodyContent and before the first time - * the body is to be evaluated. - * This method will not be invoked for empty tags or for non-empty - * tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE. - * - *
- * The JSP container will resynchronize the values of any AT_BEGIN and - * NESTED variables (defined by the associated TagExtraInfo or TLD) after - * the invocation of doInitBody(). - * - * @throws JspException if an error occurred while processing this tag - * @see #doAfterBody - */ - - void doInitBody() throws JspException; - -} diff --git a/api/src/main/java/javax/servlet/jsp/tagext/BodyTagSupport.java b/api/src/main/java/javax/servlet/jsp/tagext/BodyTagSupport.java deleted file mode 100644 index 5720ac5..0000000 --- a/api/src/main/java/javax/servlet/jsp/tagext/BodyTagSupport.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.tagext; - -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.JspWriter; - -/** - * A base class for defining tag handlers implementing BodyTag. - * - *
- * The BodyTagSupport class implements the BodyTag interface and adds - * additional convenience methods including getter methods for the - * bodyContent property and methods to get at the previous out JspWriter. - * - *
- * Many tag handlers will extend BodyTagSupport and only redefine a
- * few methods.
- */
-
-public class BodyTagSupport extends TagSupport implements BodyTag {
-
- /**
- * Default constructor, all subclasses are required to only define
- * a public constructor with the same signature, and to call the
- * superclass constructor.
- *
- * This constructor is called by the code generated by the JSP
- * translator.
- */
-
- public BodyTagSupport() {
- super();
- }
-
- /**
- * Default processing of the start tag returning EVAL_BODY_BUFFERED.
- *
- * @return EVAL_BODY_BUFFERED
- * @throws JspException if an error occurred while processing this tag
- * @see BodyTag#doStartTag
- */
-
- public int doStartTag() throws JspException {
- return EVAL_BODY_BUFFERED;
- }
-
-
- /**
- * Default processing of the end tag returning EVAL_PAGE.
- *
- * @return EVAL_PAGE
- * @throws JspException if an error occurred while processing this tag
- * @see Tag#doEndTag
- */
-
- public int doEndTag() throws JspException {
- return super.doEndTag();
- }
-
-
- // Actions related to body evaluation
-
- /**
- * Prepare for evaluation of the body: stash the bodyContent away.
- *
- * @param b the BodyContent
- * @see #doAfterBody
- * @see #doInitBody()
- * @see BodyTag#setBodyContent
- */
-
- public void setBodyContent(BodyContent b) {
- this.bodyContent = b;
- }
-
-
- /**
- * Prepare for evaluation of the body just before the first body evaluation:
- * no action.
- *
- * @throws JspException if an error occurred while processing this tag
- * @see #setBodyContent
- * @see #doAfterBody
- * @see BodyTag#doInitBody
- */
-
- public void doInitBody() throws JspException {
- }
-
-
- /**
- * After the body evaluation: do not reevaluate and continue with the page.
- * By default nothing is done with the bodyContent data (if any).
- *
- * @return SKIP_BODY
- * @throws JspException if an error occurred while processing this tag
- * @see #doInitBody
- * @see BodyTag#doAfterBody
- */
-
- public int doAfterBody() throws JspException {
- return SKIP_BODY;
- }
-
-
- /**
- * Release state.
- *
- * @see Tag#release
- */
-
- public void release() {
- bodyContent = null;
-
- super.release();
- }
-
- /**
- * Get current bodyContent.
- *
- * @return the body content.
- */
-
- public BodyContent getBodyContent() {
- return bodyContent;
- }
-
-
- /**
- * Get surrounding out JspWriter.
- *
- * @return the enclosing JspWriter, from the bodyContent.
- */
-
- public JspWriter getPreviousOut() {
- return bodyContent.getEnclosingWriter();
- }
-
- // protected fields
-
- /**
- * The current BodyContent for this BodyTag.
- */
- protected BodyContent bodyContent;
-}
diff --git a/api/src/main/java/javax/servlet/jsp/tagext/DynamicAttributes.java b/api/src/main/java/javax/servlet/jsp/tagext/DynamicAttributes.java
deleted file mode 100644
index 5867699..0000000
--- a/api/src/main/java/javax/servlet/jsp/tagext/DynamicAttributes.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp.tagext;
-
-import javax.servlet.jsp.JspException;
-
-/**
- * For a tag to declare that it accepts dynamic attributes, it must implement
- * this interface. The entry for the tag in the Tag Library Descriptor must
- * also be configured to indicate dynamic attributes are accepted.
- *
- * For any attribute that is not declared in the Tag Library Descriptor for
- * this tag, instead of getting an error at translation time, the
- * setDynamicAttribute() method is called, with the name and
- * value of the attribute. It is the responsibility of the tag to
- * remember the names and values of the dynamic attributes.
- *
- * @since JSP 2.0
- */
-public interface DynamicAttributes {
-
- /**
- * Called when a tag declared to accept dynamic attributes is passed
- * an attribute that is not declared in the Tag Library Descriptor.
- *
- * @param uri the namespace of the attribute, or null if in the default
- * namespace.
- * @param localName the name of the attribute being set.
- * @param value the value of the attribute
- * @throws JspException if the tag handler wishes to
- * signal that it does not accept the given attribute. The
- * container must not call doStartTag() or doTag() for this tag.
- */
- public void setDynamicAttribute(
- String uri, String localName, Object value )
- throws JspException;
-
-}
diff --git a/api/src/main/java/javax/servlet/jsp/tagext/FunctionInfo.java b/api/src/main/java/javax/servlet/jsp/tagext/FunctionInfo.java
deleted file mode 100644
index 6578465..0000000
--- a/api/src/main/java/javax/servlet/jsp/tagext/FunctionInfo.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp.tagext;
-
-/**
- * Information for a function in a Tag Library.
- * This class is instantiated from the Tag Library Descriptor file (TLD)
- * and is available only at translation time.
- *
- * @since JSP 2.0
- */
-public class FunctionInfo {
-
- /**
- * Constructor for FunctionInfo.
- *
- * @param name The name of the function
- * @param klass The class of the function
- * @param signature The signature of the function
- */
-
- public FunctionInfo(String name, String klass, String signature) {
-
- this.name = name;
- this.functionClass = klass;
- this.functionSignature = signature;
- }
-
- /**
- * The name of the function.
- *
- * @return The name of the function
- */
-
- public String getName() {
- return name;
- }
-
- /**
- * The class of the function.
- *
- * @return The class of the function
- */
-
- public String getFunctionClass() {
- return functionClass;
- }
-
- /**
- * The signature of the function.
- *
- * @return The signature of the function
- */
-
- public String getFunctionSignature() {
- return functionSignature;
- }
-
- /*
- * fields
- */
-
- private String name;
- private String functionClass;
- private String functionSignature;
-}
diff --git a/api/src/main/java/javax/servlet/jsp/tagext/IterationTag.java b/api/src/main/java/javax/servlet/jsp/tagext/IterationTag.java
deleted file mode 100644
index 1bb767f..0000000
--- a/api/src/main/java/javax/servlet/jsp/tagext/IterationTag.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp.tagext;
-
-import javax.servlet.jsp.*;
-
-/**
- * The IterationTag interface extends Tag by defining one additional
- * method that controls the reevaluation of its body.
- *
- *
A tag handler that implements IterationTag is treated as one that
- * implements Tag regarding the doStartTag() and doEndTag() methods.
- * IterationTag provides a new method: doAfterBody().
- *
- *
The doAfterBody() method is invoked after every body evaluation - * to control whether the body will be reevaluated or not. If doAfterBody() - * returns IterationTag.EVAL_BODY_AGAIN, then the body will be reevaluated. - * If doAfterBody() returns Tag.SKIP_BODY, then the body will be skipped - * and doEndTag() will be evaluated instead. - * - *
Properties - * There are no new properties in addition to those in Tag. - * - *
Methods - * There is one new methods: doAfterBody(). - * - *
Lifecycle - * - *
Lifecycle details are described by the transition diagram - * below. Exceptions that are thrown during the computation of - * doStartTag(), BODY and doAfterBody() interrupt the execution - * sequence and are propagated up the stack, unless the tag handler - * implements the TryCatchFinally interface; see that interface for - * details. - * - *
- *
- *
- *
Empty and Non-Empty Action - *
If the TagLibraryDescriptor file indicates that the action must - * always have an empty element body, by a <body-content> entry of - * "empty", then the doStartTag() method must return SKIP_BODY. - * - *
Note that which methods are invoked after the doStartTag() depends on - * both the return value and on if the custom action element is empty - * or not in the JSP page, not on how it's declared in the TLD. - * - *
- * If SKIP_BODY is returned the body is not evaluated, and then doEndTag() - * is invoked. - * - *
- * If EVAL_BODY_INCLUDE is returned, and the custom action element is not - * empty, the body is evaluated and "passed through" to the current out, - * then doAfterBody() is invoked and, after zero or more iterations, - * doEndTag() is invoked. - */ - -public interface IterationTag extends Tag { - - /** - * Request the reevaluation of some body. - * Returned from doAfterBody. - * - * For compatibility with JSP 1.1, the value is carefully selected - * to be the same as the, now deprecated, BodyTag.EVAL_BODY_TAG, - * - */ - - public final static int EVAL_BODY_AGAIN = 2; - - /** - * Process body (re)evaluation. This method is invoked by the - * JSP Page implementation object after every evaluation of - * the body into the BodyEvaluation object. The method is - * not invoked if there is no body evaluation. - * - *
- * If doAfterBody returns EVAL_BODY_AGAIN, a new evaluation of the - * body will happen (followed by another invocation of doAfterBody). - * If doAfterBody returns SKIP_BODY, no more body evaluations will occur, - * and the doEndTag method will be invoked. - * - *
- * If this tag handler implements BodyTag and doAfterBody returns - * SKIP_BODY, the value of out will be restored using the popBody - * method in pageContext prior to invoking doEndTag. - * - *
- * The method re-invocations may be lead to different actions because - * there might have been some changes to shared state, or because - * of external computation. - * - *
- * The JSP container will resynchronize the values of any AT_BEGIN and - * NESTED variables (defined by the associated TagExtraInfo or TLD) after - * the invocation of doAfterBody(). - * - * @return whether additional evaluations of the body are desired - * @throws JspException if an error occurred while processing this tag - */ - - int doAfterBody() throws JspException; -} diff --git a/api/src/main/java/javax/servlet/jsp/tagext/JspFragment.java b/api/src/main/java/javax/servlet/jsp/tagext/JspFragment.java deleted file mode 100644 index 3675c31..0000000 --- a/api/src/main/java/javax/servlet/jsp/tagext/JspFragment.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.tagext; - -import java.io.IOException; -import java.io.Writer; -import javax.servlet.jsp.*; - -/** - * Encapsulates a portion of JSP code in an object that - * can be invoked as many times as needed. JSP Fragments are defined - * using JSP syntax as the body of a tag for an invocation to a SimpleTag - * handler, or as the body of a <jsp:attribute> standard action - * specifying the value of an attribute that is declared as a fragment, - * or to be of type JspFragment in the TLD. - *
- * The definition of the JSP fragment must only contain template - * text and JSP action elements. In other words, it must not contain - * scriptlets or scriptlet expressions. At translation time, the - * container generates an implementation of the JspFragment abstract class - * capable of executing the defined fragment. - *
- * A tag handler can invoke the fragment zero or more times, or - * pass it along to other tags, before returning. To communicate values - * to/from a JSP fragment, tag handlers store/retrieve values in - * the JspContext associated with the fragment. - *
- * Note that tag library developers and page authors should not generate - * JspFragment implementations manually. - *
- * Implementation Note: It is not necessary to generate a - * separate class for each fragment. One possible implementation is - * to generate a single helper class for each page that implements - * JspFragment. Upon construction, a discriminator can be passed to - * select which fragment that instance will execute. - * - * @since JSP 2.0 - */ -public abstract class JspFragment { - - /** - * Executes the fragment and directs all output to the given Writer, - * or the JspWriter returned by the getOut() method of the JspContext - * associated with the fragment if out is null. - * - * @param out The Writer to output the fragment to, or null if - * output should be sent to JspContext.getOut(). - * @throws javax.servlet.jsp.JspException Thrown if an error occured - * while invoking this fragment. - * @throws javax.servlet.jsp.SkipPageException Thrown if the page - * that (either directly or indirectly) invoked the tag handler that - * invoked this fragment is to cease evaluation. The container - * must throw this exception if a Classic Tag Handler returned - * Tag.SKIP_PAGE or if a Simple Tag Handler threw SkipPageException. - * @throws java.io.IOException If there was an error writing to the - * stream. - */ - public abstract void invoke( Writer out ) - throws JspException, IOException; - - /** - * Returns the JspContext that is bound to this JspFragment. - * - * @return The JspContext used by this fragment at invocation time. - */ - public abstract JspContext getJspContext(); - -} diff --git a/api/src/main/java/javax/servlet/jsp/tagext/JspIdConsumer.java b/api/src/main/java/javax/servlet/jsp/tagext/JspIdConsumer.java deleted file mode 100644 index 066afd6..0000000 --- a/api/src/main/java/javax/servlet/jsp/tagext/JspIdConsumer.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.tagext; - -/** - *
This interface indicates to the container that a tag handler - * wishes to be provided with a - * compiler generated ID.
- *The container sets the jspId
- * attribute
- * of the tag handler with an identification string, as part of tag
- * property initialization. Each tag in a JSP page has a unique
- * jspId, and a given tag in a JSP page always has the same
- * jspId,
- * even for multiple requests to the page.
- *
- * Tag handler instances that implement JspIdConsumer
- * cannot be reused.
- *
- * Even though the jspId attribute is similar in concept to
- * the jsp:id
- * attribute of an XML view (see Section JSP.10.1.13 of the spec), they are
- * not related.
- * The jsp:id attribute is available only at translation time,
- * and the jspId
- * attribute is avalable only at request time.
- *
- * The JSP container must provide a value for jspId that
- * conforms to the following rules:
- *
Character.isLetter()
- * method) or underscore ('_').
- * Character.isLetter()
- * method), digits (as defined by the Character.isDigit() method), dashes ('-'),
- * or underscores ('_')
- *
- * Note that the rules exclude colons ':' in a jspId,
- * and that they are
- * the same rules used for a component ID in JavaServer Faces.
- *
- * Objects of this type are generated by the JSP translator, e.g. - * when being pased to a TagLibraryValidator instance. - */ - -abstract public class PageData { - - /** - * Sole constructor. (For invocation by subclass constructors, - * typically implicit.) - */ - public PageData() { - } - - /** - * Returns an input stream on the XML view of a JSP page. - * The stream is encoded in UTF-8. Recall tht the XML view of a - * JSP page has the include directives expanded. - * - * @return An input stream on the document. - */ - abstract public InputStream getInputStream(); -} diff --git a/api/src/main/java/javax/servlet/jsp/tagext/SimpleTag.java b/api/src/main/java/javax/servlet/jsp/tagext/SimpleTag.java deleted file mode 100644 index 9b956b9..0000000 --- a/api/src/main/java/javax/servlet/jsp/tagext/SimpleTag.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.tagext; - -import javax.servlet.jsp.JspContext; - -/** - * Interface for defining Simple Tag Handlers. - * - *
Simple Tag Handlers differ from Classic Tag Handlers in that instead
- * of supporting doStartTag() and doEndTag(),
- * the SimpleTag interface provides a simple
- * doTag() method, which is called once and only once for any
- * given tag invocation. All tag logic, iteration, body evaluations, etc.
- * are to be performed in this single method. Thus, simple tag handlers
- * have the equivalent power of BodyTag, but with a much
- * simpler lifecycle and interface.
To support body content, the setJspBody()
- * method is provided. The container invokes the setJspBody()
- * method with a JspFragment object encapsulating the body of
- * the tag. The tag handler implementation can call
- * invoke() on that fragment to evaluate the body as
- * many times as it needs.
A SimpleTag handler must have a public no-args constructor. Most - * SimpleTag handlers should extend SimpleTagSupport.
- * - *Lifecycle
- * - *The following is a non-normative, brief overview of the - * SimpleTag lifecycle. Refer to the JSP Specification for details.
- * - *setJspContext() and setParent()
- * methods are called by the container. The setParent()
- * method is only called if the element is nested within another tag
- * invocation.setJspBody() method is called
- * by the container to set the body of this tag, as a
- * JspFragment. If the action element is empty in
- * the page, this method is not called at all.doTag() method is called by the container. All
- * tag logic, iteration, body evaluations, etc. occur in this
- * method.doTag() method returns and all variables are
- * synchronized.- * The JSP container will resynchronize any AT_BEGIN and AT_END - * variables (defined by the associated tag file, TagExtraInfo, or TLD) - * after the invocation of doTag(). - * - * @throws javax.servlet.jsp.JspException If an error occurred - * while processing this tag. - * @throws javax.servlet.jsp.SkipPageException If the page that - * (either directly or indirectly) invoked this tag is to - * cease evaluation. A Simple Tag Handler generated from a - * tag file must throw this exception if an invoked Classic - * Tag Handler returned SKIP_PAGE or if an invoked Simple - * Tag Handler threw SkipPageException or if an invoked Jsp Fragment - * threw a SkipPageException. - * @throws java.io.IOException If there was an error writing to the - * output stream. - */ - public void doTag() - throws javax.servlet.jsp.JspException, java.io.IOException; - - /** - * Sets the parent of this tag, for collaboration purposes. - *
- * The container invokes this method only if this tag invocation is
- * nested within another tag invocation.
- *
- * @param parent the tag that encloses this tag
- */
- public void setParent( JspTag parent );
-
- /**
- * Returns the parent of this tag, for collaboration purposes.
- *
- * @return the parent of this tag
- */
- public JspTag getParent();
-
- /**
- * Called by the container to provide this tag handler with
- * the JspContext for this invocation.
- * An implementation should save this value.
- *
- * @param pc the page context for this invocation
- * @see Tag#setPageContext
- */
- public void setJspContext( JspContext pc );
-
- /**
- * Provides the body of this tag as a JspFragment object, able to be
- * invoked zero or more times by the tag handler.
- *
- * This method is invoked by the JSP page implementation
- * object prior to doTag(). If the action element is
- * empty in the page, this method is not called at all.
- *
- * @param jspBody The fragment encapsulating the body of this tag.
- */
- public void setJspBody( JspFragment jspBody );
-
-
-}
diff --git a/api/src/main/java/javax/servlet/jsp/tagext/SimpleTagSupport.java b/api/src/main/java/javax/servlet/jsp/tagext/SimpleTagSupport.java
deleted file mode 100644
index b614455..0000000
--- a/api/src/main/java/javax/servlet/jsp/tagext/SimpleTagSupport.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp.tagext;
-
-import javax.servlet.jsp.JspContext;
-import javax.servlet.jsp.JspException;
-import java.io.IOException;
-
-/**
- * A base class for defining tag handlers implementing SimpleTag.
- *
- * The SimpleTagSupport class is a utility class intended to be used - * as the base class for new simple tag handlers. The SimpleTagSupport - * class implements the SimpleTag interface and adds additional - * convenience methods including getter methods for the properties in - * SimpleTag. - * - * @since JSP 2.0 - */ -public class SimpleTagSupport - implements SimpleTag -{ - /** Reference to the enclosing tag. */ - private JspTag parentTag; - - /** The JSP context for the upcoming tag invocation. */ - private JspContext jspContext; - - /** The body of the tag. */ - private JspFragment jspBody; - - /** - * Sole constructor. (For invocation by subclass constructors, - * typically implicit.) - */ - public SimpleTagSupport() { - } - - /** - * Default processing of the tag does nothing. - * - * @throws JspException Subclasses can throw JspException to indicate - * an error occurred while processing this tag. - * @throws javax.servlet.jsp.SkipPageException If the page that - * (either directly or indirectly) invoked this tag is to - * cease evaluation. A Simple Tag Handler generated from a - * tag file must throw this exception if an invoked Classic - * Tag Handler returned SKIP_PAGE or if an invoked Simple - * Tag Handler threw SkipPageException or if an invoked Jsp Fragment - * threw a SkipPageException. - * @throws IOException Subclasses can throw IOException if there was - * an error writing to the output stream - * @see SimpleTag#doTag() - */ - public void doTag() - throws JspException, IOException - { - } - - /** - * Sets the parent of this tag, for collaboration purposes. - *
- * The container invokes this method only if this tag invocation is
- * nested within another tag invocation.
- *
- * @param parent the tag that encloses this tag
- */
- public void setParent( JspTag parent ) {
- this.parentTag = parent;
- }
-
- /**
- * Returns the parent of this tag, for collaboration purposes.
- *
- * @return the parent of this tag
- */
- public JspTag getParent() {
- return this.parentTag;
- }
-
- /**
- * Stores the provided JSP context in the private jspContext field.
- * Subclasses can access the JspContext via
- * getJspContext().
- *
- * @param pc the page context for this invocation
- * @see SimpleTag#setJspContext
- */
- public void setJspContext( JspContext pc ) {
- this.jspContext = pc;
- }
-
- /**
- * Returns the page context passed in by the container via
- * setJspContext.
- *
- * @return the page context for this invocation
- */
- protected JspContext getJspContext() {
- return this.jspContext;
- }
-
- /**
- * Stores the provided JspFragment.
- *
- * @param jspBody The fragment encapsulating the body of this tag.
- * If the action element is empty in the page, this method is
- * not called at all.
- * @see SimpleTag#setJspBody
- */
- public void setJspBody( JspFragment jspBody ) {
- this.jspBody = jspBody;
- }
-
- /**
- * Returns the body passed in by the container via setJspBody.
- *
- * @return the fragment encapsulating the body of this tag, or
- * null if the action element is empty in the page.
- */
- protected JspFragment getJspBody() {
- return this.jspBody;
- }
-
- /**
- * Find the instance of a given class type that is closest to a given
- * instance.
- * This method uses the getParent method from the Tag and/or SimpleTag
- * interfaces. This method is used for coordination among
- * cooperating tags.
- *
- *
For every instance of TagAdapter - * encountered while traversing the ancestors, the tag handler returned by - * TagAdapter.getAdaptee() - instead of the TagAdpater itself - - * is compared to klass. If the tag handler matches, it - and - * not its TagAdapter - is returned. - * - *
- * The current version of the specification only provides one formal - * way of indicating the observable type of a tag handler: its - * tag handler implementation class, described in the tag-class - * subelement of the tag element. This is extended in an - * informal manner by allowing the tag library author to - * indicate in the description subelement an observable type. - * The type should be a subtype of the tag handler implementation - * class or void. - * This addititional constraint can be exploited by a - * specialized container that knows about that specific tag library, - * as in the case of the JSP standard tag library. - * - *
- * When a tag library author provides information on the - * observable type of a tag handler, client programmatic code - * should adhere to that constraint. Specifically, the Class - * passed to findAncestorWithClass should be a subtype of the - * observable type. - * - * - * @param from The instance from where to start looking. - * @param klass The subclass of JspTag or interface to be matched - * @return the nearest ancestor that implements the interface - * or is an instance of the class specified - */ - public static final JspTag findAncestorWithClass( - JspTag from, Class> klass) - { - boolean isInterface = false; - - if (from == null || klass == null - || (!JspTag.class.isAssignableFrom(klass) - && !(isInterface = klass.isInterface()))) { - return null; - } - - for (;;) { - JspTag parent = null; - if( from instanceof SimpleTag ) { - parent = ((SimpleTag)from).getParent(); - } - else if( from instanceof Tag ) { - parent = ((Tag)from).getParent(); - } - if (parent == null) { - return null; - } - - if (parent instanceof TagAdapter) { - parent = ((TagAdapter) parent).getAdaptee(); - } - - if ((isInterface && klass.isInstance(parent)) - || klass.isAssignableFrom(parent.getClass())) { - return parent; - } - - from = parent; - } - } -} diff --git a/api/src/main/java/javax/servlet/jsp/tagext/Tag.java b/api/src/main/java/javax/servlet/jsp/tagext/Tag.java deleted file mode 100644 index 5f23e74..0000000 --- a/api/src/main/java/javax/servlet/jsp/tagext/Tag.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.tagext; - -import javax.servlet.jsp.*; - - -/** - * The interface of a classic tag handler that does not want to manipulate - * its body. The Tag interface defines the basic protocol between a Tag - * handler and JSP page implementation class. It defines the life cycle - * and the methods to be invoked at start and end tag. - * - *
Properties
- * - *The Tag interface specifies the setter and getter methods for the core - * pageContext and parent properties.
- * - *The JSP page implementation object invokes setPageContext and - * setParent, in that order, before invoking doStartTag() or doEndTag().
- * - *Methods
- * - *There are two main actions: doStartTag and doEndTag. Once all - * appropriate properties have been initialized, the doStartTag and - * doEndTag methods can be invoked on the tag handler. Between these - * invocations, the tag handler is assumed to hold a state that must - * be preserved. After the doEndTag invocation, the tag handler is - * available for further invocations (and it is expected to have - * retained its properties).
- * - *Lifecycle
- * - *Lifecycle details are described by the transition diagram below, - * with the following comments: - *
setParent() is called if it's
- * reused within the same page but at a different level,
- * setPageContext() is called if it's used in another page,
- * and attribute setters are called if the values differ or are expressed
- * as request-time attribute values.
- *
- *
- * Once all invocations on the tag handler - * are completed, the release method is invoked on it. Once a release - * method is invoked all properties, including parent and - * pageContext, are assumed to have been reset to an unspecified value. - * The page compiler guarantees that release() will be invoked on the Tag - * handler before the handler is released to the GC.
- * - *Empty and Non-Empty Action
- *If the TagLibraryDescriptor file indicates that the action must - * always have an empty action, by an <body-content> entry of "empty", - * then the doStartTag() method must return SKIP_BODY.
- * - *Otherwise, the doStartTag() method may return SKIP_BODY or - * EVAL_BODY_INCLUDE.
- * - *If SKIP_BODY is returned the body, if present, is not evaluated.
- * - *If EVAL_BODY_INCLUDE is returned, the body is evaluated and - * "passed through" to the current out.
-*/ - -public interface Tag extends JspTag { - - /** - * Skip body evaluation. - * Valid return value for doStartTag and doAfterBody. - */ - - public final static int SKIP_BODY = 0; - - /** - * Evaluate body into existing out stream. - * Valid return value for doStartTag. - */ - - public final static int EVAL_BODY_INCLUDE = 1; - - /** - * Skip the rest of the page. - * Valid return value for doEndTag. - */ - - public final static int SKIP_PAGE = 5; - - /** - * Continue evaluating the page. - * Valid return value for doEndTag(). - */ - - public final static int EVAL_PAGE = 6; - - // Setters for Tag handler data - - - /** - * Set the current page context. - * This method is invoked by the JSP page implementation object - * prior to doStartTag(). - *- * This value is *not* reset by doEndTag() and must be explicitly reset - * by a page implementation if it changes between calls to doStartTag(). - * - * @param pc The page context for this tag handler. - */ - - void setPageContext(PageContext pc); - - - /** - * Set the parent (closest enclosing tag handler) of this tag handler. - * Invoked by the JSP page implementation object prior to doStartTag(). - *
- * This value is *not* reset by doEndTag() and must be explicitly reset - * by a page implementation. - * - * @param t The parent tag, or null. - */ - - - void setParent(Tag t); - - - /** - * Get the parent (closest enclosing tag handler) for this tag handler. - * - *
- * The getParent() method can be used to navigate the nested tag - * handler structure at runtime for cooperation among custom actions; - * for example, the findAncestorWithClass() method in TagSupport - * provides a convenient way of doing this. - * - *
- * The current version of the specification only provides one formal - * way of indicating the observable type of a tag handler: its - * tag handler implementation class, described in the tag-class - * subelement of the tag element. This is extended in an - * informal manner by allowing the tag library author to - * indicate in the description subelement an observable type. - * The type should be a subtype of the tag handler implementation - * class or void. - * This addititional constraint can be exploited by a - * specialized container that knows about that specific tag library, - * as in the case of the JSP standard tag library. - * - * @return the current parent, or null if none. - * @see TagSupport#findAncestorWithClass - */ - - Tag getParent(); - - - // Actions for basic start/end processing. - - - /** - * Process the start tag for this instance. - * This method is invoked by the JSP page implementation object. - * - *
- * The doStartTag method assumes that the properties pageContext and - * parent have been set. It also assumes that any properties exposed as - * attributes have been set too. When this method is invoked, the body - * has not yet been evaluated. - * - *
- * This method returns Tag.EVAL_BODY_INCLUDE or - * BodyTag.EVAL_BODY_BUFFERED to indicate - * that the body of the action should be evaluated or SKIP_BODY to - * indicate otherwise. - * - *
- * When a Tag returns EVAL_BODY_INCLUDE the result of evaluating - * the body (if any) is included into the current "out" JspWriter as it - * happens and then doEndTag() is invoked. - * - *
- * BodyTag.EVAL_BODY_BUFFERED is only valid if the tag handler - * implements BodyTag. - * - *
- * The JSP container will resynchronize the values of any AT_BEGIN and - * NESTED variables (defined by the associated TagExtraInfo or TLD) - * after the invocation of doStartTag(), except for a tag handler - * implementing BodyTag whose doStartTag() method returns - * BodyTag.EVAL_BODY_BUFFERED. - * - * @return EVAL_BODY_INCLUDE if the tag wants to process body, SKIP_BODY - * if it does not want to process it. - * @throws JspException if an error occurred while processing this tag - * @see BodyTag - */ - - int doStartTag() throws JspException; - - - /** - * Process the end tag for this instance. - * This method is invoked by the JSP page implementation object - * on all Tag handlers. - * - *
- * This method will be called after returning from doStartTag. The - * body of the action may or may not have been evaluated, depending on - * the return value of doStartTag. - * - *
- * If this method returns EVAL_PAGE, the rest of the page continues - * to be evaluated. If this method returns SKIP_PAGE, the rest of - * the page is not evaluated, the request is completed, and - * the doEndTag() methods of enclosing tags are not invoked. If this - * request was forwarded or included from another page (or Servlet), - * only the current page evaluation is stopped. - * - *
- * The JSP container will resynchronize the values of any AT_BEGIN and - * AT_END variables (defined by the associated TagExtraInfo or TLD) - * after the invocation of doEndTag(). - * - * @return indication of whether to continue evaluating the JSP page. - * @throws JspException if an error occurred while processing this tag - */ - - int doEndTag() throws JspException; - - /** - * Called on a Tag handler to release state. - * The page compiler guarantees that JSP page implementation - * objects will invoke this method on all tag handlers, - * but there may be multiple invocations on doStartTag and doEndTag in between. - */ - - void release(); - -} diff --git a/api/src/main/java/javax/servlet/jsp/tagext/TagAdapter.java b/api/src/main/java/javax/servlet/jsp/tagext/TagAdapter.java deleted file mode 100644 index a432976..0000000 --- a/api/src/main/java/javax/servlet/jsp/tagext/TagAdapter.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.tagext; - -import javax.servlet.jsp.*; - - -/** - * Wraps any SimpleTag and exposes it using a Tag interface. This is used - * to allow collaboration between classic Tag handlers and SimpleTag - * handlers. - *
- * Because SimpleTag does not extend Tag, and because Tag.setParent() - * only accepts a Tag instance, a classic tag handler (one - * that implements Tag) cannot have a SimpleTag as its parent. To remedy - * this, a TagAdapter is created to wrap the SimpleTag parent, and the - * adapter is passed to setParent() instead. A classic Tag Handler can - * call getAdaptee() to retrieve the encapsulated SimpleTag instance. - * - * @since JSP 2.0 - */ -public class TagAdapter - implements Tag -{ - /** The simple tag that's being adapted. */ - private SimpleTag simpleTagAdaptee; - - /** The parent, of this tag, converted (if necessary) to be of type Tag. */ - private Tag parent; - - // Flag indicating whether we have already determined the parent - private boolean parentDetermined; - - /** - * Creates a new TagAdapter that wraps the given SimpleTag and - * returns the parent tag when getParent() is called. - * - * @param adaptee The SimpleTag being adapted as a Tag. - */ - public TagAdapter( SimpleTag adaptee ) { - if( adaptee == null ) { - // Cannot wrap a null adaptee. - throw new IllegalArgumentException(); - } - this.simpleTagAdaptee = adaptee; - } - - /** - * Must not be called. - * - * @param pc ignored. - * @throws UnsupportedOperationException Must not be called - */ - public void setPageContext(PageContext pc) { - throw new UnsupportedOperationException( - "Illegal to invoke setPageContext() on TagAdapter wrapper" ); - } - - - /** - * Must not be called. The parent of this tag is always - * getAdaptee().getParent(). - * - * @param parentTag ignored. - * @throws UnsupportedOperationException Must not be called. - */ - public void setParent( Tag parentTag ) { - throw new UnsupportedOperationException( - "Illegal to invoke setParent() on TagAdapter wrapper" ); - } - - - /** - * Returns the parent of this tag, which is always - * getAdaptee().getParent(). - * - * This will either be the enclosing Tag (if getAdaptee().getParent() - * implements Tag), or an adapter to the enclosing Tag (if - * getAdaptee().getParent() does not implement Tag). - * - * @return The parent of the tag being adapted. - */ - public Tag getParent() { - if (!parentDetermined) { - JspTag adapteeParent = simpleTagAdaptee.getParent(); - if (adapteeParent != null) { - if (adapteeParent instanceof Tag) { - this.parent = (Tag) adapteeParent; - } else { - // Must be SimpleTag - no other types defined. - this.parent = new TagAdapter((SimpleTag) adapteeParent); - } - } - parentDetermined = true; - } - - return this.parent; - } - - /** - * Gets the tag that is being adapted to the Tag interface. - * This should be an instance of SimpleTag in JSP 2.0, but room - * is left for other kinds of tags in future spec versions. - * - * @return the tag that is being adapted - */ - public JspTag getAdaptee() { - return this.simpleTagAdaptee; - } - - /** - * Must not be called. - * - * @return always throws UnsupportedOperationException - * @throws UnsupportedOperationException Must not be called - * @throws JspException never thrown - */ - public int doStartTag() throws JspException { - throw new UnsupportedOperationException( - "Illegal to invoke doStartTag() on TagAdapter wrapper" ); - } - - /** - * Must not be called. - * - * @return always throws UnsupportedOperationException - * @throws UnsupportedOperationException Must not be called - * @throws JspException never thrown - */ - public int doEndTag() throws JspException { - throw new UnsupportedOperationException( - "Illegal to invoke doEndTag() on TagAdapter wrapper" ); - } - - /** - * Must not be called. - * - * @throws UnsupportedOperationException Must not be called - */ - public void release() { - throw new UnsupportedOperationException( - "Illegal to invoke release() on TagAdapter wrapper" ); - } -} diff --git a/api/src/main/java/javax/servlet/jsp/tagext/TagAttributeInfo.java b/api/src/main/java/javax/servlet/jsp/tagext/TagAttributeInfo.java deleted file mode 100644 index ce6766c..0000000 --- a/api/src/main/java/javax/servlet/jsp/tagext/TagAttributeInfo.java +++ /dev/null @@ -1,365 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.tagext; - -/** - * Information on the attributes of a Tag, available at translation time. - * This class is instantiated from the Tag Library Descriptor file (TLD). - *
- * Only the information needed to generate code is included here. Other information - * like SCHEMA for validation belongs elsewhere. - *
- * Note from the Expert Group:
- * This should have been designed as an interface. Every time we change the TLD,
- * we need to add a new constructor to this class (not good).
- * This class should only be instantiated by container implementations
- * (not by JSP developers).
- */
-
-public class TagAttributeInfo {
- /**
- * "id" is wired in to be ID. There is no real benefit in having it be something else
- * IDREFs are not handled any differently.
- */
-
- public static final String ID = "id";
-
- /**
- * Constructor for TagAttributeInfo.
- * This class is to be instantiated only from the
- * TagLibrary code under request from some JSP code that is parsing a
- * TLD (Tag Library Descriptor).
- *
- * @param name The name of the attribute.
- * @param required If this attribute is required in tag instances.
- * @param type The name of the type of the attribute.
- * @param reqTime Whether this attribute holds a request-time Attribute.
- */
-
- public TagAttributeInfo(String name, boolean required,
- String type, boolean reqTime) {
- this.name = name;
- this.required = required;
- this.type = type;
- this.reqTime = reqTime;
- }
-
- /**
- * JSP 2.0 Constructor for TagAttributeInfo.
- * This class is to be instantiated only from the
- * TagLibrary code under request from some JSP code that is parsing a
- * TLD (Tag Library Descriptor).
- *
- * @param name The name of the attribute.
- * @param required If this attribute is required in tag instances.
- * @param type The name of the type of the attribute.
- * @param reqTime Whether this attribute holds a request-time Attribute.
- * @param fragment Whether this attribute is of type JspFragment
- *
- * @since JSP 2.0
- */
- public TagAttributeInfo(String name, boolean required,
- String type, boolean reqTime,
- boolean fragment) {
- this( name, required, type, reqTime );
- this.fragment = fragment;
- }
-
- /**
- * JSP 2.1 Constructor for TagAttributeInfo.
- * This class is to be instantiated only from the
- * TagLibrary code under request from some JSP code that is parsing a
- * TLD (Tag Library Descriptor).
- *
- * @param name The name of the attribute.
- * @param required If this attribute is required in tag instances.
- * @param type The name of the type of the attribute.
- * @param reqTime Whether this attribute holds a request-time Attribute.
- * @param fragment Whether this attribute is of type JspFragment
- * @param description The description of the attribute.
- * @param deferredValue Whether this attribute is a deferred value.
- * @param deferredMethod Whether this attribute is a deferred method.
- * rtexpr or deferred value.
- * @param expectedTypeName The name of the expected type of this deferred
- * value (or null if this is not a deferred value).
- * @param methodSignature The expected method signature of this deferred
- * method (or null if this is not a deferred method).
- *
- * @since JSP 2.1
- */
- public TagAttributeInfo(String name,
- boolean required,
- String type,
- boolean reqTime,
- boolean fragment,
- String description,
- boolean deferredValue,
- boolean deferredMethod,
- String expectedTypeName,
- String methodSignature)
- {
- this( name, required, type, reqTime, fragment );
- this.description = description;
- this.deferredValue = deferredValue;
- this.deferredMethod = deferredMethod;
- this.expectedTypeName = expectedTypeName;
- this.methodSignature = methodSignature;
- }
-
- /**
- * The name of this attribute.
- *
- * @return the name of the attribute
- */
-
- public String getName() {
- return name;
- }
-
- /**
- * The type (as a String) of this attribute.
- *
- *
This method must return "javax.el.ValueExpression"
- * if isDeferredValue() returns true and
- * canBeRequestTime() returns false. It
- * must return "javax.el.MethodExpression" if
- * isDeferredMethod() returns true.
- * It must return "java.lang.Object" if
- * isDeferredValue() returns true and
- * canBeRequestTime() returns true.
- *
true, this means the attribute
- * can hold a request-time value.
- *
- * @return true if the attribute has been specified in the TLD
- * as rtexprvalue
- */
-
- public boolean canBeRequestTime() {
- return reqTime;
- }
-
- /**
- * Whether this attribute is required.
- *
- * @return if the attribute is required.
- */
- public boolean isRequired() {
- return required;
- }
-
- /**
- * Convenience static method that goes through an array of TagAttributeInfo
- * objects and looks for "id".
- *
- * @param a An array of TagAttributeInfo
- * @return The TagAttributeInfo reference with name "id"
- */
- public static TagAttributeInfo getIdAttribute(TagAttributeInfo a[]) {
- for (int i=0; iValueExpression so that expression evaluation
- * can be deferred.
- *
- * If this method returns true, then
- * getTypeName() must return
- * "javax.el.ValueExpression".
The getExpectedType() method can be used to retrieve
- * the expected type this value expression will be constructed with.
true if this attribute accepts a deferred value;
- * false otherwise.
- *
- * @since JSP 2.1
- */
- public boolean isDeferredValue() {
- return deferredValue;
- }
-
- /**
- * Returns true if this attribute is to be passed a
- * MethodExpression so that expression evaluation
- * can be deferred.
- *
- * If this method returns true, then
- * getTypeName() must return
- * "javax.el.MethodExpression".
The getMethodSignature() method can be used to retrieve
- * the expected method signature this method expression will be
- * constructed with.
true if this attribute accepts a deferred method;
- * false otherwise.
- *
- * @since JSP 2.1
- */
- public boolean isDeferredMethod() {
- return deferredMethod;
- }
-
- /**
- * Returns the name of the expected type (as a String) of this
- * deferred value attribute.
- *
- * This method returns null if
- * isDeferredValue() returns false.
This method returns null if
- * isDeferredMethod() returns false.
- * TagData is only used as an argument to the isValid, validate, and - * getVariableInfo methods of TagExtraInfo, which are invoked at - * translation time. - */ - -public class TagData implements Cloneable { - - /** - * Distinguished value for an attribute to indicate its value - * is a request-time expression (which is not yet available because - * TagData instances are used at translation-time). - */ - - public static final Object REQUEST_TIME_VALUE = new Object(); - - - /** - * Constructor for TagData. - * - *
- * A typical constructor may be - *
- * static final Object[][] att = {{"connection", "conn0"}, {"id", "query0"}};
- * static final TagData td = new TagData(att);
- *
- *
- * All values must be Strings except for those holding the
- * distinguished object REQUEST_TIME_VALUE.
-
- * @param atts the static attribute and values. May be null.
- */
- public TagData(Object[] atts[]) {
- if (atts == null) {
- attributes = new Hashtable- * This class can be used: - *
- * It is the responsibility of the JSP translator that the initial value - * to be returned by calls to getTagInfo() corresponds to a TagInfo - * object for the tag being translated. If an explicit call to - * setTagInfo() is done, then the object passed will be returned in - * subsequent calls to getTagInfo(). - * - *
- * The only way to affect the value returned by getTagInfo() - * is through a setTagInfo() call, and thus, TagExtraInfo.setTagInfo() is - * to be called by the JSP translator, with a TagInfo object that - * corresponds to the tag being translated. The call should happen before - * any invocation on validate() and before any invocation on - * getVariableInfo(). - * - *
- * NOTE: It is a (translation time) error for a tag definition - * in a TLD with one or more variable subelements to have an associated - * TagExtraInfo implementation that returns a VariableInfo array with - * one or more elements from a call to getVariableInfo(). - */ - -public abstract class TagExtraInfo { - - /** - * Sole constructor. (For invocation by subclass constructors, - * typically implicit.) - */ - public TagExtraInfo() { - } - - /** - * information on scripting variables defined by the tag associated with - * this TagExtraInfo instance. - * Request-time attributes are indicated as such in the TagData parameter. - * - * @param data The TagData instance. - * @return An array of VariableInfo data, or null or a zero length array - * if no scripting variables are to be defined. - */ - public VariableInfo[] getVariableInfo(TagData data) { - return ZERO_VARIABLE_INFO; - } - - /** - * Translation-time validation of the attributes. - * Request-time attributes are indicated as such in the TagData parameter. - * Note that the preferred way to do validation is with the validate() - * method, since it can return more detailed information. - * - * @param data The TagData instance. - * @return Whether this tag instance is valid. - * @see TagExtraInfo#validate - */ - - public boolean isValid(TagData data) { - return true; - } - - /** - * Translation-time validation of the attributes. - * Request-time attributes are indicated as such in the TagData parameter. - * Because of the higher quality validation messages possible, - * this is the preferred way to do validation (although isValid() - * still works). - * - *
JSP 2.0 and higher containers call validate() instead of isValid(). - * The default implementation of this method is to call isValid(). If - * isValid() returns false, a generic ValidationMessage[] is returned - * indicating isValid() returned false.
- * - * @param data The TagData instance. - * @return A null object, or zero length array if no errors, an - * array of ValidationMessages otherwise. - * @since JSP 2.0 - */ - public ValidationMessage[] validate( TagData data ) { - ValidationMessage[] result = null; - - if( !isValid( data ) ) { - result = new ValidationMessage[] { - new ValidationMessage( data.getId(), "isValid() == false" ) }; - } - - return result; - } - - /** - * Set the TagInfo for this class. - * - * @param tagInfo The TagInfo this instance is extending - */ - public final void setTagInfo(TagInfo tagInfo) { - this.tagInfo = tagInfo; - } - - /** - * Get the TagInfo for this class. - * - * @return the taginfo instance this instance is extending - */ - public final TagInfo getTagInfo() { - return tagInfo; - } - - // private data - private TagInfo tagInfo; - - // zero length VariableInfo array - private static final VariableInfo[] ZERO_VARIABLE_INFO = { }; -} - diff --git a/api/src/main/java/javax/servlet/jsp/tagext/TagFileInfo.java b/api/src/main/java/javax/servlet/jsp/tagext/TagFileInfo.java deleted file mode 100644 index 817b0ce..0000000 --- a/api/src/main/java/javax/servlet/jsp/tagext/TagFileInfo.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.tagext; - -/** - * Tag information for a tag file in a Tag Library; - * This class is instantiated from the Tag Library Descriptor file (TLD) - * and is available only at translation time. - * - * @since JSP 2.0 - */ -public class TagFileInfo { - - /** - * Constructor for TagFileInfo from data in the JSP 2.0 format for TLD. - * This class is to be instantiated only from the TagLibrary code - * under request from some JSP code that is parsing a - * TLD (Tag Library Descriptor). - * - * Note that, since TagLibibraryInfo reflects both TLD information - * and taglib directive information, a TagFileInfo instance is - * dependent on a taglib directive. This is probably a - * design error, which may be fixed in the future. - * - * @param name The unique action name of this tag - * @param path Where to find the .tag file implementing this - * action, relative to the location of the TLD file. - * @param tagInfo The detailed information about this tag, as parsed - * from the directives in the tag file. - */ - public TagFileInfo( String name, String path, TagInfo tagInfo ) { - this.name = name; - this.path = path; - this.tagInfo = tagInfo; - } - - /** - * The unique action name of this tag. - * - * @return The (short) name of the tag. - */ - public String getName() { - return name; - } - - /** - * Where to find the .tag file implementing this action. - * - * @return The path of the tag file, relative to the TLD, or "." if - * the tag file was defined in an implicit tag file. - */ - public String getPath() { - return path; - } - - /** - * Returns information about this tag, parsed from the directives - * in the tag file. - * - * @return a TagInfo object containing information about this tag - */ - public TagInfo getTagInfo() { - return tagInfo; - } - - // private fields for 2.0 info - private String name; - private String path; - private TagInfo tagInfo; -} diff --git a/api/src/main/java/javax/servlet/jsp/tagext/TagInfo.java b/api/src/main/java/javax/servlet/jsp/tagext/TagInfo.java deleted file mode 100644 index 3d089c9..0000000 --- a/api/src/main/java/javax/servlet/jsp/tagext/TagInfo.java +++ /dev/null @@ -1,487 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.tagext; - -/** - * Tag information for a tag in a Tag Library; - * This class is instantiated from the Tag Library Descriptor file (TLD) - * and is available only at translation time. - * - * -*/ - -public class TagInfo { - - /** - * Static constant for getBodyContent() when it is JSP. - */ - - public static final String BODY_CONTENT_JSP = "JSP"; - - /** - * Static constant for getBodyContent() when it is Tag dependent. - */ - - public static final String BODY_CONTENT_TAG_DEPENDENT = "tagdependent"; - - - /** - * Static constant for getBodyContent() when it is empty. - */ - - public static final String BODY_CONTENT_EMPTY = "empty"; - - /** - * Static constant for getBodyContent() when it is scriptless. - * - * @since JSP 2.0 - */ - public static final String BODY_CONTENT_SCRIPTLESS = "scriptless"; - - /** - * Constructor for TagInfo from data in the JSP 1.1 format for TLD. - * This class is to be instantiated only from the TagLibrary code - * under request from some JSP code that is parsing a - * TLD (Tag Library Descriptor). - * - * Note that, since TagLibibraryInfo reflects both TLD information - * and taglib directive information, a TagInfo instance is - * dependent on a taglib directive. This is probably a - * design error, which may be fixed in the future. - * - * @param tagName The name of this tag - * @param tagClassName The name of the tag handler class - * @param bodycontent Information on the body content of these tags - * @param infoString The (optional) string information for this tag - * @param taglib The instance of the tag library that contains us. - * @param tagExtraInfo The instance providing extra Tag info. May be null - * @param attributeInfo An array of AttributeInfo data from descriptor. - * May be null; - * - */ - public TagInfo(String tagName, - String tagClassName, - String bodycontent, - String infoString, - TagLibraryInfo taglib, - TagExtraInfo tagExtraInfo, - TagAttributeInfo[] attributeInfo) { - this.tagName = tagName; - this.tagClassName = tagClassName; - this.bodyContent = bodycontent; - this.infoString = infoString; - this.tagLibrary = taglib; - this.tagExtraInfo = tagExtraInfo; - this.attributeInfo = attributeInfo; - - if (tagExtraInfo != null) - tagExtraInfo.setTagInfo(this); - } - - /** - * Constructor for TagInfo from data in the JSP 1.2 format for TLD. - * This class is to be instantiated only from the TagLibrary code - * under request from some JSP code that is parsing a - * TLD (Tag Library Descriptor). - * - * Note that, since TagLibibraryInfo reflects both TLD information - * and taglib directive information, a TagInfo instance is - * dependent on a taglib directive. This is probably a - * design error, which may be fixed in the future. - * - * @param tagName The name of this tag - * @param tagClassName The name of the tag handler class - * @param bodycontent Information on the body content of these tags - * @param infoString The (optional) string information for this tag - * @param taglib The instance of the tag library that contains us. - * @param tagExtraInfo The instance providing extra Tag info. May be null - * @param attributeInfo An array of AttributeInfo data from descriptor. - * May be null; - * @param displayName A short name to be displayed by tools - * @param smallIcon Path to a small icon to be displayed by tools - * @param largeIcon Path to a large icon to be displayed by tools - * @param tvi An array of a TagVariableInfo (or null) - */ - public TagInfo(String tagName, - String tagClassName, - String bodycontent, - String infoString, - TagLibraryInfo taglib, - TagExtraInfo tagExtraInfo, - TagAttributeInfo[] attributeInfo, - String displayName, - String smallIcon, - String largeIcon, - TagVariableInfo[] tvi) { - this.tagName = tagName; - this.tagClassName = tagClassName; - this.bodyContent = bodycontent; - this.infoString = infoString; - this.tagLibrary = taglib; - this.tagExtraInfo = tagExtraInfo; - this.attributeInfo = attributeInfo; - this.displayName = displayName; - this.smallIcon = smallIcon; - this.largeIcon = largeIcon; - this.tagVariableInfo = tvi; - - if (tagExtraInfo != null) - tagExtraInfo.setTagInfo(this); - } - - /** - * Constructor for TagInfo from data in the JSP 2.0 format for TLD. - * This class is to be instantiated only from the TagLibrary code - * under request from some JSP code that is parsing a - * TLD (Tag Library Descriptor). - * - * Note that, since TagLibibraryInfo reflects both TLD information - * and taglib directive information, a TagInfo instance is - * dependent on a taglib directive. This is probably a - * design error, which may be fixed in the future. - * - * @param tagName The name of this tag - * @param tagClassName The name of the tag handler class - * @param bodycontent Information on the body content of these tags - * @param infoString The (optional) string information for this tag - * @param taglib The instance of the tag library that contains us. - * @param tagExtraInfo The instance providing extra Tag info. May be null - * @param attributeInfo An array of AttributeInfo data from descriptor. - * May be null; - * @param displayName A short name to be displayed by tools - * @param smallIcon Path to a small icon to be displayed by tools - * @param largeIcon Path to a large icon to be displayed by tools - * @param tvi An array of a TagVariableInfo (or null) - * @param dynamicAttributes True if supports dynamic attributes - * - * @since JSP 2.0 - */ - public TagInfo(String tagName, - String tagClassName, - String bodycontent, - String infoString, - TagLibraryInfo taglib, - TagExtraInfo tagExtraInfo, - TagAttributeInfo[] attributeInfo, - String displayName, - String smallIcon, - String largeIcon, - TagVariableInfo[] tvi, - boolean dynamicAttributes) { - this.tagName = tagName; - this.tagClassName = tagClassName; - this.bodyContent = bodycontent; - this.infoString = infoString; - this.tagLibrary = taglib; - this.tagExtraInfo = tagExtraInfo; - this.attributeInfo = attributeInfo; - this.displayName = displayName; - this.smallIcon = smallIcon; - this.largeIcon = largeIcon; - this.tagVariableInfo = tvi; - this.dynamicAttributes = dynamicAttributes; - - if (tagExtraInfo != null) - tagExtraInfo.setTagInfo(this); - } - - /** - * The name of the Tag. - * - * @return The (short) name of the tag. - */ - - public String getTagName() { - return tagName; - } - - /** - * Attribute information (in the TLD) on this tag. - * The return is an array describing the attributes of this tag, as - * indicated in the TLD. - * - * @return The array of TagAttributeInfo for this tag, or a - * zero-length array if the tag has no attributes. - */ - - public TagAttributeInfo[] getAttributes() { - return attributeInfo; - } - - /** - * Information on the scripting objects created by this tag at runtime. - * This is a convenience method on the associated TagExtraInfo class. - * - * @param data TagData describing this action. - * @return if a TagExtraInfo object is associated with this TagInfo, the - * result of getTagExtraInfo().getVariableInfo( data ), otherwise - * null. - */ - public VariableInfo[] getVariableInfo(TagData data) { - VariableInfo[] result = null; - TagExtraInfo tei = getTagExtraInfo(); - if (tei != null) { - result = tei.getVariableInfo( data ); - } - return result; - } - - /** - * Translation-time validation of the attributes. - * This is a convenience method on the associated TagExtraInfo class. - * - * @param data The translation-time TagData instance. - * @return Whether the data is valid. - */ - public boolean isValid(TagData data) { - TagExtraInfo tei = getTagExtraInfo(); - if (tei == null) { - return true; - } - return tei.isValid(data); - } - - /** - * Translation-time validation of the attributes. - * This is a convenience method on the associated TagExtraInfo class. - * - * @param data The translation-time TagData instance. - * @return A null object, or zero length array if no errors, an - * array of ValidationMessages otherwise. - * @since JSP 2.0 - */ - public ValidationMessage[] validate( TagData data ) { - TagExtraInfo tei = getTagExtraInfo(); - if( tei == null ) { - return null; - } - return tei.validate( data ); - } - - /** - * Set the instance for extra tag information. - * - * @param tei the TagExtraInfo instance - */ - public void setTagExtraInfo(TagExtraInfo tei) { - tagExtraInfo = tei; - } - - - /** - * The instance (if any) for extra tag information. - * - * @return The TagExtraInfo instance, if any. - */ - public TagExtraInfo getTagExtraInfo() { - return tagExtraInfo; - } - - - /** - * Name of the class that provides the handler for this tag. - * - * @return The name of the tag handler class. - */ - - public String getTagClassName() { - return tagClassName; - } - - - /** - * The bodycontent information for this tag. - * If the bodycontent is not defined for this - * tag, the default of JSP will be returned. - * - * @return the body content string. - */ - - public String getBodyContent() { - return bodyContent; - } - - - /** - * The information string for the tag. - * - * @return the info string, or null if - * not defined - */ - - public String getInfoString() { - return infoString; - } - - - /** - * Set the TagLibraryInfo property. - * - * Note that a TagLibraryInfo element is dependent - * not just on the TLD information but also on the - * specific taglib instance used. This means that - * a fair amount of work needs to be done to construct - * and initialize TagLib objects. - * - * If used carefully, this setter can be used to avoid having to - * create new TagInfo elements for each taglib directive. - * - * @param tl the TagLibraryInfo to assign - */ - - public void setTagLibrary(TagLibraryInfo tl) { - tagLibrary = tl; - } - - /** - * The instance of TabLibraryInfo we belong to. - * - * @return the tag library instance we belong to - */ - - public TagLibraryInfo getTagLibrary() { - return tagLibrary; - } - - - // ============== JSP 2.0 TLD Information ======== - - - /** - * Get the displayName. - * - * @return A short name to be displayed by tools, - * or null if not defined - */ - - public String getDisplayName() { - return displayName; - } - - /** - * Get the path to the small icon. - * - * @return Path to a small icon to be displayed by tools, - * or null if not defined - */ - - public String getSmallIcon() { - return smallIcon; - } - - /** - * Get the path to the large icon. - * - * @return Path to a large icon to be displayed by tools, - * or null if not defined - */ - - public String getLargeIcon() { - return largeIcon; - } - - /** - * Get TagVariableInfo objects associated with this TagInfo. - * - * @return Array of TagVariableInfo objects corresponding to - * variables declared by this tag, or a zero length - * array if no variables have been declared - */ - - public TagVariableInfo[] getTagVariableInfos() { - return tagVariableInfo; - } - - - // ============== JSP 2.0 TLD Information ======== - - /** - * Get dynamicAttributes associated with this TagInfo. - * - * @return True if tag handler supports dynamic attributes - * @since JSP 2.0 - */ - public boolean hasDynamicAttributes() { - return dynamicAttributes; - } - - /* - * private fields for 1.1 info - */ - private String tagName; // the name of the tag - private String tagClassName; - private String bodyContent; - private String infoString; - private TagLibraryInfo tagLibrary; - private TagExtraInfo tagExtraInfo; // instance of TagExtraInfo - private TagAttributeInfo[] attributeInfo; - - /* - * private fields for 1.2 info - */ - private String displayName; - private String smallIcon; - private String largeIcon; - private TagVariableInfo[] tagVariableInfo; - - /* - * Additional private fields for 2.0 info - */ - private boolean dynamicAttributes; -} diff --git a/api/src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java b/api/src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java deleted file mode 100644 index d1a3394..0000000 --- a/api/src/main/java/javax/servlet/jsp/tagext/TagLibraryInfo.java +++ /dev/null @@ -1,342 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.tagext; - -import javax.servlet.jsp.tagext.TagInfo; -import javax.servlet.jsp.tagext.TagFileInfo; - -/** - * Translation-time information associated with a taglib directive, and its - * underlying TLD file. - * - * Most of the information is directly from the TLD, except for - * the prefix and the uri values used in the taglib directive - */ - -abstract public class TagLibraryInfo { - - /** - * Constructor. - * - * @param prefix the prefix actually used by the taglib directive - * @param uri the URI actually used by the taglib directive - */ - protected TagLibraryInfo(String prefix, String uri) { - this.prefix = prefix; - this.uri = uri; - } - - // ==== methods accessing taglib information ======= - - /** - * The value of the uri attribute from the taglib directive for - * this library. - * - * @return the value of the uri attribute - */ - - public String getURI() { - return uri; - } - - /** - * The prefix assigned to this taglib from the taglib directive - * - * @return the prefix assigned to this taglib from the taglib directive - */ - - public String getPrefixString() { - return prefix; - } - - // ==== methods using the TLD data ======= - - /** - * The preferred short name (prefix) as indicated in the TLD. - * This may be used by authoring tools as the preferred prefix - * to use when creating an taglib directive for this library. - * - * @return the preferred short name for the library - */ - public String getShortName() { - return shortname; - } - - /** - * The "reliable" URN indicated in the TLD (the uri element). - * This may be used by authoring tools as a global identifier - * to use when creating a taglib directive for this library. - * - * @return a reliable URN to a TLD like this - */ - public String getReliableURN() { - return urn; - } - - - /** - * Information (documentation) for this TLD. - * - * @return the info string for this tag lib - */ - - public String getInfoString() { - return info; - } - - - /** - * A string describing the required version of the JSP container. - * - * @return the (minimal) required version of the JSP container. - * @see javax.servlet.jsp.JspEngineInfo - */ - - public String getRequiredVersion() { - return jspversion; - } - - - /** - * An array describing the tags that are defined in this tag library. - * - * @return the TagInfo objects corresponding to the tags defined by this - * tag library, or a zero length array if this tag library - * defines no tags - */ - public TagInfo[] getTags() { - return tags; - } - - /** - * An array describing the tag files that are defined in this tag library. - * - * @return the TagFileInfo objects corresponding to the tag files defined - * by this tag library, or a zero length array if this - * tag library defines no tags files - * @since JSP 2.0 - */ - public TagFileInfo[] getTagFiles() { - return tagFiles; - } - - - /** - * Get the TagInfo for a given tag name, looking through all the - * tags in this tag library. - * - * @param shortname The short name (no prefix) of the tag - * @return the TagInfo for the tag with the specified short name, or - * null if no such tag is found - */ - - public TagInfo getTag(String shortname) { - TagInfo tags[] = getTags(); - - if (tags == null || tags.length == 0) { - return null; - } - - for (int i=0; i < tags.length; i++) { - if (tags[i].getTagName().equals(shortname)) { - return tags[i]; - } - } - return null; - } - - /** - * Get the TagFileInfo for a given tag name, looking through all the - * tag files in this tag library. - * - * @param shortname The short name (no prefix) of the tag - * @return the TagFileInfo for the specified Tag file, or null - * if no Tag file is found - * @since JSP 2.0 - */ - public TagFileInfo getTagFile(String shortname) { - TagFileInfo tagFiles[] = getTagFiles(); - - if (tagFiles == null || tagFiles.length == 0) { - return null; - } - - for (int i=0; i < tagFiles.length; i++) { - if (tagFiles[i].getName().equals(shortname)) { - return tagFiles[i]; - } - } - return null; - } - - /** - * An array describing the functions that are defined in this tag library. - * - * @return the functions defined in this tag library, or a zero - * length array if the tag library defines no functions. - * @since JSP 2.0 - */ - public FunctionInfo[] getFunctions() { - return functions; - } - - - /** - * Get the FunctionInfo for a given function name, looking through all the - * functions in this tag library. - * - * @param name The name (no prefix) of the function - * @return the FunctionInfo for the function with the given name, or null - * if no such function exists - * @since JSP 2.0 - */ - public FunctionInfo getFunction(String name) { - - if (functions == null || functions.length == 0) { - System.err.println("No functions"); - return null; - } - - for (int i=0; i < functions.length; i++) { - if (functions[i].getName().equals(name)) { - return functions[i]; - } - } - return null; - } - - - /** - * Returns an array of TagLibraryInfo objects representing the entire set - * of tag libraries (including this TagLibraryInfo) imported by taglib - * directives in the translation unit that references this - * TagLibraryInfo. - * - * If a tag library is imported more than once and bound to different - * prefices, only the TagLibraryInfo bound to the first prefix must be - * included in the returned array. - * - * @return Array of TagLibraryInfo objects representing the entire set - * of tag libraries (including this TagLibraryInfo) imported by taglib - * directives in the translation unit that references this TagLibraryInfo. - * - * @since JSP 2.1 - */ - public abstract TagLibraryInfo[] getTagLibraryInfos(); - - - // Protected fields - - /** - * The prefix assigned to this taglib from the taglib directive. - */ - protected String prefix; - - /** - * The value of the uri attribute from the taglib directive for - * this library. - */ - protected String uri; - - /** - * An array describing the tags that are defined in this tag library. - */ - protected TagInfo[] tags; - - /** - * An array describing the tag files that are defined in this tag library. - * - * @since JSP 2.0 - */ - protected TagFileInfo[] tagFiles; - - /** - * An array describing the functions that are defined in this tag library. - * - * @since JSP 2.0 - */ - protected FunctionInfo[] functions; - - // Tag Library Data - - /** - * The version of the tag library. - */ - protected String tlibversion; // required - - /** - * The version of the JSP specification this tag library is written to. - */ - protected String jspversion; // required - - /** - * The preferred short name (prefix) as indicated in the TLD. - */ - protected String shortname; // required - - /** - * The "reliable" URN indicated in the TLD. - */ - protected String urn; // required - - /** - * Information (documentation) for this TLD. - */ - protected String info; // optional -} diff --git a/api/src/main/java/javax/servlet/jsp/tagext/TagLibraryValidator.java b/api/src/main/java/javax/servlet/jsp/tagext/TagLibraryValidator.java deleted file mode 100644 index 7c4926d..0000000 --- a/api/src/main/java/javax/servlet/jsp/tagext/TagLibraryValidator.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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 2004 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package javax.servlet.jsp.tagext; - -import java.util.Map; - -/** - * Translation-time validator class for a JSP page. - * A validator operates on the XML view associated with the JSP page. - * - *- * The TLD file associates a TagLibraryValidator class and some init - * arguments with a tag library. - * - *
- * The JSP container is reponsible for locating an appropriate - * instance of the appropriate subclass by - * - *
- * A TagLibraryValidator instance - * may create auxiliary objects internally to perform - * the validation (e.g. an XSchema validator) and may reuse it for all - * the pages in a given translation run. - * - *
- * The JSP container is not guaranteed to serialize invocations of - * validate() method, and TagLibraryValidators should perform any - * synchronization they may require. - * - *
- * As of JSP 2.0, a JSP container must provide a jsp:id attribute to - * provide higher quality validation errors. - * The container will track the JSP pages - * as passed to the container, and will assign to each element - * a unique "id", which is passed as the value of the jsp:id - * attribute. Each XML element in the XML view available will - * be extended with this attribute. The TagLibraryValidator - * can then use the attribute in one or more ValidationMessage - * objects. The container then, in turn, can use these - * values to provide more precise information on the location - * of an error. - * - *
- * The actual prefix of the The TagSupport class is a utility class intended to be used as
- * the base class for new tag handlers. The TagSupport class
- * implements the Tag and IterationTag interfaces and adds additional
- * convenience methods including getter methods for the properties in
- * Tag. TagSupport has one static method that is included to
- * facilitate coordination among cooperating tags.
- *
- * Many tag handlers will extend TagSupport and only redefine a
- * few methods.
- */
-
-public class TagSupport implements IterationTag, Serializable {
-
- /**
- * Find the instance of a given class type that is closest to a given
- * instance.
- * This method uses the getParent method from the Tag
- * interface.
- * This method is used for coordination among cooperating tags.
- *
- *
- * The current version of the specification only provides one formal
- * way of indicating the observable type of a tag handler: its
- * tag handler implementation class, described in the tag-class
- * subelement of the tag element. This is extended in an
- * informal manner by allowing the tag library author to
- * indicate in the description subelement an observable type.
- * The type should be a subtype of the tag handler implementation
- * class or void.
- * This addititional constraint can be exploited by a
- * specialized container that knows about that specific tag library,
- * as in the case of the JSP standard tag library.
- *
- *
- * When a tag library author provides information on the
- * observable type of a tag handler, client programmatic code
- * should adhere to that constraint. Specifically, the Class
- * passed to findAncestorWithClass should be a subtype of the
- * observable type.
- *
- *
- * @param from The instance from where to start looking.
- * @param klass The subclass of Tag or interface to be matched
- * @return the nearest ancestor that implements the interface
- * or is an instance of the class specified
- */
-
- // The type for klass should be Class>. Unfortunately, fixing that is
- // a change in the API signature, which cannot be modified without a spec
- // change
- @SuppressWarnings("unchecked")
- public static final Tag findAncestorWithClass(Tag from, Class klass) {
- boolean isInterface = false;
-
- if (from == null ||
- klass == null ||
- (!Tag.class.isAssignableFrom(klass) &&
- !(isInterface = klass.isInterface()))) {
- return null;
- }
-
- for (;;) {
- Tag tag = from.getParent();
-
- if (tag == null) {
- return null;
- }
-
- if ((isInterface && klass.isInstance(tag)) ||
- klass.isAssignableFrom(tag.getClass()))
- return tag;
- else
- from = tag;
- }
- }
-
- /**
- * Default constructor, all subclasses are required to define only
- * a public constructor with the same signature, and to call the
- * superclass constructor.
- *
- * This constructor is called by the code generated by the JSP
- * translator.
- */
-
- public TagSupport() { }
-
- /**
- * Default processing of the start tag, returning SKIP_BODY.
- *
- * @return SKIP_BODY
- * @throws JspException if an error occurs while processing this tag
- *
- * @see Tag#doStartTag()
- */
-
- public int doStartTag() throws JspException {
- return SKIP_BODY;
- }
-
- /**
- * Default processing of the end tag returning EVAL_PAGE.
- *
- * @return EVAL_PAGE
- * @throws JspException if an error occurs while processing this tag
- *
- * @see Tag#doEndTag()
- */
-
- public int doEndTag() throws JspException {
- return EVAL_PAGE;
- }
-
-
- /**
- * Default processing for a body.
- *
- * @return SKIP_BODY
- * @throws JspException if an error occurs while processing this tag
- *
- * @see IterationTag#doAfterBody()
- */
-
- public int doAfterBody() throws JspException {
- return SKIP_BODY;
- }
-
- // Actions related to body evaluation
-
-
- /**
- * Release state.
- *
- * @see Tag#release()
- */
-
- public void release() {
- parent = null;
- id = null;
- if( values != null ) {
- values.clear();
- }
- values = null;
- }
-
- /**
- * Set the nesting tag of this tag.
- *
- * @param t The parent Tag.
- * @see Tag#setParent(Tag)
- */
-
- public void setParent(Tag t) {
- parent = t;
- }
-
- /**
- * The Tag instance most closely enclosing this tag instance.
- * @see Tag#getParent()
- *
- * @return the parent tag instance or null
- */
-
- public Tag getParent() {
- return parent;
- }
-
- /**
- * Set the id attribute for this tag.
- *
- * @param id The String for the id.
- */
-
- public void setId(String id) {
- this.id = id;
- }
-
- /**
- * The value of the id attribute of this tag; or null.
- *
- * @return the value of the id attribute, or null
- */
-
- public String getId() {
- return id;
- }
-
- /**
- * Set the page context.
- *
- * @param pageContext The PageContext.
- * @see Tag#setPageContext
- */
-
- public void setPageContext(PageContext pageContext) {
- this.pageContext = pageContext;
- }
-
- /**
- * Associate a value with a String key.
- *
- * @param k The key String.
- * @param o The value to associate.
- */
-
- public void setValue(String k, Object o) {
- if (values == null) {
- values = new Hashtable This interface provides two new methods: doCatch(Throwable)
- * and doFinally(). The prototypical invocation is as follows:
- *
- * This method is not invoked if the Throwable occurs during
- * one of the setter methods.
- *
- * This method may throw an exception (the same or a new one)
- * that will be propagated further up the nest chain. If an exception
- * is thrown, doFinally() will be invoked.
- *
- * This method is intended to be used to respond to an exceptional
- * condition.
- *
- * @param t The throwable exception navigating through this tag.
- * @throws Throwable if the exception is to be rethrown further up
- * the nest chain.
- */
-
- void doCatch(Throwable t) throws Throwable;
-
- /**
- * Invoked in all cases after doEndTag() for any class implementing
- * Tag, IterationTag or BodyTag. This method is invoked even if
- * an exception has occurred in the BODY of the tag,
- * or in any of the following methods:
- * Tag.doStartTag(), Tag.doEndTag(),
- * IterationTag.doAfterBody() and BodyTag.doInitBody().
- *
- * This method is not invoked if the Throwable occurs during
- * one of the setter methods.
- *
- * This method should not throw an Exception.
- *
- * This method is intended to maintain per-invocation data
- * integrity and resource management actions.
- */
-
- void doFinally();
-}
diff --git a/api/src/main/java/javax/servlet/jsp/tagext/ValidationMessage.java b/api/src/main/java/javax/servlet/jsp/tagext/ValidationMessage.java
deleted file mode 100644
index 4ca1bbb..0000000
--- a/api/src/main/java/javax/servlet/jsp/tagext/ValidationMessage.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp.tagext;
-
-
-/**
- * A validation message from either TagLibraryValidator or TagExtraInfo.
- *
- * As of JSP 2.0, a JSP container must support a jsp:id attribute
- * to provide higher quality validation errors.
- * The container will track the JSP pages
- * as passed to the container, and will assign to each element
- * a unique "id", which is passed as the value of the jsp:id
- * attribute. Each XML element in the XML view available will
- * be extended with this attribute. The TagLibraryValidator
- * can then use the attribute in one or more ValidationMessage
- * objects. The container then, in turn, can use these
- * values to provide more precise information on the location
- * of an error.
- *
- *
- * The actual prefix of the
- * Scripting variables generated by a custom action have an associated
- * scope of either AT_BEGIN, NESTED, or AT_END.
- *
- *
- * The class name (VariableInfo.getClassName) in the returned objects
- * is used to determine the types of the scripting variables.
- * Note that because scripting variables are assigned their values
- * from scoped attributes which cannot be of primitive types,
- * "boxed" types such as
- * The class name may be a Fully Qualified Class Name, or a short
- * class name.
- *
- *
- * If a Fully Qualified Class Name is provided, it should refer to a
- * class that should be in the CLASSPATH for the Web Application (see
- * Servlet 2.4 specification - essentially it is WEB-INF/lib and
- * WEB-INF/classes). Failure to be so will lead to a translation-time
- * error.
- *
- *
- * If a short class name is given in the VariableInfo objects, then
- * the class name must be that of a public class in the context of the
- * import directives of the page where the custom action appears.
- * The class must also be in the CLASSPATH for the Web Application
- * (see Servlet 2.4 specification - essentially it is WEB-INF/lib and
- * WEB-INF/classes). Failure to be so will lead to a translation-time
- * error.
- *
- * Usage Comments
- *
- * Frequently a fully qualified class name will refer to a class that
- * is known to the tag library and thus, delivered in the same JAR
- * file as the tag handlers. In most other remaining cases it will
- * refer to a class that is in the platform on which the JSP processor
- * is built (like Java EE). Using fully qualified class names in this
- * manner makes the usage relatively resistant to configuration
- * errors.
- *
- *
- * A short name is usually generated by the tag library based on some
- * attributes passed through from the custom action user (the author),
- * and it is thus less robust: for instance a missing import directive
- * in the referring JSP page will lead to an invalid short name class
- * and a translation error.
- *
- * Synchronization Protocol
- *
- *
- * The result of the invocation on getVariableInfo is an array of
- * VariableInfo objects. Each such object describes a scripting
- * variable by providing its name, its type, whether the variable is
- * new or not, and what its scope is. Scope is best described through
- * a picture:
- *
- *
- *
- * The JSP 2.0 specification defines the interpretation of 3 values:
- *
- * Variable Information in the TLD
- *
- * Scripting variable information can also be encoded directly for most cases
- * into the Tag Library Descriptor using the <variable> subelement of the
- * <tag> element. See the JSP specification.
- */
-
-public class VariableInfo {
-
- /**
- * Scope information that scripting variable is visible only within the
- * start/end tags.
- */
- public static final int NESTED = 0;
-
- /**
- * Scope information that scripting variable is visible after start tag.
- */
- public static final int AT_BEGIN = 1;
-
- /**
- * Scope information that scripting variable is visible after end tag.
- */
- public static final int AT_END = 2;
-
-
- /**
- * Constructor
- * These objects can be created (at translation time) by the TagExtraInfo
- * instances.
- *
- * @param varName The name of the scripting variable
- * @param className The type of this variable
- * @param declare If true, it is a new variable (in some languages this will
- * require a declaration)
- * @param scope Indication on the lexical scope of the variable
- */
-
- public VariableInfo(String varName,
- String className,
- boolean declare,
- int scope) {
- this.varName = varName;
- this.className = className;
- this.declare = declare;
- this.scope = scope;
- }
-
- // Accessor methods
-
- /**
- * Returns the name of the scripting variable.
- *
- * @return the name of the scripting variable
- */
- public String getVarName() {
- return varName;
- }
-
- /**
- * Returns the type of this variable.
- *
- * @return the type of this variable
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Returns whether this is a new variable.
- * If so, in some languages this will require a declaration.
- *
- * @return whether this is a new variable.
- */
- public boolean getDeclare() {
- return declare;
- }
-
- /**
- * Returns the lexical scope of the variable.
- *
- * @return the lexical scope of the variable, either AT_BEGIN, AT_END,
- * or NESTED.
- * @see #AT_BEGIN
- * @see #AT_END
- * @see #NESTED
- */
- public int getScope() {
- return scope;
- }
-
-
- // == private data
- private String varName;
- private String className;
- private boolean declare;
- private int scope;
-}
-
diff --git a/api/src/main/java/javax/servlet/jsp/tagext/doc-files/BodyTagProtocol.gif b/api/src/main/java/javax/servlet/jsp/tagext/doc-files/BodyTagProtocol.gif
deleted file mode 100644
index a61e82b..0000000
Binary files a/api/src/main/java/javax/servlet/jsp/tagext/doc-files/BodyTagProtocol.gif and /dev/null differ
diff --git a/api/src/main/java/javax/servlet/jsp/tagext/doc-files/IterationTagProtocol.gif b/api/src/main/java/javax/servlet/jsp/tagext/doc-files/IterationTagProtocol.gif
deleted file mode 100644
index c262341..0000000
Binary files a/api/src/main/java/javax/servlet/jsp/tagext/doc-files/IterationTagProtocol.gif and /dev/null differ
diff --git a/api/src/main/java/javax/servlet/jsp/tagext/doc-files/TagProtocol.gif b/api/src/main/java/javax/servlet/jsp/tagext/doc-files/TagProtocol.gif
deleted file mode 100644
index 9a1880e..0000000
Binary files a/api/src/main/java/javax/servlet/jsp/tagext/doc-files/TagProtocol.gif and /dev/null differ
diff --git a/api/src/main/java/javax/servlet/jsp/tagext/doc-files/VariableInfo-1.gif b/api/src/main/java/javax/servlet/jsp/tagext/doc-files/VariableInfo-1.gif
deleted file mode 100644
index 32eabeb..0000000
Binary files a/api/src/main/java/javax/servlet/jsp/tagext/doc-files/VariableInfo-1.gif and /dev/null differ
diff --git a/api/src/main/java/javax/servlet/jsp/tagext/package.html b/api/src/main/java/javax/servlet/jsp/tagext/package.html
deleted file mode 100644
index c149313..0000000
--- a/api/src/main/java/javax/servlet/jsp/tagext/package.html
+++ /dev/null
@@ -1,1460 +0,0 @@
-
-
-
-
- Custom actions can be used by JSP authors and authoring tools to
-simplify writing JSP pages. A custom action can be either an empty
-or a non-empty action.
-
-
-An empty tag has no body. There are two equivalent syntaxes, one
-with separate start and end tags, and one where the start and
-end tags are combined. The two following examples are identical:
-
-A non-empty tag has a start tag, a body, and an end tag. A
-prototypical example is of the form:
-
-The JavaServer Pages(tm) (JSP) specification provides a portable
-mechanism for the description of tag libraries.
-
-A JSP tag library contains
- This API is described in the following sections:
- JSP 2.0 introduces a new type of Tag Handler called a Simple
-Tag Handler, which is described in a later section.
-The protocol for Simple Tag handlers is much more straightforward.
-
- A tag handler is a run-time, container-managed object that
-evaluates custom actions during the execution of a JSP page. A tag
-handler supports a protocol that allows the JSP container to provide
-good integration of the server-side actions within a JSP page.
-
- A tag handler is created initially using a zero argument
-constructor on its corresponding class; the method
- A tag handler has some properties that are exposed to the page as
-attributes on an action; these properties are managed by the JSP
-container (via generated code). The setter methods used to set
-the properties are discovered using the JavaBeans introspector
-machinery.
-
- The protocol supported by a tag handler provides for passing of
-parameters, the evaluation and reevaluation of the body of the action,
-and for getting access to objects and other tag handlers in the
-JSP page.
-
- A tag handler instance is responsible for processing one request
-at a time. It is the responsability of the JSP container to enforce
-this.
-
- Additional translation time information associated with the action
-indicates the name of any scripting variables it may introduce, their
-types and their scope. At specific moments, the JSP container will
-automatically synchronize the {@link javax.servlet.jsp.PageContext}
- information with variables
-in the scripting language so they can be made available directly
-through the scripting elements.
-
-
- A tag handler has some properties. All tag handlers have a
-pageContext property for the JSP page where the tag is
-located, and a parent property for the tag handler to the
-closest enclosing action. Specific tag handler classes may have
-additional properties.
-
- All attributes of a custom action must be JavaBeans component
-properties, although some properties may not be exposed as attributes.
-The attributes that are visible to the JSP translator are exactly
-those listed in the Tag Library Descriptor (TLD).
-
- All properties of a tag handler instance exposed as attributes
-will be initialized by the container using the appropriate setter
-methods before the instance can be used to perform the action methods.
-It is the responsibility of the JSP container to invoke the
-appropriate setter methods to initialize these properties. It is the
-responsability of user code, be it scriptlets, JavaBeans code, or code
-inside custom tags, to not invoke these setter methods, as doing
-otherwise would interfere with the container knowledge.
-
- The setter methods that should be used when assigning a value to
-an attribute of a custom action are determined by using the JavaBeans
-introspector on the tag handler class, then use the setter method
-associated with the property that has the same name as the attribute
-in question. An implication (unclear in the JavaBeans specification)
-is that there is only one setter per property.
-
- Unspecified attributes/properties should not be set (using a
-setter method).
-
- Once properly set, all properties are expected to be persistent,
-so that if the JSP container ascertains that a property has already
-been set on a given tag handler instance, it must not set it
-again.
-
- The JSP container may reuse classic tag handler instances for multiple
-occurrences of the corresponding custom action, in the same page or in
-different pages, but only if the same set of attributes are used for all
-occurrences. If a tag handler is used for more than one occurence, the
-container must reset all attributes where the values differ between the
-custom action occurrences. Attributes with the same value in all
-occurrences must not be reset. If an attribute value is set as a
-request-time attribute value (using a scripting or an EL expression),
-the container must reset the attribute between all reuses of the tag
-handler instance. To prevent confusion, a tag handler with an empty body
-must not reuse any previous tag handler with a non-empty body.
-
- User code can access property information and access and modify
-tag handler internal state starting with the first action method (doStartTag)
-up until the last action method (doEndTag or doFinally for tag handlers
-implementing TryCatchFinally).
-
-
- Since a tag handler is a container managed object, the container
-needs to maintain its references; specifically, user code should not
-keep references to a tag handler except between the start of the first
-action method (doStartTag()) and the end of the last action method
-(doEndTag() or doFinally() for those tags that implement TryCatchFinally).
-
- The restrictions on references to tag handler objects and
-on modifying attribute properties gives the JSP container substantial
-freedom in effectively managing tag handler objects to achieve different
-goals. For example, a container may implementing different pooling strategies
-to minimize creation cost, or may hoist setting of properties to reduce
-cost when a tag handler is inside another iterative tag.
-
-
- A tag handler implements an action; the JSP container must follow
-the type conversions described in Section 2.13.2 when assigning values
-to the attributes of an action.
-
-
-A non-empty action has a body.
-
-
- A Tag handler that does not want to process its body can implement
-just the Tag interface. A tag handler may not want to process its
-body because it is an empty tag or because the body is just to
-be "passed through".
-
- The Tag interface includes methods to provide page context
-information to the Tag Handler instance, methods to handle the
-life-cycle of tag handlers, and two main methods for performing
-actions on a tag: If an exception is encountered during the evaluation of the
-body of a tag, its doEndTag method will not be evaluated. See the
-TryCatchFinally tag for methods that are guaranteed to be evaluated.
-
-
- The IterationTag interface is used to repeatedly reevaluate
-the body of a custom action. The interface has one method:
- Reevaluation is requested with the value 2, which in JSP 1.1 is
-defined to be BodyTag.EVAL_BODY_TAG. That constant value is still
-kept in JSP 1.2 (for full backwards compatibility) but, to improve
-clarity, a new name is also available: IterationTag.EVAL_BODY_AGAIN.
-To stop iterating, the returned value should be 0, which is
-Tag.SKIP_BODY.
-
- The TagSupport class is a base class that can be used when
-implementing the Tag or IterationTag interfaces.
-
-
-
- The evaluation of a body is delivered into a If a Tag handler wants to have access to the content of its body
-then it must implement the A BodyContent is a subclass of The JSP page implementation will create a BodyContent if the
-doStartTag() method returns a EVAL_BODY_BUFFERED. This object will be
-passed to doInitBody(); then the body of the tag will be evaluated,
-and during that evaluation out will be bound to the
-BodyContent just passed to the BodyTag handler. Then
-doAfterBody() will be evaluated. If that method returns SKIP_BODY, no
-more evaluations of the body will be done; if the method returns
-EVAL_BODY_AGAIN, then the body will be evaluated, and doAfterBody() will
-be invoked again.
-
- The content of a BodyContent instance remains available until after
-the invocation of its associated doEndTag() method.
-
- A common use of the BodyContent is to extract its contents into a
-String and then use the String as a value for some operation. Another
-common use is to take its contents and push it into the out Stream
-that was valid when the start tag was encountered (that is available
-from the PageContext object passed to the handler in setPageContext).
-
-
-
- Any tag handler can optionally extend the The TLD is what ultimately determines whether a tag handler accepts
-dynamic attributes or not. If a tag handler declares that it supports
-dynamic attributes in the TLD but it does not implement the
- If the dynamic-attributes element for a tag being invoked contains
-the value "true", the following requirements apply: In the following example, assume attributes a and b are declared
-using the attribute element in the TLD, attributes d1 and d2 are not
-declared, and the dynamic-attributes element is set to "true".
-The attributes are set using the calls:
- In this example, we are assuming that
-x:iterate is an iterative tag, while x:doit and x:foobar are simple
-tag. We will also assume that x:iterate and x:foobar implement the
-TryCatchFinally interface, while x:doit does not.
-
- The particular code shown below assumes there is some pool of tag
-handlers that are managed (details not described, although pool
-managing is simpler when there are no optional attributes), and
-attemps to reuse tag handlers if possible. The code also "hoists"
-setting of properties to reduce the cost when appropriate, e.g. inside
-an iteration.
-
-
-
-Often two actions in a JSP page will want to cooperate,
-perhaps by one action creating some server-side object that
-needs to be accessed by another.
-One mechanism for doing this is by giving the object a name
-within the JSP page; the first action will create the object
-and associate the name to it while the second action
-will use the name to retrieve the object.
-
-
-For example, in the following JSP segment the
-
-In a JSP implementation, the mapping "name"->value is kept by the
-implicit object
-
-
-An alternative to explicit communication of information through
-a named object is implicit coordination based on syntactic scoping.
-
-
-For example, in the following JSP segment the
-This functionality is supported through the
- This section presents the API to implement Simple Tag Handlers.
-Simple Tag Handlers present a much simpler invocation
-protocol than do Classic Tag Handlers. The Tag Library Descriptor maps tag library declarations to their
-physical underlying implementations. A Simple Tag Handler is
-represented in Java by a class which implements the
- Unlike classic tag handlers, the To support body content, the This section describes the lifecycle of simple tag handlers, from
-creation to invocation. For all semantics left unspecified by this
-section, the semantics default to that of a classic tag handler. When a simple tag handler is invoked, the following steps occur
-(in order): JSP Fragments are represented in Java by an instance of the
- Before being passed to a tag handler, the The The implementation of each method can optionally throw a
- The following sections specify the creation and invocation
-lifecycles of a JSP Fragment in detail, from the JSP Container's
-perspective. When a JSP fragment is created, the following steps occur (in order):
-
- After a JSP fragment is created, it is passed to a tag handler for
-later invocation. JSP fragments can be invoked either programmatically
-from a tag handler written in Java, or from a tag file using the
-<jsp:invoke> or <jsp:doBody> standard action. JSP fragments are passed to tag handlers using a bean property
-of type The following steps are followed when invoking a JSP fragment: The following non-normative example is intended to help solidify
-some of the concepts relating to Tag Files, JSP Fragments and Simple
-Tag Handlers. In the first section, two sample input files are
-presented, a JSP (my.jsp), and a simple tag handler implemented using
-a tag file (simpletag.tag). One possible output of the translation
-process is presented in the second section. Although short, the example shows all concepts, including
-the variable directive. In practice most uses of tags will be much simpler,
-but probably longer. The sample generated code is annotated with comments that point
-to lifecycle steps presented in various sections. The notation is as
-follows: This section presents the sample source files in this scenario,
-from which the output files are generated. This section presents sample output files that might be generated
-by a JSP compiler, from the source files presented in the
-previous section. A taglib directive introduces a tag library and associates a
-prefix to it. The TLD associated with the library associates Tag
-handler classes (plus other information) with tag names. This
-information is used to associate a Tag class, a prefix, and a name
-with each custom action element appearing in a JSP page.
-
- At execution time the implementation of a JSP page will use an
-available Tag instance with the appropriate property settings and then
-follow the protocol described by the interfaces Tag, IterationTag,
-BodyTag, SimpleTag, and TryCatchFinally. The implementation guarantees
-that all tag handler instances are initialized and all are released,
-but the implementation can assume that previous settings are preserved
-by a tag handler, to reduce run-time costs.
-
-
- JSP supports scripting variables that can be declared within a
-scriptlet and can be used in another. JSP actions also can be used to
-define scripting variables so they can used in scripting elements, or
-in other actions. This is very useful in some cases; for example, the
- In some cases the information on scripting variables can be
-described directly into the TLD using elements. A special case is typical
-interpretation of the "id" attribute.
-In other cases the logic that decides whether an action instance
-will define a scripting variable may be quite complex and the name of
-a The TLD file contains several pieces of information that is used
-to do syntactic validation at translation-time. It also contains two
-extensible validation mechanisms: a The TagLibraryValidator is an addition to the JSP 1.2
-specification and is very open ended, being strictly more powerful
-than the TagExtraInfo mechanism. A JSP page is presented via the
- A PageData instance will provides an InputStream (read-only) on the
-page. Later specifications may add other views on the page (DOM, SAX,
-JDOM are all candidates), for now these views can be generated from
-the InputStream and perhaps can be cached for improved performance
-(recall the view of the page is just read-only).
-
- As of JSP 2.0, the JSP container must support a jsp:id attribute to
-provide higher quality validation errors. The
-container will track the JSP pages as passed to the container, and
-will assign to each element a unique "id", which is passed as the
-value of the jsp:id attribute. Each XML element in the XML view
-will be extended with this attribute. The
-TagLibraryValidator can use the attribute in one or more
-ValidationMessage objects. The container then, in turn, can use these
-values to provide more precise information on the location of an
-error.
-
- The prefix for the In detail, validation is done as follows:
-
- First, the JSP page is parsed using the information in the TLD.
-At this stage valid mandatory and optional attributes are checked.
-
- Second, for each unique tag library in the page as determined
-by the tag library URI, and in the lexical order in which they appear,
-their associated validator class (if any) is invoked. This involves
-several substeps.
-
- The first substep is to obtain an initialized validator instance by
-either:
-
- The class name is as indicated in the <validator-class> element,
-and the Map passed through setInitParameters() is as described in the
-<init-params> element.
-All TagLibraryValidator classes are supposed to keep their initParameters
-until new ones are set, or until release() is invoked on them.
-
- The second substep is to perform the actual validation. This is done
-by invoking the validate() method with a prefix, uri, and PageData that
-correspond to the taglib directive instance being validated and the
-PageData representing the page. In the case where a single URI is mapped
-to more than one prefix, the prefix of the first URI must be used.
-
- The last substep is to invoke the release() method on the validator tag
-when it is no longer needed. This method releases all resources.
-
- Finally, after checking all the tag library validator classes, the
-TagExtraInfo classes for all tags will be consulted by invoking their
-
-LIMITED LICENSE GRANTS
-
-2. License for the Distribution of Compliant Implementations.
-Specification Lead also grants you a perpetual, non-exclusive,
-non-transferable, worldwide, fully paid-up, royalty free, limited
-license (without the right to sublicense) under any applicable
-copyrights or, subject to the provisions of subsection 4 below, patent
-rights it may have covering the Specification to create and/or
-distribute an Independent Implementation of the Specification that: (a)
-fully implements the Specification including all its required
-interfaces and functionality; (b) does not modify, subset, superset or
-otherwise extend the Licensor Name Space, or include any public or
-protected packages, classes, Java interfaces, fields or methods within
-the Licensor Name Space other than those required/authorized by the
-Specification or Specifications being implemented; and (c) passes the
-Technology Compatibility Kit (including satisfying the requirements of
-the applicable TCK Users Guide) for such Specification ("Compliant
-Implementation"). In addition, the foregoing license is expressly
-conditioned on your not acting outside its scope. No license is
-granted hereunder for any other purpose (including, for example,
-modifying the Specification, other than to the extent of your fair use
-rights, or distributing the Specification to third parties). Also, no
-right, title, or interest in or to any trademarks, service marks, or
-trade names of Specification Lead or Specification Lead's licensors is
-granted hereunder. Java, and Java-related logos, marks and names are
-trademarks or registered trademarks of Oracle America, Inc. in the U.S.
-and other countries.
-
-3. Pass-through Conditions. You need not include limitations (a)-(c)
-from the previous paragraph or any other particular "pass through"
-requirements in any license You grant concerning the use of your
-Independent Implementation or products derived from it. However,
-except with respect to Independent Implementations (and products
-derived from them) that satisfy limitations (a)-(c) from the previous
-paragraph, You may neither: (a) grant or otherwise pass through to
-your licensees any licenses under Specification Lead's applicable
-intellectual property rights; nor (b) authorize your licensees to make
-any claims concerning their implementation's compliance with the
-Specification in question.
-
-4. Reciprocity Concerning Patent Licenses.
-
-5. Definitions. For the purposes of this Agreement: "Independent
-Implementation" shall mean an implementation of the Specification that
-neither derives from any of Specification Lead's source code or binary
-code materials nor, except with an appropriate and separate license
-from Specification Lead, includes any of Specification Lead's source
-code or binary code materials; "Licensor Name Space" shall mean the
-public class or interface declarations whose names begin with "java",
-"javax", "com.sun" and "com.oracle" or their equivalents in any
-subsequent naming convention adopted by Oracle America, Inc. through
-the Java Community Process, or any recognized successors or
-replacements thereof; and "Technology Compatibility Kit" or "TCK" shall
-mean the test suite and accompanying TCK User's Guide provided by
-Specification Lead which corresponds to the Specification and that was
-available either (i) from Specification Lead's 120 days before the
-first release of Your Independent Implementation that allows its use
-for commercial purposes, or (ii) more recently than 120 days from such
-release but against which You elect to test Your implementation of the
-Specification.
-
-This Agreement will terminate immediately without notice from
-Specification Lead if you breach the Agreement or act outside the scope
-of the licenses granted above.
-
-DISCLAIMER OF WARRANTIES
-
-LIMITATION OF LIABILITY
-
-RESTRICTED RIGHTS LEGEND
-
-REPORT
-
-GENERAL TERMS
-
-The Specification is subject to U.S. export control laws and may be
-subject to export or import regulations in other countries. Licensee
-agrees to comply strictly with all such laws and regulations and
-acknowledges that it has the responsibility to obtain such licenses to
-export, re-export or import as may be required after delivery to
-Licensee.
-
-This Agreement is the parties' entire agreement relating to its subject
-matter. It supersedes all prior or contemporaneous oral or written
-communications, proposals, conditions, representations and warranties
-and prevails over any conflicting or additional terms of any quote,
-order, acknowledgment, or other communication between the parties
-relating to its subject matter during the term of this Agreement. No
-modification to this Agreement will be binding, unless in writing and
-signed by an authorized representative of each party.
- Each file is interpreted relative to uriroot, unless it is absolute,
- * in which case it must start with uriroot.
- *
- * @param jspFiles Comma-separated list of JSP files to be processed
- */
- public void setJspFiles(String jspFiles) {
- StringTokenizer tok = new StringTokenizer(jspFiles, " ,");
- while (tok.hasMoreTokens()) {
- pages.add(tok.nextToken());
- }
- }
-
- public void setCompile( boolean b ) {
- compile=b;
- }
-
- public void setVerbose( int level ) {
- if (level > 0) {
- verbose = true;
- showSuccess = true;
- listErrors = true;
- }
- }
-
- public void setValidateXml( boolean b ) {
- /* SJSAS 6384538
- org.apache.jasper.xmlparser.ParserUtils.validating=b;
- */
- // START SJSAS 6384538
- setIsValidationEnabled(b);
- // END SJSAS 6384538
- }
-
- // START SJSAS 6384538
- public void setIsValidationEnabled(boolean b) {
- isValidationEnabled = b;
- }
-
- public boolean isValidationEnabled() {
- return isValidationEnabled;
- }
- // END SJSAS 6384538
-
- public void setListErrors( boolean b ) {
- listErrors = b;
- }
-
- public void setOutputDir( String s ) {
- if( s!= null ) {
- scratchDir = new File(s).getAbsoluteFile();
- } else {
- scratchDir=null;
- }
- }
-
- public void setPackage( String p ) {
- targetPackage=p;
- }
-
- /**
- * Class name of the generated file ( without package ).
- * Can only be used if a single file is converted.
- * XXX Do we need this feature ?
- */
- public void setClassName( String p ) {
- targetClassName=p;
- }
-
- /**
- * File where we generate a web.xml fragment with the class definitions.
- */
- public void setWebXmlFragment( String s ) {
- webxmlFile=s;
- webxmlLevel=INC_WEBXML;
- }
-
- /**
- * File where we generate a complete web.xml with the class definitions.
- */
- public void setWebXml( String s ) {
- webxmlFile=s;
- webxmlLevel=ALL_WEBXML;
- }
-
- public void setAddWebXmlMappings(boolean b) {
- addWebXmlMappings = b;
- }
-
- /**
- * Set the option that throws an exception in case of a compilation
- * error.
- */
- public void setFailOnError(final boolean b) {
- failOnError = b;
- }
-
- public boolean getFailOnError() {
- return failOnError;
- }
-
- // START SJSAS 6393940
- public void setIgnoreJspFragmentErrors(boolean ignore) {
- ignoreJspFragmentErrors = ignore;
- }
- // END SJSAS 6393940
-
- /**
- * Obtain JSP configuration informantion specified in web.xml.
- */
- public JspConfig getJspConfig() {
- return jspConfig;
- }
-
- public TagPluginManager getTagPluginManager() {
- return tagPluginManager;
- }
-
- public void generateWebMapping( String file, JspCompilationContext clctxt )
- throws IOException
- {
- String className = clctxt.getServletClassName();
- String packageName = clctxt.getServletPackageName();
-
- String thisServletName;
- if ("".equals(packageName)) {
- thisServletName = className;
- } else {
- thisServletName = packageName + '.' + className;
- }
-
- if (servletout != null) {
- servletout.write("\n
- * If parent is null, simply returns.
- */
- private void prepareParams(Node parent) throws JasperException {
- if (parent == null)
- return;
-
- Node.Nodes subelements = parent.getBody();
- if (subelements != null) {
- for (int i = 0; i < subelements.size(); i++) {
- Node n = subelements.getNode(i);
- if (n instanceof Node.ParamAction) {
- Node.Nodes paramSubElements = n.getBody();
- for (int j = 0;
- (paramSubElements != null)
- && (j < paramSubElements.size());
- j++) {
- Node m = paramSubElements.getNode(j);
- if (m instanceof Node.NamedAttribute) {
- generateNamedAttributeValue(
- (Node.NamedAttribute)m);
- }
- }
- }
- }
- }
- }
-
- /**
- * Finds the id attribute may or may not be
- * jsp but it will always map to the namespace
- * http://java.sun.com/JSP/Page. A TagLibraryValidator
- * implementation must rely on the uri, not the prefix, of the id
- * attribute.
- */
-
-abstract public class TagLibraryValidator {
-
- /**
- * Sole constructor. (For invocation by subclass constructors,
- * typically implicit.)
- */
- public TagLibraryValidator() {
- }
-
- /**
- * Set the init data in the TLD for this validator.
- * Parameter names are keys, and parameter values are the values.
- *
- * @param map A Map describing the init parameters
- */
- public void setInitParameters(Map
- * h = get a Tag(); // get a tag handler, perhaps from pool
- *
- * h.setPageContext(pc); // initialize as desired
- * h.setParent(null);
- * h.setFoo("foo");
- *
- * // tag invocation protocol; see Tag.java
- * try {
- * doStartTag()...
- * ....
- * doEndTag()...
- * } catch (Throwable t) {
- * // react to exceptional condition
- * h.doCatch(t);
- * } finally {
- * // restore data invariants and release per-invocation resources
- * h.doFinally();
- * }
- *
- * ... other invocations perhaps with some new setters
- * ...
- * h.release(); // release long-term resources
- *
- */
-
-public interface TryCatchFinally {
-
- /**
- * Invoked if a Throwable occurs while evaluating the BODY
- * inside a tag or in any of the following methods:
- * Tag.doStartTag(), Tag.doEndTag(),
- * IterationTag.doAfterBody() and BodyTag.doInitBody().
- *
- * id attribute may or may not be
- * jsp but it will always map to the namespace
- * http://java.sun.com/JSP/Page. A TagLibraryValidator
- * implementation must rely on the uri, not the prefix, of the id
- * attribute.
- */
-
-public class ValidationMessage {
-
- /**
- * Create a ValidationMessage. The message String should be
- * non-null. The value of id may be null, if the message
- * is not specific to any XML element, or if no jsp:id
- * attributes were passed on. If non-null, the value of
- * id must be the value of a jsp:id attribute for the PageData
- * passed into the validate() method.
- *
- * @param id Either null, or the value of a jsp:id attribute.
- * @param message A localized validation message.
- */
- public ValidationMessage(String id, String message) {
- this.id = id;
- this.message = message;
- }
-
-
- /**
- * Get the jsp:id.
- * Null means that there is no information available.
- *
- * @return The jsp:id information.
- */
- public String getId() {
- return id;
- }
-
- /**
- * Get the localized validation message.
- *
- * @return A validation message
- */
- public String getMessage(){
- return message;
- }
-
- // Private data
- private String id;
- private String message;
-}
diff --git a/api/src/main/java/javax/servlet/jsp/tagext/VariableInfo.java b/api/src/main/java/javax/servlet/jsp/tagext/VariableInfo.java
deleted file mode 100644
index dcb7720..0000000
--- a/api/src/main/java/javax/servlet/jsp/tagext/VariableInfo.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package javax.servlet.jsp.tagext;
-
-/**
- * Information on the scripting variables that are created/modified by
- * a tag (at run-time). This information is provided by TagExtraInfo
- * classes and it is used by the translation phase of JSP.
- *
- * java.lang.Integer must
- * be used instead of primitives.
- *
- *
- *
- *
- *
- *
- * The scope value for a variable implies what methods may affect its
- * value and thus where synchronization is needed as illustrated by
- * the table below. Note: the synchronization of the variable(s)
- * will occur after the respective method has been called.
- *
- *
- *
- *
- *
- *
- * 1 Called after
- *
- * Variable Synchronization
- * Points
- *
- *
- *
- *
- * doStartTag()
- * doInitBody()
- * doAfterBody()
- * doEndTag()
- * doTag()
- *
- *
- * Tag
- *
- * AT_BEGIN, NESTED
- *
- *
- *
- *
- *
- * AT_BEGIN, AT_END
- *
- *
- *
- *
- *
- * IterationTag
- *
- * AT_BEGIN, NESTED
- *
- *
- *
- * AT_BEGIN, NESTED
- *
- * AT_BEGIN, AT_END
- *
- *
- *
- *
- *
- * BodyTag
- *
- * AT_BEGIN, NESTED1
- *
- * AT_BEGIN, NESTED1
- *
- * AT_BEGIN, NESTED
- *
- * AT_BEGIN, AT_END
- *
- *
- *
- *
- *
- * SimpleTag
- *
- *
- *
- *
- *
- *
- *
- *
- *
- * AT_BEGIN, AT_END
- *
- * doStartTag() if
- * EVAL_BODY_INCLUDE is returned, or after
- * doInitBody() otherwise.
- *
-
-
-
-
-
-<x:foo att="myObject"></foo>
-<x:foo att="myObject"/>
-
-
-
-
-
-
-
-
-<x:foo att="myObject" >
- BODY
-</x:foo/>
-
-
-
-
-
-
-
-
-1. Classic Tag Handlers
-
-This section introduces the notion of a tag handler and describes the
-classic types of tag handler.
-
-Tag Handler
-
-java.beans.Beans.instantiate() is not used.
-
-Properties
-
-
-Tag Handler as a Container-Managed Object
-
-Conversions
-
-Empty and Non-Empty Actions
-
-An empty action has no body; it may use one of two syntaxes: either
-<foo/> or <foo></foo>. Since empty actions have no
-body the methods related to body manipulation are not invoked.
-There is a mechanism in the Tag Library Descriptor to indicate
-that a tag can only be used to write empty actions; when used,
-non-empty actions using that tag will produce a translation error.
-
-The Tag Interface
-
-
-doStartTag() and
-doEndTag(). The method doStartTag() is
-invoked when encountering the start tag and its return value indicates
-whether the body (if there is any) should be skipped, or evaluated and
-passed through to the current response stream. The method
-doEndTag() is invoked when encountering the end tag; its
-return value indicates whether the rest of the page should continue to
-be evaluated or not.
-
-The IterationTag Interface
-
-
-doAfterBody() which is invoked after each evaluation
-of the body to determine whether to reevaluate or not.
-
-The JspIdConsumer Interface
-This interface indicates to the container that a tag handler wishes
-to be provided with a compiler generated ID that is unique
-within the page.
-
-The TagSupport Base Class
-
-2. Tag Handlers that want Access to their Body Content
-
-
-BodyContent
-object. This is then made available to tag handlers that implement
-the BodyTag interface. The BodyTagSupport
-class provides a useful base class to simplify writing these handlers.
-
-
-BodyTag interface.
-
-This interface extends IterationTag, provides two additional methods
-setBodyContent(BodyContent) and
-doInitBody()
-and refers to an object of type BodyContent.
-
-JspWriter that has a
-few additional methods to convert its contents into a String, insert
-the contents into another JspWriter, to get a Reader into its
-contents, and to clear the contents. Its semantics also assure that
-buffer size will never be exceeded.
-
-3. Dynamic Attributes
-
-
-DynamicAttributes
-interface to indicate that it supports dynamic attributes. In addition
-to implementing the DynamicAttributes interface, tag
-handlers that support dynamic attributes must declare that they do so in
-the Tag Library Descriptor.DynamicAttributes interface, the tag handler must be
-considered invalid by the container.
-
-
-setDynamicAttribute(),
- passing in the namespace of the attribute (or null if the attribute
- does not have a namespace or prefix), the name of the attribute without
- the namespace prefix, and the final value of the attribute.java.lang.Object. If a ValueExpression
- is passed as a dynamic attribute, the default value for the expected
- return type is assumed to be java.lang.Object. If a
- MethodExpression is passed as a dynamic
- attribute, the default method signature is assumed to be void
- method().setDynamicAttribute() method throws
- JspException, the doStartTag() or
- doTag() method is not invoked for this tag, and the
- exception must be treated in the same manner as if it came from
- a regular attribute setter method.
-
-
-setA( "1" ), setDynamicAttribute( null, "d1", "2" ), setDynamicAttribute( "http://www.foo.com/jsp/taglib/mytag.tld", "d2", "3" ), setB( "4" ), setDynamicAttribute( null, "d3", "5" ), andsetDynamicAttribute( "http://www.foo.com/jsp/taglib/mytag.tld", "d4", "6" ).
-<jsp:root xmlns:mytag="http://www.foo.com/jsp/taglib/mytag.tld" version="2.0">
- <mytag:invokeDynamic a="1" d1="2" mytag:d2="3">
- <jsp:attribute name="b">4</jsp:attribute>
- <jsp:attribute name="d3">5</jsp:attribute>
- <jsp:attribute name="mytag:d4">6</jsp:attribute>
- </mytag:invokeDynamic>
-</jsp:root>
-
-
-
-4. Annotated Tag Handler Management Example
-
-
-Below is a somewhat complete example of the way one JSP container
-could choose to do some tag handler management. There are many
-other strategies that could be followed, with different pay offs.
-
-
-<x:iterate src="foo">
- <x:doit att1="one" att2="<%= 1 + 1 %>" />
- <x:foobar />
- <x:doit att1="one" att2="<%= 2 + 2 %>" />
-</x:iterate>
-<x:doit att1="one" att2="<%= 3 + 3 %>" />
-
-
-
-
-boolean b1, b2;
-IterationTag i; // for x:iterate
-Tag d; // for x:doit
-Tag d; // for x:foobar
-
-page: // label to end of page...
-
-
-// initialize iteration tag
-i = get tag from pool or new();
-
-i.setPageContext(pc);
-i.setParent(null);
-i.setSrc("foo");
-
-// x:iterate implements TryCatchFinally
-try {
- if ((b1 = i.doStartTag()) == EVAL_BODY_INCLUDE) {
-
- // initialize doit tag
- // code has been moved out of the loop for show
- d = get tag from pool or new();
-
- d.setPageContext(pc);
- d.setParent(i);
- d.setAtt1("one");
-
- loop:
- while (1) do {
- // I'm ignoring newlines...
-
- // two invocations, fused together
-
- // first invocation of x:doit
- d.setAtt2(1+1);
- if ((b2 = d.doStartTag()) == EVAL_BODY_INCLUDE) {
- // nothing
- } else if (b2 != SKIP_BODY) {
- // Q? protocol error ...
- }
- if ((b2 = d.doEndTag()) == SKIP_PAGE) {
- break page; // be done with it.
- } else if (b2 != EVAL_PAGE) {
- // Q? protocol error
- }
-
- // x:foobar invocation
- f = get tag from pool or new();
- f.setPageContext(pc);
- f.setParent(i);
-
- // x:foobar implements TryCatchFinally
- try {
-
- if ((b2 = f.doStartTag()) == EVAL_BODY_INCLUDE) {
- // nothing
- } else if (b2 != SKIP_BODY) {
- // Q? protocol error
- }
- if ((b2 = f.doEndTag()) == SKIP_PAGE) {
- break page; // be done with it.
- } else if (b2 != EVAL_PAGE) {
- // Q? protocol error
- }
- } catch (Throwable t) {
- f.doCatch(t); // caught, may been rethrown!
- } finally {
- f.doFinally();
- }
-
- // put f back to pool
-
- // second invocation of x:doit
- d.setAtt2(2+2);
- if ((b2 = d.doStartTag()) == EVAL_BODY_INCLUDE) {
- // nothing
- } else if (b2 != SKIP_BODY) {
- // Q? protocol error
- }
- if ((b2 = d.doEndTag()) == SKIP_PAGE) {
- break page; // be done with it.
- } else if (b2 != EVAL_PAGE) {
- // Q? protocol error
- }
-
- if ((b2 = i.doAfterBody()) == EVAL_BODY_AGAIN) {
- break loop;
- } else if (b2 != SKIP_BODY) {
- // Q? protocol error
- }
- // loop
- }
-
- } else if (b1 != SKIP_BODY) {
- // Q? protocol error
- }
-
- // tail end of the IteratorTag ...
-
- if ((b1 = i.doEndTag()) == SKIP_PAGE) {
- break page; // be done with it.
- } else if (b1 != EVAL_PAGE) {
- // Q? protocol error
- }
-
- // third invocation
- // this tag handler could be reused from the previous ones.
- d = get tag from pool or new();
-
- d.setPageContext(pc);
- d.setParent(null);
- d.setAtt1("one");
- d.setAtt2(3+3);
-
- if ((b1 = d.doStartTag()) == EVAL_BODY_INCLUDE) {
- // nothing
- } else if (b1 != SKIP_BODY) {
- // Q? protocol error
- }
- if ((b1 = d.doEndTag()) == SKIP_PAGE) {
- break page; // be done with it.
- } else if (b1 != EVAL_PAGE) {
- // Q? protocol error
- }
-
-} catch (Throwable t) {
- i.doCatch(t); // caught, may been rethrown!
-} finally {
- i.doFinally();
-}
-
-
-
-5. Cooperating Actions
-
-
-Actions can cooperate with other actions and with scripting code
-in a number of ways.
-
-PageContext
-foo
-action might create a server-side object and give it the
-name "myObject".
-Then the bar
-action might access that server-side object and take some action.
-
-
-
-
-
-
-
-<x:foo id="myObject" />
-<x:bar ref="myObjet" />
-
-pageContext.
-
-This object is passed around through the Tag handler instances
-so it can be used to communicate information: all it is needed
-is to know the name under which the information is stored into
-the pageContext.
-
-The Runtime Stack
-foo
-action might create a server-side object;
-later the nested bar action might access that server-side object.
-The object is not named within the pageContext:
-it is found because the specific foo element is the
-closest enclosing instance of a known element type.
-
-
-
-
-
-
-
-<foo>
- <bar/>
-</foo>
-
-TagSupport.findAncestorWithClass(Tag, Class),
-which uses a reference to parent tag kept by each Tag instance,
-which effectively provides a run-time execution stack.
-
-
-6. Simple Tag Handlers
-
-
-SimpleTag interface.SimpleTag interface does not
-extend Tag. Instead of supporting doStartTag() and
-doEndTag(), the SimpleTag interface provides
-a simple doTag() method, which is called once and only once
-for any given tag invocation. All tag logic, iteration, body
-evaluations, etc. are to be performed in this single method. Thus,
-simple tag handlers have the equivalent power of BodyTag,
-but with a much simpler lifecycle and interface.setJspBody()
-method is provided. The container invokes the setJspBody()
-method with a JspFragment object encapsulating the body
-of the tag. The tag handler implementation can call
-invoke() on that fragment to evaluate the body. The
-SimpleTagSupport convenience class provides
-getJspBody() and other useful methods to make this even
-easier.Lifecycle of Simple Tag Handlers
-
-
-
-
-setJspContext() and setParent()
- methods are invoked on the tag handler. The setParent()
- method need not be called if the value being passed in is
- null. In the case of tag files, a JspContext
- wrapper is created so that the tag file can appear to have its own page
- scope. Calling getJspContext() must return the wrapped
- JspContext.setDynamicAttribute()
- method is invoked as the setter.
-
-
- setDynamicAttribute()
- method is invoked as the setter.
-
-
- JspFragment, the container evaluates the body of
- the <jsp:attribute> element. This evaluation can be done
- in a container-specific manner. Container implementors should
- note that in the process of evaluating this body, other custom
- actions may be invoked.JspFragment,
- an instance of a JspFragment object is created and
- passed in.setJspBody() method is called on the
- tag handler.
-
-
- body-content
- of "empty" or no body or an empty body is passed
- for this invocation, then setJspBody() is not
- called.JspFragment object is created as per the lifecycle
- described in the JSP Fragments section and it is passed to the
- setter. If the tag is declared to have a body-content
- of "tagdependent" the JspFragment must
- echo the body's contents verbatim. Otherwise, if the tag is
- declared to have a body-content of type
- "scriptless", the JspFragment must
- evaluate the body's contents as a JSP scriptless body.doTag() method is invoked.doTag() performs its
- function, potentially calling other tag handlers (if the tag
- handler is implemented as a tag file) and invoking fragments.doTag() method returns, and the tag handler
- instance is discarded. If SkipPageException is thrown,
- the rest of the page is not evaluated and the request is completed.
- If this request was forwarded or included from another page (or Servlet),
- only the current page evaluation stops.AT_BEGIN or AT_END, the appropriate
- scripting variables and scoped attributes are declared, as with
- classic tag handlers.7. JSP Fragments
-
-
-javax.servlet.jsp.tagext.JspFragment abstract class.
-Pieces of JSP code are translated into JSP fragments in the context
-of a tag invocation. JSP Fragments are created when providing the body of a
-<jsp:attribute> standard action for an attribute that is defined
-as a fragment or of type JspFragment, or when providing the body of a
-tag invocation handled by a Simple Tag Handler.JspFragment
-instance is associated with the JspContext of the
-surrounding page in an implementation-dependent manner. In addition,
-
-it is associated with the parent Tag or SimpleTag
-instance for collaboration purposes, so that when a custom action is
-invoked from within the fragment, setParent() can be called
-with the appropriate value. The fragment implementation must keep
-these associations for the duration of the tag invocation in which it
-is used.invoke() method executes the body and directs
-all output to either the passed in java.io.Writer or
-the JspWriter returned by the getOut() method
-of the JspContext associated with the fragment.JspException, which must be handled by the invoker. Note
-that tag library developers and page authors should not generate
-JspFragment implementations manually.Creation of a JSP Fragment
-
-
-
-
-
-JspFragment
- abstract class is obtained (may either be created or can optionally be cached)
- each time the tag is invoked. This instance must be configured to
- produce the contents of the body of the fragment when invoked. If the
- fragment is defining the body of a <jsp:attribute>, the fragment
- must evaluate the body each time it is invoked. Otherwise, if the
- fragment is defining the body of a simple tag, the behavior of the
- fragment when invoked varies depending on the body-content
- declared for the tag:
-
-
- body-content is "tagdependent",
- then the fragment must echo the contents of the body verbatim
- when invoked.body-content is "scriptless",
- then the fragment must evaluate the body each time it is invoked.JspFragment instance is passed a reference to
- the current JspContext. Whenever the fragment invokes
- a tag handler, it must use this value when calling
- setJspContext().JspFragment instance is associated with an
- instance of the tag handler of the nearest enclosing tag
- invocation, or with null if there is no enclosing tag.
- Whenever the fragment invokes a tag handler, the fragment must
- use this value when calling setParent().Invocation of a JSP Fragment
-
-JspFragment. These fragments can be invoked by
-calling the invoke() method in the JspFragment
-abstract class. Note that it is legal (and possible) for a fragment to
-recursively invoke itself, indirectly.
-
-
-
-AT_BEGIN and
- NESTED variables in the JspContext of the
- calling page/tag, before invoking the fragment. Note that this is
- not always the same as the JspContext of the fragment
- being invoked, as fragments can be passed from one tag to another.
- In the case of tag files, for each variable declared
- in scope AT_BEGIN or NESTED, if a page
- scoped attribute exists with the provided name in the tag file, the
- JSP container must generate code to create/update the page scoped
- attribute of the provided name in the calling page/tag. If a page
- scoped attribute with the provided name does not exist in the tag
- file, and a page scoped attribute of the provided name is present in
- the calling page, the scoped attribute is removed from the calling
- page's page scope. See the chapter on Tag Files for details.var attribute is specified,
- a custom java.io.Writer is created that can expose
- the result of the invocation as a java.lang.String
- object. If the varReader attribute is
- specified, a custom java.io.Writer object is created
- that can expose the resulting invocation as a
- java.io.Reader object.invoke() method of the fragment is invoked,
- passing in an optional Writer.JspContext.getOut() and the implicit "out" object must
- be updated to send output to that writer. To accomplish
- this, the container must call pushBody( writer ) on the
- current JspContext, where writer is the
- instance of java.io.Writer passed to the fragment upon
- invocation.SKIP_PAGE, or if a Simple Tag Handler is invoked
- and throws SkipPageException, the
- JspFragment must throw SkipPageException to
- signal that the calling page is to be skipped.JspContext.getOut() must be
- restored via a call to popBody() on the current
- JspContext.var or varReader
- attribute is specified, a scoped variable with a name equal to the
- value of the var or varReader attribute
- is created (or modified) in the page scope, and the value is set
- to a java.lang.String or java.io.Reader
- respectively that can produce the results of the fragment
- invocation.invoke() method can be called again, zero or more
- times. When the tag invocation defining the fragment is complete,
- the tag must discard the fragment instance since it might be reused
- by the container.8. Example Simple Tag Handler Scenario
-
-
-
-
-
-
-Sample Source Files
-
-Original JSP (my.jsp)
-
-<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %>
-
-<my:simpleTag x="10">
- <jsp:attribute name="y">20</jsp:attribute>
- <jsp:attribute name="nonfragment">
- Nonfragment Template Text
- </jsp:attribute>
- <jsp:attribute name="frag">
- Fragment Template Text ${var1}
- </jsp:attribute>
- <jsp:body>
- Body of tag that defines an AT_BEGIN
- scripting variable ${var1}.
- </jsp:body>
-</my:simpleTag>
-
-
-Original Tag File (/WEB-INF/tags/simpletag.tag)
-
-<%-- /WEB-INF/tags/simpletag.tag --%>
-<%@ attribute name="x" %>
-<%@ attribute name="y" %>
-<%@ attribute name="nonfragment" %>
-<%@ attribute name="frag" fragment="true" %>
-<%@ variable name-given="var1" scope="AT_BEGIN" %>
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-
-Some template text.
-<c:set var="var1" value="${x+y}"/>
-<jsp:invoke fragment="frag" varReader="var1"/>
-
-Invoke the body:
-<jsp:doBody/>
-
-
-
-Sample Generated Files
-Helper class for JspFragment (JspFragmentBase.java)
-
-public abstract class JspFragmentBase
- implements javax.servlet.jsp.tagext.JspFragment
-{
- protected javax.servlet.jsp.JspContext jspContext;
- protected javax.servlet.jsp.tagext.JspTag parentTag;
- public void JspFragmentBase(
- javax.servlet.jsp.JspContext jspContext,
- javax.servlet.jsp.tagext.JspTag parentTag )
- {
- this.jspContext = jspContext;
- this.parentTag = parentTag;
- }
-}
-
-Relevant Portion of JSP Service Method
-
-// Step T.1 - Initial creation
-MySimpleTag _jsp_mySimpleTag = new MySimpleTag();
-// Step T.2 - Set page context and parent (since parent is null,
-// no need to call setParent() in this case)
-_jsp_mySimpleTag.setJspContext( jspContext );
-// Step T.3 - XML element attributes evaluated and set
-_jsp.mySimpleTag.setX( "10" );
-// Step T.4 - <jsp:attribute> elements evaluated and set
-// - parameter y
-// (using PageContext.pushBody() is one possible implementation -
-// one limitation is that this code will only work for Servlet-based code).
-out = ((PageContext)jspContext).pushBody();
-out.write( "20" );
-_jsp_mySimpleTag.setY(
- ((javax.servlet.jsp.tagext.BodyContent)out).getString() );
-out = jspContext.popBody();
-// - parameter nonfragment
-// (using PageContext.pushBody() is one possible implementation -
-// one limitation is that this code will only work for Servlet-based code).
-// Note that trim is enabled by default, else we would have "\n Non..."
-out = ((PageContext)jspContext).pushBody();
-out.write( "Nonfragment Template Text" );
-_jsp_mySimpleTag.setNonfragment(
- ((javax.servlet.jsp.tagext.BodyContent)out).getString() );
-out = jspContext.popBody();
-// - parameter frag
-_jsp_mySimpleTag.setFrag(
- // Step C.1 - New instance of fragment created
- // Step C.2 - Store jspContext
- // Step C.3 - Association with nearest enclosing Tag instance
- new JspFragmentBase( jspContext, _jsp_mySimpleTag ) {
- public void invoke( java.io.Writer writer ) {
- javax.servlet.jsp.JspWriter out;
- // Step F.1-F.3 done in tag file (see following example)
- // Step F.4 - If writer provided, push body:
- if( out == null ) {
- out = this.jspContext.getOut();
- }
- else {
- out = this.jspContext.pushBody( writer );
- }
- // Step F.5 - Evaluate body of fragment:
- try {
- out.write( "Fragment Template Text " );
- out.write( jspContext.getExpressionEvaluator().evaluate(
- "${var1}",
- java.lang.String.class,
- vResolver, fMapper, "my" ) );
- }
- finally {
- // Step F.6 - Restore value of JspContext.getOut()
- if( writer != null ) {
- this.jspContext.popBody();
- }
- }
-
- // Step F.7-F.9 done in tag file (see following example)
- }
- } );
-// Step T.5 - Determine and set body of the tag
-// - body of tag
-_jsp_mySimpleTag.setJspBody(
- // Step C.1 - New instance of fragment created
- // Step C.2 - Store jspContext
- // Step C.3 - Association with nearest enclosing Tag instance
- new JspFragmentBase( jspContext, _jsp_mySimpleTag ) {
- public void invoke( java.io.Writer writer ) {
- javax.servlet.jsp.JspWriter out;
- // Step F.1-F.3 done in tag file (see following example)
- // Step F.4 - If writer provided, push body:
- if( writer == null ) {
- out = this.jspContext.getOut();
- }
- else {
- out = this.jspContext.pushBody( writer );
- }
- // Step F.5 - Evaluate body of fragment:
- try {
- out.write(
- "Body of tag that defines an AT_BEGIN\n" +
- " scripting variable " );
- out.write( jspContext.getExpressionEvaluator().evaluate(
- "${var1}",
- java.lang.String.class,
- vResolver, fMapper, "my" ) );
- out.write( ".\n" );
- }
- finally {
- // Step F.6 - Restore value of JspContext.getOut()
- if( writer != null ) {
- this.jspContext.popBody();
- }
- }
-
- // Step F.7-F.9 done in tag file (see following example)
- }
- } );
-// Step T.6 - Inovke doTag
-// Step T.7 occurs in the tag file (see following example)
-// Step T.8 - doTag returns - page will catch SkipPageException.
-_jsp_mySimpleTag.doTag();
-// Step T.9 - Declare AT_BEGIN and AT_END scripting variables
-String var1 = (String)jspContext.findAttribute( "var1" );
-
-
-Generated Simple Tag Handler (MySimpleTag.java)
-
-public class MySimpleTag
- extends javax.servlet.jsp.tagext.SimpleTagSupport
-{
- // Attributes:
- private String x;
- private String y;
- private String nonfragment;
- private javax.servlet.jsp.tagext.JspFragment frag;
- // Setters and getters for attributes:
- public void setX( Stirng x ) {
- this.x = x;
- }
- public String getX() {
- return this.x;
- }
- public void setY( String y ) {
- this.y = y;
- }
- public String getY() {
- return this.y;
- }
- public void setNonfragment( String nonfragment ) {
- this.nonfragment = nonfragment;
- }
- public String getNonfragment() {
- return this.nonfragment;
- }
- public void setFrag( javax.servlet.jsp.tagext.JspFragment frag ) {
- this.frag = frag;
- }
- public javax.servlet.jsp.tagext.JspFragment getFrag() {
- return this.frag;
- }
-
- protected JspContext jspContext;
- public void setJspContext( JspContext ctx ) {
- super.setJspContext( ctx );
- // Step T.2 - A JspContext wrapper is created.
- // (Implementation of wrapper not shown).
- this.jspContext = new utils.JspContextWrapper( ctx );
- }
- public JspContext getJspContext() {
- // Step T.2 - Calling getJspContext() must return the
- // wrapped JspContext.
- return this.jspContext;
- }
-
- public void doTag() throws JspException {
- java.lang.Object jspValue;
- JspContext jspContext = getJspContext();
- JspContext _jsp_parentContext =
- SimpleTagSupport.this.getJspContext();
- try {
- javax.servlet.jsp.JspWriter out = jspContext.getOut();
-
- // Create page-scope attributes for each tag attribute:
- this.jspContext.setAttribute( "x", getX() );
- this.jspContext.setAttribute( "y", getY() );
- this.jspContext.setAttribute( "nonfragment", getNonfragment() );
- this.jspContext.setAttribute( "frag", getFrag() );
-
- // Synchronize AT_BEGIN variables from calling page
- if( (jspValue = _jsp_parentContext.getAttribute(
- "var1" )) != null )
- {
- jspContext.setAttribute( "var1", value );
- }
- else {
- jspContext.removeAttribute( "var1",
- JspContext.PAGE_SCOPE );
- }
-
- // Tag template text:
- out.write( "\n\n\n\n\n\n\n\nSome template text.\n" );
-
- // Invoke c:set - recognized tag handler from JSTL:
- jspContext.setAttribute( "var1",
- jspContext.getExpressionEvaluator().evaluate(
- "${x+y}",
- java.lang.String.class,
- jspContext,
- prefixMap, functionMap, "my" ) );
-
- // Invoke the "frag" fragment:
- // Step F.1 - Set values of AT_BEGIN and NESTED variables
- // in calling page context.
- if( (jspValue = jspContext.getAttribute( "var1" )) != null ) {
- _jsp_parentContext.setAttribute( "var1", value );
- }
- else {
- _jsp_parentContext.removeAttribute( "var1",
- JspContext.PAGE_SCOPE );
- }
-
- // Step F.2 - varReader is specified, generate a writer.
- java.io.Writer _jsp_sout = new java.io.StringWriter();
-
- // Step F.3 - Invoke fragment with writer
- getFrag().invoke( _jsp_sout );
-
- // Step F.4 - F.6 occur in the fragment (see above)
- // Step F.7 - fragment returns
-
- // Step F.8 - varReader specified, so save to var
- jspContext.setAttribute(
- "var1", new StringReader( _jsp_sout.toString() ) );
-
- // Step F.9 - Done!
-
-
- out.write( "\n\nInvoke the body:\n" );
-
- // Invoke the body of the tag:
- // Step F.1 - Set values of AT_BEGIN and NESTED variables
- // in calling page context.
- if( (jspValue = jspContext.getAttribute( "var1" )) != null ) {
- _jsp_parentContext.setAttribute( "var1", value );
- }
- else {
- _jsp_parentContext.removeAttribute( "var1",
- JspContext.PAGE_SCOPE);
- }
-
- // Step F.2 - varReader is not specified - does not apply.
-
- try {
- // Step F.3 - Invoke body, passing optional writer
- getJspBody().invoke( null );
- }
- finally {
- // Steps F.4 - F.6 occur in the fragment (see above)
- // Step F.7 - fragment returns
- }
-
- // Step F.8 does not apply.
- // Step F.9 - Done!
- }
- finally {
- // Tag handlers generate code to synchronize AT_BEGIN with
- // calling page, regardless of whether an error occurs.
- if( (jspValue = jspContext.getAttribute( "var1" )) != null ) {
- _jsp_parentContext.setAttribute( "var1", value );
- }
- else {
- _jsp_parentContext.removeAttribute( "var1",
- JspContext.PAGE_SCOPE );
- }
- }
- }
-}
-
-
-
-
-9. Translation-time Classes
-
-
-The following classes are used at translation time.
-
-Tag mapping, Tag name
-
-Scripting Variables
-
-jsp:useBean standard action may define an object which
-can later be used through a scripting variable.
-
-TagExtraInfo class is instead given in the TLD. The
-getVariableInfo method of this class is used at
-translation time to obtain information on each variable that will be
-created at request time when this action is executed. The method is
-passed a TagData instance that contains the
-translation-time attribute values.
-
-Validation
-
-TagLibraryValidator
-class can be used to validate a complete JSP page, and a
-TagExtraInfo class can be used to validate a specific
-action. In some cases, additional request-time validation will be done
-dynamically within the methods in the Tag instance. If an error is
-discovered, an instance of JspTagException can be thrown.
-If uncaught, this object will invoke the errorpage mechanism of JSP.
-
-PageData object, which abstracts the XML view of the JSP
-page.
-
-id attribute need not be "jsp"
-but it must map to the namespace http://java.sun.com/JSP/Page.
-In the case where the user has redefined the jsp prefix, an
-alternative prefix must be used by the container.
-
-
-Validation Details
-
-
-
-
-validate method. The order of invocation of this methods
-is undefined.
-
-
-
-
-
diff --git a/api/src/main/javadoc/doc-files/final-spec-license.html b/api/src/main/javadoc/doc-files/final-spec-license.html
deleted file mode 100644
index de94b82..0000000
--- a/api/src/main/javadoc/doc-files/final-spec-license.html
+++ /dev/null
@@ -1,215 +0,0 @@
-
-
-Version: 2.3
-
-Status: Maintenance Release 3
-
-Specification Lead: Oracle America, Inc. ("Specification Lead")
-
-Release: May 31, 2013
-
-
-
-Copyright © 2013 Oracle America, Inc.
-
-All rights reserved.
-
-
-1. License for Evaluation Purposes. Specification Lead hereby grants
-you a fully-paid, non-exclusive, non-transferable, worldwide, limited
-license (without the right to sublicense), under Specification Lead's
-applicable intellectual property rights to view, download, use and
-reproduce the Specification only for the purpose of internal
-evaluation. This includes (i) developing applications intended to run
-on an implementation of the Specification, provided that such
-applications do not themselves implement any portion(s) of the
-Specification, and (ii) discussing the Specification with any third
-party; and (iii) excerpting brief portions of the Specification in oral
-or written communications which discuss the Specification provided that
-such excerpts do not in the aggregate constitute a significant portion
-of the Specification.
-
-a. With respect to any patent claims covered by the license granted
-under subparagraph 2 above that would be infringed by all technically
-feasible implementations of the Specification, such license is
-conditioned upon your offering on fair, reasonable and
-non-discriminatory terms, to any party seeking it from You, a
-perpetual, non-exclusive, non-transferable, worldwide license under
-Your patent rights which are or would be infringed by all technically
-feasible implementations of the Specification to develop, distribute
-and use a Compliant Implementation.
-
-b. With respect to any patent claims owned by Specification Lead and
-covered by the license granted under subparagraph 2, whether or not
-their infringement can be avoided in a technically feasible manner when
-implementing the Specification, such license shall terminate with
-respect to such claims if You initiate a claim against Specification
-Lead that it has, in the course of performing its responsibilities as
-the Specification Lead, induced any other entity to infringe Your
-patent rights.
-
-c. Also with respect to any patent claims owned by Specification Lead
-and covered by the license granted under subparagraph 2 above, where
-the infringement of such claims can be avoided in a technically
-feasible manner when implementing the Specification such license, with
-respect to such claims, shall terminate if You initiate a claim against
-Specification Lead that its making, having made, using, offering to
-sell, selling or importing a Compliant Implementation infringes Your
-patent rights.
-
-THE SPECIFICATION IS PROVIDED "AS IS". SPECIFICATION LEAD MAKES NO
-REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
-NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE, NON-INFRINGEMENT (INCLUDING AS A CONSEQUENCE OF ANY PRACTICE
-OR IMPLEMENTATION OF THE SPECIFICATION), OR THAT THE CONTENTS OF THE
-SPECIFICATION ARE SUITABLE FOR ANY PURPOSE. This document does not
-represent any commitment to release or implement any portion of the
-Specification in any product. In addition, the Specification could
-include technical inaccuracies or typographical errors.
-
-TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SPECIFICATION
-LEAD OR ITS LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT
-LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT,
-CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
-REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED IN ANY
-WAY TO YOUR HAVING, IMPELEMENTING OR OTHERWISE USING USING THE
-SPECIFICATION, EVEN IF SPECIFICATION LEAD AND/OR ITS LICENSORS HAVE
-BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You will indemnify,
-hold harmless, and defend Specification Lead and its licensors from any
-claims arising or resulting from: (i) your use of the Specification;
-(ii) the use or distribution of your Java application, applet and/or
-implementation; and/or (iii) any claims that later versions or releases
-of any Specification furnished to you are incompatible with the
-Specification provided to you under this license.
-
-U.S. Government: If this Specification is being acquired by or on
-behalf of the U.S. Government or by a U.S. Government prime contractor
-or subcontractor (at any tier), then the Government's rights in the
-Software and accompanying documentation shall be only as set forth in
-this license; this is in accordance with 48 C.F.R. 227.7201 through
-227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48
-C.F.R. 2.101 and 12.212 (for non-DoD acquisitions).
-
-If you provide Specification Lead with any comments or suggestions
-concerning the Specification ("Feedback"), you hereby: (i) agree that
-such Feedback is provided on a non-proprietary and non-confidential
-basis, and (ii) grant Specification Lead a perpetual, non-exclusive,
-worldwide, fully paid-up, irrevocable license, with the right to
-sublicense through multiple levels of sublicensees, to incorporate,
-disclose, and use without limitation the Feedback for any purpose.
-
-Any action related to this Agreement will be governed by California law
-and controlling U.S. federal law. The U.N. Convention for the
-International Sale of Goods and the choice of law rules of any
-jurisdiction will not apply.
-
-
-
-
-
-
<jsp-file> element of a
- * servlet definition. If present on a request, this overrides the
- * value returned by request.getServletPath() to select
- * the JSP page to be executed.
- */
- public static final String JSP_FILE = "org.apache.catalina.jsp_file";
-
-
- /**
- * FIXME
- * ServletContext attribute for class loader. This is tomcat specific.
- * Other servlet engines can choose to have this attribute if they
- * want to have this JSP engine running on them.
- */
- //public static final String SERVLET_CLASS_LOADER = "org.apache.tomcat.classloader";
- public static final String SERVLET_CLASS_LOADER = "org.apache.catalina.classloader";
-
- /**
- * Default size of the JSP buffer.
- */
- public static final int K = 1024;
- public static final int DEFAULT_BUFFER_SIZE = 8*K;
-
- /**
- * Default size for the tag buffers.
- */
- public static final int DEFAULT_TAG_BUFFER_SIZE = 512;
-
- /**
- * Default tag handler pool size.
- */
- public static final int MAX_POOL_SIZE = 5;
-
- /**
- * The query parameter that causes the JSP engine to just
- * pregenerated the servlet but not invoke it.
- */
- public static final String PRECOMPILE = "jsp_precompile";
-
- /**
- * The default package name for compiled jsp pages.
- */
- public static final String JSP_PACKAGE_NAME = "org.apache.jsp";
-
- /**
- * The default package name for tag handlers generated from tag files
- */
- public static final String TAG_FILE_PACKAGE_NAME = "org.apache.jsp.tag";
-
- /**
- * Servlet context and request attributes that the JSP engine
- * uses.
- */
- public static final String INC_REQUEST_URI = "javax.servlet.include.request_uri";
- public static final String INC_SERVLET_PATH = "javax.servlet.include.servlet_path";
- public static final String TMP_DIR = "javax.servlet.context.tempdir";
- public static final String FORWARD_SEEN = "javax.servlet.forward.seen";
- public static final String FIRST_REQUEST_SEEN = "jspx.1st.request";
-
- // Must be kept in sync with org/apache/catalina/Globals.java
- public static final String ALT_DD_ATTR = "org.apache.catalina.deploy.alt_dd";
-
- /**
- * Public Id and the Resource path (of the cached copy)
- * of the DTDs and schemas for tag library descriptors.
- */
- public static final String TAGLIB_DTD_PUBLIC_ID_11 =
- "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN";
- public static final String TAGLIB_DTD_RESOURCE_PATH_11 =
- "/javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd";
- public static final String TAGLIB_DTD_PUBLIC_ID_12 =
- "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
- public static final String TAGLIB_DTD_RESOURCE_PATH_12 =
- "/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd";
- public static final String TAGLIB_SCHEMA_PUBLIC_ID_20 =
- "web-jsptaglibrary_2_0.xsd";
- public static final String TAGLIB_SCHEMA_RESOURCE_PATH_20 =
- "/javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd";
- public static final String TAGLIB_SCHEMA_PUBLIC_ID_21 =
- "web-jsptaglibrary_2_1.xsd";
- public static final String TAGLIB_SCHEMA_RESOURCE_PATH_21 =
- "/javax/servlet/jsp/resources/web-jsptaglibrary_2_1.xsd";
- public static final String SCHEMA_LOCATION_JSP_20
- = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd";
- public static final String SCHEMA_LOCATION_JSP_21
- = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd";
-
- /**
- * Public Id and the Resource path (of the cached copy)
- * of the DTDs and schemas for web application deployment descriptors
- */
- public static final String WEBAPP_DTD_PUBLIC_ID_22 =
- "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
- public static final String WEBAPP_DTD_RESOURCE_PATH_22 =
- "/javax/servlet/resources/web-app_2_2.dtd";
- public static final String WEBAPP_DTD_PUBLIC_ID_23 =
- "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN";
- public static final String WEBAPP_DTD_RESOURCE_PATH_23 =
- "/javax/servlet/resources/web-app_2_3.dtd";
- public static final String WEBAPP_SCHEMA_PUBLIC_ID_24 =
- "web-app_2_4.xsd";
- public static final String WEBAPP_SCHEMA_RESOURCE_PATH_24 =
- "/javax/servlet/resources/web-app_2_4.xsd";
- public static final String WEBAPP_SCHEMA_PUBLIC_ID_25 =
- "web-app_2_5.xsd";
- public static final String WEBAPP_SCHEMA_RESOURCE_PATH_25 =
- "/javax/servlet/resources/web-app_2_5.xsd";
- public static final String SCHEMA_LOCATION_WEBAPP_24
- = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
- public static final String SCHEMA_LOCATION_WEBAPP_25
- = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
-
- /* PWC 6386258
- public static final String[] CACHED_DTD_RESOURCE_PATHS = {
- TAGLIB_DTD_RESOURCE_PATH_11,
- TAGLIB_DTD_RESOURCE_PATH_12,
- WEBAPP_DTD_RESOURCE_PATH_22,
- WEBAPP_DTD_RESOURCE_PATH_23,
- };
- */
-
- /**
- * Default URLs to download the pluging for Netscape and IE.
- */
- public static final String NS_PLUGIN_URL =
- "http://java.sun.com/products/plugin/";
-
- public static final String IE_PLUGIN_URL =
- "http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0";
-
- /**
- * Prefix to use for generated temporary variable names
- */
- public static final String TEMP_VARIABLE_NAME_PREFIX =
- "_jspx_temp";
-
- /**
- * A replacement char for "\$".
- * XXX This is a hack to avoid changing EL interpreter to recognize "\$"
- */
- public static final char ESC='\u001b';
- public static final String ESCStr="'\\u001b'";
-
- public static final Double JSP_VERSION_2_0 = Double.valueOf("2.0");
- public static final Double JSP_VERSION_2_1 = Double.valueOf("2.1");
-
- // START SJSWS
- /*
- * Default initial capacity of HashMap which maps JSPs to their
- * corresponding servlets
- */
- public static final int DEFAULT_INITIAL_CAPACITY = 32;
- // END SJSWS
-
- // START GlassFish 750
- public static final String JSP_TAGLIBRARY_CACHE = "com.sun.jsp.taglibraryCache";
- public static final String JSP_TAGFILE_JAR_URLS_CACHE =
- "com.sun.jsp.tagFileJarUrlsCache";
- // END GlassFish 750
-
- // START GlassFish 740
- // Must be kept in sync with org.apache.catalina.Globals
- public static final String JSP_PROPERTY_GROUPS_CONTEXT_ATTRIBUTE =
- "com.sun.jsp.propertyGroups";
-
- public static final String WEB_XML_VERSION_CONTEXT_ATTRIBUTE =
- "com.sun.servlet.webxml.version";
- // END GlassFish 740
-
- // START GlassFish 747
- // Must be kept in sync with org.apache.catalina.Globals
- public static final String JSP_TLD_URI_TO_LOCATION_MAP =
- "com.sun.jsp.tldUriToLocationMap";
- // END GlassFish 747
-
- public static final String JSP_RESOURCE_INJECTOR_CONTEXT_ATTRIBUTE =
- "com.sun.appserv.jsp.resource.injector";
-
- // a request attribute to indicate that the jsp error is already handled
- // The constant value (instead of the constant name) is being referenced from
- // other modules, and therefore requires special caution whenever it is changed.
- public static final String JSP_ERROR_HANDLED = "org.glassfish.jsp.error_handled";
-
- /**
- * Has security been turned on?
- */
- public static final boolean IS_SECURITY_ENABLED =
- (System.getSecurityManager() != null);
-
- /**
- * The name of the JSP engine. Used for X-Powered-By identification in
- * the response header
- */
- public static final String JSP_NAME = "JSP/2.3";
-
- /**
- * Name of the ServletContext init-param that determines if the XML parsers
- * will block the resolution of external entities.
- */
- public static final String XML_BLOCK_EXTERNAL_INIT_PARAM =
- "org.apache.jasper.XML_BLOCK_EXTERNAL";
-
-}
-
diff --git a/impl/src/main/java/org/apache/jasper/EmbeddedServletOptions.java b/impl/src/main/java/org/apache/jasper/EmbeddedServletOptions.java
deleted file mode 100644
index d0622d7..0000000
--- a/impl/src/main/java/org/apache/jasper/EmbeddedServletOptions.java
+++ /dev/null
@@ -1,773 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2014 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 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jasper;
-
-import java.io.File;
-import java.util.*;
-import java.util.logging.Logger;
-import java.util.logging.Level;
-import java.text.MessageFormat;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-
-import org.apache.jasper.runtime.TldScanner;
-import org.apache.jasper.compiler.JspConfig;
-import org.apache.jasper.compiler.TagPluginManager;
-import org.apache.jasper.compiler.Localizer;
-import org.apache.jasper.xmlparser.ParserUtils;
-
-/**
- * A class to hold all init parameters specific to the JSP engine.
- *
- * @author Anil K. Vijendran
- * @author Hans Bergsten
- * @author Pierre Delisle
- */
-public final class EmbeddedServletOptions implements Options {
-
- // Logger
- private static Logger log =
- Logger.getLogger(EmbeddedServletOptions.class.getName());
-
- private Properties settings = new Properties();
-
- /**
- * Is Jasper being used in development mode?
- */
- private boolean development = true;
-
- /**
- * Should Ant fork its java compiles of JSP pages.
- */
- public boolean fork = true;
-
- /**
- * Do you want to keep the generated Java files around?
- */
- private boolean keepGenerated;
-
- /**
- * If class files are generated as byte arrays, should they be saved to
- * disk at the end of compilations?
- */
- private boolean saveBytecode = false;
-
- /**
- * Should white spaces between directives or actions be trimmed?
- */
- private boolean trimSpaces = false;
-
- /**
- * Determines whether tag handler pooling is enabled.
- */
- private boolean isPoolingEnabled = true;
-
- /**
- * Do you want support for "mapped" files? This will generate
- * servlet that has a print statement per line of the JSP file.
- * This seems like a really nice feature to have for debugging.
- */
- private boolean mappedFile = true;
-
- /**
- * Do you want stack traces and such displayed in the client's
- * browser? If this is false, such messages go to the standard
- * error or a log file if the standard error is redirected.
- */
- private boolean sendErrorToClient = false;
-
- /**
- * Do we want to include debugging information in the class file?
- */
- private boolean classDebugInfo = true;
-
- /**
- * Background compile thread check interval in seconds.
- */
- private int checkInterval = 0;
-
- /**
- * Is the generation of SMAP info for JSR45 debuggin suppressed?
- */
- private boolean isSmapSuppressed = false;
-
- /**
- * Should SMAP info for JSR45 debugging be dumped to a file?
- */
- private boolean isSmapDumped = false;
-
- /**
- * Are Text strings to be generated as char arrays?
- */
- private boolean genStringAsCharArray = false;
-
- private boolean genStringAsByteArray = true;
-
- private boolean defaultBufferNone = false;
-
- private boolean errorOnUseBeanInvalidClassAttribute = false;
-
- /**
- * I want to see my generated servlets. Which directory are they
- * in?
- */
- private File scratchDir;
-
- /**
- * Need to have this as is for versions 4 and 5 of IE. Can be set from
- * the initParams so if it changes in the future all that is needed is
- * to have a jsp initParam of type ieClassId="
- * <taskdef classname="org.apache.jasper.JspC" name="jasper2" >
- * <classpath>
- * <pathelement location="${java.home}/../lib/tools.jar"/>
- * <fileset dir="${ENV.CATALINA_HOME}/server/lib">
- * <include name="*.jar"/>
- * </fileset>
- * <fileset dir="${ENV.CATALINA_HOME}/common/lib">
- * <include name="*.jar"/>
- * </fileset>
- * <path refid="myjars"/>
- * </classpath>
- * </taskdef>
- *
- * <jasper2 verbose="0"
- * package="my.package"
- * uriroot="${webapps.dir}/${webapp.name}"
- * webXmlFragment="${build.dir}/generated_web.xml"
- * outputDir="${webapp.dir}/${webapp.name}/WEB-INF/src/my/package" />
- *
- *
- * @author Danno Ferrin
- * @author Pierre Delisle
- * @author Costin Manolache
- */
-public class JspC implements Options {
-
- public static final String DEFAULT_IE_CLASS_ID =
- "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";
-
- // START SJSAS 6402545
- private static final String JAVA_1_0 = "1.0";
- private static final String JAVA_1_1 = "1.1";
- private static final String JAVA_1_2 = "1.2";
- private static final String JAVA_1_3 = "1.3";
- private static final String JAVA_1_4 = "1.4";
- private static final String JAVA_1_5 = "1.5";
- private static final String JAVA_1_6 = "1.6";
- private static final String JAVA_1_7 = "1.7";
- private static final String JAVA_1_8 = "1.8";
- private static final String JAVA_5 = "5";
- private static final String JAVA_6 = "6";
- private static final String JAVA_7 = "7";
- private static final String JAVA_8 = "8";
- // END SJSAS 6402545
-
- // Logger
- private static Logger log = Logger.getLogger(JspC.class.getName());
-
- private static final String SWITCH_VERBOSE = "-v";
- private static final String SWITCH_HELP = "-help";
- private static final String SWITCH_QUIET = "-q";
- private static final String SWITCH_OUTPUT_DIR = "-d";
- private static final String SWITCH_IE_CLASS_ID = "-ieplugin";
- private static final String SWITCH_PACKAGE_NAME = "-p";
- private static final String SWITCH_CLASS_NAME = "-c";
- private static final String SWITCH_FULL_STOP = "--";
- private static final String SWITCH_COMPILE = "-compile";
- private static final String SWITCH_SOURCE = "-compilerSourceVM";
- private static final String SWITCH_TARGET = "-compilerTargetVM";
- private static final String SWITCH_URI_BASE = "-uribase";
- private static final String SWITCH_URI_ROOT = "-uriroot";
- private static final String SWITCH_FILE_WEBAPP = "-webapp";
- private static final String SWITCH_WEBAPP_INC = "-webinc";
- private static final String SWITCH_WEBAPP_XML = "-webxml";
- private static final String SWITCH_MAPPED = "-mapped";
- private static final String SWITCH_XPOWERED_BY = "-xpoweredBy";
- private static final String SWITCH_TRIM_SPACES = "-trimSpaces";
- private static final String SWITCH_CLASSPATH = "-classpath";
- private static final String SWITCH_SYSCLASSPATH = "-sysClasspath";
- private static final String SWITCH_DIE = "-die";
- private static final String SWITCH_SMAP = "-smap";
- private static final String SWITCH_DUMP_SMAP = "-dumpsmap";
- // START PWC 6386258
- private static final String SWITCH_SCHEMAS_PREFIX = "-schemas";
- private static final String SWITCH_DTDS_PREFIX = "-dtds";
- // END PWC 6386258
- // START IASRI 4660687
- private static final String SWITCH_GENERATE_CLASSES = "-genclass";
- // END IASRI 4660687
- // START PWC 6385018
- private static final String SWITCH_VALIDATE = "-validate";
- // END PWC 6385018
- // START SJSAS 6393940
- private static final String SWITCH_IGNORE_JSP_FRAGMENTS
- = "-ignoreJspFragmentErrors";
- // END SJSAS 6393940
- private static final String SWITCH_DISABLE_POOLING = "-disablePooling";
-
- private static final String SHOW_SUCCESS ="-s";
- private static final String LIST_ERRORS = "-l";
- private static final int NO_WEBXML = 0;
- private static final int INC_WEBXML = 10;
- private static final int ALL_WEBXML = 20;
- private static final int DEFAULT_DIE_LEVEL = 1;
- private static final int NO_DIE_LEVEL = 0;
-
- private static final String[] insertBefore =
- { "", "execute method when
- * failOnError has been set to FALSE.
- *
- * Each error error in the list is represented by an instance of
- * org.apache.jasper.JasperException.
- *
- * @return List of JSP compilation errors caught during most recent
- * invocation of this instance's execute method, or an empty
- * list if no errors were encountered or this instance's failOnError
- * property was set to TRUE
- */
- public List