Package net.sf.basedb.clients.web.taglib
Class Head
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- net.sf.basedb.clients.web.taglib.Head
-
- All Implemented Interfaces:
Serializable
,IterationTag
,JspTag
,Tag
public class Head extends TagSupport
This tag defines the header section of a page. It must be located inside a<base:page>
ag.Syntax:
<base:head styles=... scripts=... >
Tag attributes Attribute Default value Required Description styles - no A comma-separated list of stylesheet filenames that is needed by the page. The main.css
aremenu.css
automatically included. The stylesheets must be located in the/include/styles
folder. Do not include the folder names in the stylesheet filename.scripts - no A comma-separated list of javascript filenames that is needed by the page. The main.js
aremenu.js
automatically included. The scripts must be located in the/include/scripts
folder. Do not include the folder names in the scripts filename.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static String
globalVersion
private String
localVersion
private Page
page
The parent <base:page> tag.private static Pattern
PATH_MATCH
private String
scripts
A comma-separated list of JavaScript filenames.private static long
serialVersionUID
private String
styles
A comma-separated list of stylesheets filenames.private static Map<String,String>
xtVersions
-
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
-
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
-
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
-
-
Constructor Summary
Constructors Constructor Description Head()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
appendScripts(StringBuilder sb, JspContext jspContext)
private void
appendStyles(StringBuilder sb, String fontStyles, boolean hideLongTexts, JspContext jspContext)
int
doEndTag()
int
doStartTag()
String
getScripts()
String
getStyles()
static String
getVersionParameter(String absolutePath)
Get query parameter to the given absolute path (including root directory).static void
setExtensionVersion(String jarName, String version)
Register the version for an exteniosn JAR file.void
setPageContext(PageContext pageContext)
void
setScripts(String scripts)
void
setStyles(String styles)
-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setParent, setValue
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
PATH_MATCH
private static final Pattern PATH_MATCH
-
page
private Page page
The parent <base:page> tag.
-
styles
private String styles
A comma-separated list of stylesheets filenames.
-
scripts
private String scripts
A comma-separated list of JavaScript filenames.
-
globalVersion
private static final String globalVersion
-
localVersion
private String localVersion
-
-
Method Detail
-
setExtensionVersion
public static void setExtensionVersion(String jarName, String version)
Register the version for an exteniosn JAR file. Used for appending a query parameter to all scripts and style sheets to prevent that browsers cache the old version.- Since:
- 3.3.2
- See Also:
getVersionParameter(String)
-
getVersionParameter
public static final String getVersionParameter(String absolutePath)
Get query parameter to the given absolute path (including root directory). If the path points to a file in the /base-root/extensions/ directory the version of the extension is used, otherwise the BASE version is used. The returned parameter is of the form v=<version>.- Parameters:
absolutePath
- An absolute path with or without the base-root directory- Since:
- 3.3.2
-
setStyles
public void setStyles(String styles)
-
getStyles
public String getStyles()
-
setScripts
public void setScripts(String scripts)
-
getScripts
public String getScripts()
-
appendStyles
private void appendStyles(StringBuilder sb, String fontStyles, boolean hideLongTexts, JspContext jspContext)
-
appendScripts
private void appendScripts(StringBuilder sb, JspContext jspContext)
-
setPageContext
public void setPageContext(PageContext pageContext)
- Specified by:
setPageContext
in interfaceTag
- Overrides:
setPageContext
in classTagSupport
-
doStartTag
public int doStartTag() throws JspException
- Specified by:
doStartTag
in interfaceTag
- Overrides:
doStartTag
in classTagSupport
- Throws:
JspException
-
doEndTag
public int doEndTag() throws JspException
- Specified by:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classTagSupport
- Throws:
JspException
-
-