The Constants

The Constants class only contains string members used as constants throughout the application. The contents of this class is shown next.

The Constants Class
 package examples.struts; public class Constants { // session attribute keys public static final String USER_NAME = "username"; public static final String USER_ID = "userID"; public static final String SHOPPING_CART = "shoppingCart"; // the key to our session attribute public static final String XSL_TEMPLATE = "xsl-template"; // our session attribute values. relate to init-params in the web.xml file public static final String ALL_TEMPLATE = "all-template"; public static final String CART_TEMPLATE = "cart-template"; public static final String CHECKOUT_TEMPLATE = "checkout-template"; ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.