Thursday Dec 20, 2007
Thursday Dec 20, 2007
Over the years, the Enterprise Java Technologies Tech Tips have covered a wide variety of enterprise Java technology topics. Here's a short quiz that tests your knowledge of some topics covered in recent Tech Tips. You can find the answers at the end of the quiz.
@UriTemplate? <jsfExt:scripts/> jsfExt script into the application. public abstract class Item implements Serializable { private long id; private String brand; private String name; private double price; ... } public class Glove extends Item { private String size; } @WebService() public class Inventory { ... public List<Item> getItems() {...} public boolean addItem(Item item) {...} ... }If you deploy the web service and then look at the generated WSDL and schema, would you see a definition for specific inventory items such as Glove?
@UriTemplate? <jsfExt:scripts/> <jsfExt:scripts/> is the standard tag to include
for Dynamic Faces applications. You can see an example of
a Dynamic Faces application in the October, 2007 Tech Tip
Client-Side Polling With Dynamic Faces.EntityManager instance can be obtained through
injection or through JNDI lookup. The lifecycle of an entity
manager instance obtained in this way is managed by the
container. In J2SE mode, the application is responsible for
managing the lifecycle of its entity managers. An
EntityManagerFactory can be used to create the entity
manager. For more information about the two modes of running
a Java Persistence implementation, as well as insights into
optimizing the performance of a Java Persistence
implementation, see the May 26, 2007 Tech Tip How to Get the
Best Performance Out of a Java Persistence Implementation. public abstract class Item implements Serializable { private long id; private String brand; private String name; private double price; ... } public class Glove extends Item { private String size; } @WebService() public class Inventory { ... public List<Item> getItems() {...} public boolean addItem(Item item) {...} ... }Item type is defined -- there would be no mention of
Glove or any other specific item that extends the abstract
Item class. This is because when JAX-WS introspects the
Inventory class there is no mention of classes for the
specific items. To remedy that you can use the @XmlSeeAlso
annotation and list the other classes that you want to
expose through the Inventory web service. For more
information about the @XmlSeeAlso annotation and how it can
be used to enable support for type substitution, see the
September 2007 Tech Tip Using Type Substitution With Web
Services.