01: package csdl.stackmvc.control;
02:
03: /**
04: * Provides a type-safe enumeration for JSP Page names.
05: *
06: * @author Philip M. Johnson
07: * @author Jitender Miglani (did minor changes)
08: */
09: public class Page {
10: /** The filename of the JSP page */
11: private final String fileName;
12:
13: /** The title of the JSP page */
14: private final String title;
15:
16: /** Error page for exceptions. */
17: public static final Page ERROR = new Page("/Error.jsp",
18: "Error Page");
19:
20: /** Home page for application */
21: public static final Page INDEX = new Page("/index.jsp", "Home Page");
22:
23: /**
24: * Constructs the JSP Page instance
25: * @param fileName The filename of the JSP page
26: * @param title The title of the JSP page
27: */
28: private Page(String fileName, String title) {
29: this .fileName = fileName;
30: this .title = title;
31: }
32:
33: /**
34: * Gets the title attribute of the Page object.
35: *
36: * @return The title value
37: */
38: public String getTitle() {
39: return this .title;
40: }
41:
42: /**
43: * Gets the fileName attribute of the Page object.
44: *
45: * @return The fileName value
46: */
47: public String getFileName() {
48: return this.fileName;
49: }
50: }
|