You have the option of disabling tag sets within a Java™ class, and the annotations
are not processed at run time.
Before you begin
When you make a custom change to the properties of an element
in the Deployment Descriptor editor, the annotations that could potentially
overwrite these customs changes are disabled.
About this task
Any section of the deployment descriptor that has been generated
through annotated source can be maintained at a given point in time
by either the annotations themselves or the descriptor file, not both.
The concept of disabled tag sets allows the preservation of changes
when the descriptor file is being used for edits. If you change an
element in your application through the Deployment Descriptor, you
are asked whether you want to disable the annotations within the Java source code.
Procedure
- Expand your project name and double click the Deployment
Descriptor.
- This opens the Deployment Descriptor editor. You might
want to change the properties of a particular element in your application.
For example, you can change the type of the Session Bean from "stateless"
to "stateful":
- When you make this change in the Deployment Descriptor
editor, you are asked whether you want to disable the annotations:
This dialog box asking whether you would like to disable the annotations
box appears only when you are using the design page editor, not the
source page editor.
- If you select Cancel, no changes are made to the
state of the bean. If you say OK, the state is changed, and
the annotations are disabled.
- Look at the Java source
code for this object, and the statement // @annotations-disabled
tagSet="ejb" is displayed at the top of the file.
- A source file can have multiple disabled comments, one
for each different tag set that has been disabled.
- If you want to go back to using annotations, then you simply
remove the appropriate comment from the Java source
file, and save. The annotations reprocess and overwrite custom changes
that have been made in the Deployment Descriptor.