|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mslinn.JBrowCaps.JBrowCaps
This class wraps StyleSheet to adapt it to PrayerWell's environment.
This is an application-level object only one is required for a servlet application.
Once initialized, two hashmaps are generated, which provide HTML rendering for HTML browsers that support CSS1 and equivalent rendering for older browsers that don't support CSS. Note that PrayerWell requires the browser to support Java applets, so Netscape V3.3 is the oldest browser that PrayerWell can work with.
StyleSheet class notes.
Field Summary | |
boolean |
debug
Controls debug output sent to System.out. |
Constructor Summary | |
JBrowCaps()
Default constructor. Because this is a bean (even though there is no requirement to be able to serialize it), the default constructor is necessary. |
Method Summary | |
String |
_(String tag)
Look up HTML markup from appropriate HashMap. |
HashMap |
getCssFalse()
|
HashMap |
getCssTrue()
|
HashMap |
getStylesheetMap()
Return appropriate HashMap according to browser type. |
static String |
htmlEncode(String s)
Encode HTML so that metacharacters are escaped; allow HTML to be displayed in browser. |
void |
initialize(HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
Call this method on the user's first hit of their session. After verifying that the browser supports java, this method establishes the appropriate hashmap for rendering to the user's browser. |
void |
setStrict(boolean strict)
Controls if error messages are generated when an attempt is made to reference a undefined tag. |
String |
toString()
Format StyleSheet for printing when debugging. Definitions are printed in sorted order. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public boolean debug
Controls debug output sent to System.out.
Constructor Detail |
public JBrowCaps()
Default constructor. Because this is a bean (even though there is no requirement to be able to serialize it), the default constructor is necessary.
Method Detail |
public String _(String tag) throws JspException
Look up HTML markup from appropriate HashMap.
tag
- String to look up in the appropriate HashMap.MsException
- if the value returned from the HashMap has no String representation.public HashMap getStylesheetMap()
Return appropriate HashMap according to browser type.
public HashMap getCssTrue() throws JspException
TurbineException
- if stylesheet is null.public HashMap getCssFalse() throws JspException
public static String htmlEncode(String s)
Encode HTML so that metacharacters are escaped; allow HTML to be displayed in browser.
s
- String containing URL to encode.public void initialize(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) throws JspException, IOException
Call this method on the user's first hit of their session. After verifying that the browser supports java, this method establishes the appropriate hashmap for rendering to the user's browser.
The call to the constructor and the application level initialization should be moved to the
init()
method of the Sequencer servlet one day.
env
- Environment reference.MsException
- if browser is too old to support Java or problem constructing stylesheet.public void setStrict(boolean strict)
Controls if error messages are generated when an attempt is made to reference a undefined tag.
strict
- boolean indicating if undefined tags are to cause an error.public String toString()
Format StyleSheet for printing when debugging. Definitions are printed in sorted order.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |