O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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"; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required