Tag reference sheet

Tag library reference for the following tag libraries:

Security - version 1.0

JSTL-compatible tag library to handle common security tasks.

Namespace definition: xmlns:security="http://randomcoder.org/tags-security"

Tags

  • inRole Processes the body if and only if the current user has the given role
  • loggedIn Processes the body if a valid user is logged in
  • notInRole Processes the body if and only if the current user does not have the given role
  • notLoggedIn Processes the body if a valid user is not logged in

Required attributes are marked with a*

<security:inRole>

Processes the body if and only if the current user has the given role.

Can contain:JSP

Example

		

Attributes

Name Description Type
role* Role name required to display body content. String

<security:loggedIn>

Processes the body if a valid user is logged in.

Can contain:JSP

Example

		

This tag has no attributes.

<security:notInRole>

Processes the body if and only if the current user does not have the given role.

Can contain:JSP

Attributes

Name Description Type
role* Role name not allowed to display body content. String

<security:notLoggedIn>

Processes the body if a valid user is not logged in.

Can contain:JSP

Example

		

This tag has no attributes.

Format - version 1.0

EL formatting functions.

Namespace definition: xmlns:rcfmt="http://randomcoder.org/tags-format"

EL Functions

  • shorten() Shorten a name to a maximum length and add ellipses if necessary

Required attributes are marked with a*

rcfmt:shorten(java.lang.String,int)

Function class: org.randomcoder.taglibs.functions.FormatElFunctions

Function signature: java.lang.String shorten(java.lang.String,int)

Shorten a name to a maximum length and add ellipses if necessary

UI - version 1.0

JSP 2.0 implementation of common UI components.

Namespace definition: xmlns:ui="http://randomcoder.org/tags-ui"

Tags

Required attributes are marked with a*

<ui:calendar>

Renders an XHTML Calendar control.

Can contain:JSP

Attributes

Name Description Type
capitalizeDays If true, day captions will be capitalized. boolean
maxWeekdayLength Sets the maximum length of the weekday captions. int
selectedClass Sets the CSS class name to apply to the selected date's cell. String
selectedDate Date to display as selected. java.util.Date
showDate Date to display calendar for (defaults to today). java.util.Date
tableClass Sets the CSS class name to apply to the calendar table. String
tableId Sets the CSS ID to apply to the calendar table. String
todayClass Sets the CSS class name to apply to the today's date cell. String
weekendClass Sets the CSS class name to apply to the weekend date cells. String

<ui:calendar-day>

Sets parameters for one or all calendar days.

Can contain:JSP

Attributes

Name Description Type
day Day of month (1-31), not specified means set defaults. int
dayClass Sets the CSS class name to apply to this day cell. String
dayId Sets the CSS id to apply to this day cell. String
dayParam Sets the name of the parameter to encode day into. String
encodeLink Sets whether to encode month, day, year into URL (defaults to true). String
link Sets the URL to display for this day. String
monthParam Sets the name of the parameter to encode month into. String
showLink Sets whether to show links or not (defaults to true). boolean
title Sets the title to add to this link. String
yearParam Sets the name of the parameter to encode year into. String

<ui:calendar-heading>

Renders an XHTML Calendar heading.

Can contain:EMPTY

Attributes

Name Description Type
capitalizeMonths If true, month captions will be capitalized. boolean
captionFormat Sets the DateFormat to show above the calendar. String
encodeNextLink Sets whether to encode month and year into next URL (defaults to true). boolean
encodePrevLink Sets whether to encode month and year into previous URL (defaults to true). boolean
monthParam Sets the name of the parameter to encode month into prev/next nav links. String
nextClass Sets the CSS class name to apply to the next month link. String
nextContent Sets the content to display for the next month link. String
nextId Sets the CSS id to apply to the next month link. String
nextLink Sets the URL to use for the next month link. String
nextTitle Sets the title to add to the next month link. String
prevClass Sets the CSS class name to apply to the previous month link. String
prevContent Sets the content to display for the previous month link. String
prevId Sets the CSS id to apply to the previous month link. String
prevLink Sets the URL to use for the previous month link. String
prevTitle Sets the title to add to the previous month link. String
showDate Date to display calendar for (defaults to today). java.util.Date
showNextLink Sets whether to show next link (defaults to true). boolean
showPrevLink Sets whether to show previous link (defaults to true). boolean
yearParam Sets the name of the parameter to encode year into prev/next nav links. String

<ui:pager>

Renders an XHTML Pager control.

Can contain:EMPTY

Attributes

Name Description Type
count* Total number of items. int
limit* Number of items per page. int
limitParam Parameter name to use for limit (defaults to 'limit'). String
link URL to use when generating pager links (defaults to current page). String
maxLinks Number of links (in either direction) to display. Defaults to 10. int
nextContent HTML content to use for the next link (defaults to a right angle quote). String
prevContent HTML content to use for the previous link (defaults to a left angle quote). String
start* Starting element number int
startParam Parameter name to use for start (defaults to 'start'). String

URL - version 1.0

URL-manipulation tag library.

Namespace definition: xmlns:url="http://randomcoder.org/tags-url"

Tags

  • addParam Cooperates with url:modify to add a parameter
  • clearParams Cooperates with url:modify to remove all parameters
  • current Renders the current page's URL, optionally to a variable
  • modify Modifies a passed-in URL, optionally adding / removing parameters
  • removeParam Cooperates with url:modify to remove a parameter
  • setParam Cooperates with url:modify to set a parameter (equivalent to removing, then adding)

Required attributes are marked with a*

<url:addParam>

Cooperates with url:modify to add a parameter.

Can contain:JSP

Attributes

Name Description Type
name* Name of the parameter to add. String
value Value of the parameter to add. String

<url:clearParams>

Cooperates with url:modify to remove all parameters.

Can contain:EMPTY

This tag has no attributes.

<url:current>

Renders the current page's URL, optionally to a variable.

Can contain:EMPTY

Attributes

Name Description Type
scope Scope for var. String
var Name of the exported scoped variable for the processed url. The type of the scoped variable is String. String

<url:modify>

Modifies a passed-in URL, optionally adding / removing parameters.

Can contain:JSP

Attributes

Name Description Type
scope Scope for var. String
value URL to modify (defaults to current page). String
var Name of the exported scoped variable for the processed url. The type of the scoped variable is String. String

<url:removeParam>

Cooperates with url:modify to remove a parameter.

Can contain:EMPTY

Attributes

Name Description Type
name* Name of the parameter to remove. String

<url:setParam>

Cooperates with url:modify to set a parameter (equivalent to removing, then adding).

Can contain:JSP

Attributes

Name Description Type
name* Name of the parameter to set. String
value Value of the parameter to set. String

Input - version 1.0

JSTL-compatible tag library to handle XHTML form input.

Namespace definition: xmlns:input="http://randomcoder.org/tags-input"

Tags

  • button JSP equivalent of XHTML &lt;input type="button" /&gt; tag
  • checkbox JSP equivalent of XHTML &lt;input type="checkbox" /&gt; tag
  • file JSP equivalent of XHTML &lt;input type="file" /&gt; tag
  • hidden JSP equivalent of XHTML &lt;input type="hidden" /&gt; tag
  • image JSP equivalent of XHTML &lt;input type="image" /&gt; tag
  • option JSP equivalent of XHTML &lt;option /&gt; tag
  • password JSP equivalent of XHTML &lt;input type="password" /&gt; tag
  • radio JSP equivalent of XHTML &lt;input type="radio" /&gt; tag
  • reset JSP equivalent of XHTML &lt;input type="reset" /&gt; tag
  • select JSP equivalent of XHTML &lt;select /&gt; tag
  • selected-value Alternative way to mark select tag's values
  • submit JSP equivalent of XHTML &lt;input type="submit" /&gt; tag
  • text JSP equivalent of XHTML &lt;input type="text" /&gt; tag
  • textarea JSP equivalent of XHTML &lt;textarea /&gt; tag

Required attributes are marked with a*

<input:button>

JSP equivalent of XHTML &lt;input type="button" /&gt; tag.

Can contain:empty

Example

<input:button name="button" id="button" onclick="doSomething()" />

Attributes

Name Description Type
accesskey XHTML attribute String
dir XHTML attribute String
disabled XHTML attribute String
lang XHTML attribute String
name XHTML attribute String
onblur XHTML attribute String
onchange XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onfocus XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
onselect XHTML attribute String
readonly XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "id" attribute, renamed to avoid collisions String
tabindex XHTML attribute String
title XHTML attribute String
value XHTML attribute String

<input:checkbox>

JSP equivalent of XHTML &lt;input type="checkbox" /&gt; tag.

Can contain:empty

Example

<input:checkbox name="checkbox" id="checkbox" checked="${checkbox == 'value1'}" value="value1" />

Attributes

Name Description Type
accesskey XHTML attribute String
checked XHTML attribute String
dir XHTML attribute String
disabled XHTML attribute String
lang XHTML attribute String
name* XHTML attribute String
onblur XHTML attribute String
onchange XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onfocus XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
onselect XHTML attribute String
readonly XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "id" attribute, renamed to avoid collisions String
tabindex XHTML attribute String
title XHTML attribute String
value XHTML attribute String

<input:file>

JSP equivalent of XHTML &lt;input type="file" /&gt; tag.

Can contain:empty

Example

<input:file name="file" id="file" />

Attributes

Name Description Type
accept XHTML attribute String
accesskey XHTML attribute String
dir XHTML attribute String
disabled XHTML attribute String
lang XHTML attribute String
name* XHTML attribute String
onblur XHTML attribute String
onchange XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onfocus XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
onselect XHTML attribute String
readonly XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "id" attribute, renamed to avoid collisions String
tabindex XHTML attribute String
title XHTML attribute String

<input:hidden>

JSP equivalent of XHTML &lt;input type="hidden" /&gt; tag.

Can contain:empty

Example

<input:hidden name="hidden" id="hidden" value="${hidden}" />

Attributes

Name Description Type
accesskey XHTML attribute String
dir XHTML attribute String
disabled XHTML attribute String
lang XHTML attribute String
name* XHTML attribute String
onblur XHTML attribute String
onchange XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onfocus XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
onselect XHTML attribute String
readonly XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "id" attribute, renamed to avoid collisions String
tabindex XHTML attribute String
title XHTML attribute String
value XHTML attribute String

<input:image>

JSP equivalent of XHTML &lt;input type="image" /&gt; tag.

Can contain:empty

Example

<input:image name="image" id="image" src="image.jpg" value="${image}" />

Attributes

Name Description Type
accesskey XHTML attribute String
align XHTML attribute String
alt XHTML attribute String
dir XHTML attribute String
disabled XHTML attribute String
lang XHTML attribute String
name* XHTML attribute String
onblur XHTML attribute String
onchange XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onfocus XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
onselect XHTML attribute String
readonly XHTML attribute String
src XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "style" attribute, renamed to avoid collisions String
tabindex XHTML attribute String
title XHTML attribute String
usemap XHTML attribute String

<input:option>

JSP equivalent of XHTML &lt;option /&gt; tag.

Can contain:empty

Example

<input:option text="Option 1" value="option1" id="option1" />

Attributes

Name Description Type
dir XHTML attribute String
disabled XHTML attribute String
label XHTML attribute String
lang XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "id" attribute, renamed to avoid collisions String
text* Text to display in select box. String
title XHTML attribute String
value XHTML attribute String

<input:password>

JSP equivalent of XHTML &lt;input type="password" /&gt; tag.

Can contain:empty

Example

<input:password name="password" id="password" value="${password}" />

Attributes

Name Description Type
accesskey XHTML attribute String
dir XHTML attribute String
disabled XHTML attribute String
lang XHTML attribute String
maxlength XHTML attribute String
name* XHTML attribute String
onblur XHTML attribute String
onchange XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onfocus XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
onselect XHTML attribute String
readonly XHTML attribute String
size XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "id" attribute, renamed to avoid collisions String
tabindex XHTML attribute String
title XHTML attribute String
value XHTML attribute String

<input:radio>

JSP equivalent of XHTML &lt;input type="radio" /&gt; tag.

Can contain:empty

Example

<input:radio name="radio" id="radio" checked="${radio == 'value1'}" value="value1" />

Attributes

Name Description Type
accesskey XHTML attribute String
checked XHTML attribute String
dir XHTML attribute String
disabled XHTML attribute String
lang XHTML attribute String
name* XHTML attribute String
onblur XHTML attribute String
onchange XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onfocus XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
onselect XHTML attribute String
readonly XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "id" attribute, renamed to avoid collisions String
tabindex XHTML attribute String
title XHTML attribute String
value XHTML attribute String

<input:reset>

JSP equivalent of XHTML &lt;input type="reset" /&gt; tag.

Can contain:empty

Example

<input:reset name="reset" id="reset" />

Attributes

Name Description Type
accesskey XHTML attribute String
dir XHTML attribute String
disabled XHTML attribute String
lang XHTML attribute String
name XHTML attribute String
onblur XHTML attribute String
onchange XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onfocus XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
onselect XHTML attribute String
readonly XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "id" attribute, renamed to avoid collisions String
tabindex XHTML attribute String
title XHTML attribute String
value XHTML attribute String

<input:select>

JSP equivalent of XHTML &lt;select /&gt; tag.

Can contain:JSP

Example

<input:select name="select" id="select" value="${select}" />

Attributes

Name Description Type
accesskey XHTML attribute String
dir XHTML attribute String
disabled XHTML attribute String
lang XHTML attribute String
multiple XHTML attribute String
name* XHTML attribute String
onblur XHTML attribute String
onchange XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onfocus XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
onselect XHTML attribute String
readonly XHTML attribute String
size XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "id" attribute, renamed to avoid collisions String
tabindex XHTML attribute String
title XHTML attribute String
value XHTML attribute String

<input:selected-value>

Alternative way to mark select tag's values.

Can contain:empty

Attributes

Name Description Type
value* Selected value. String

<input:submit>

JSP equivalent of XHTML &lt;input type="submit" /&gt; tag.

Can contain:empty

Example

<input:submit name="submit" id="submit" value="Submit" />

Attributes

Name Description Type
accesskey XHTML attribute String
dir XHTML attribute String
disabled XHTML attribute String
lang XHTML attribute String
name XHTML attribute String
onblur XHTML attribute String
onchange XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onfocus XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
onselect XHTML attribute String
readonly XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "id" attribute, renamed to avoid collisions String
tabindex XHTML attribute String
title XHTML attribute String
value XHTML attribute String

<input:text>

JSP equivalent of XHTML &lt;input type="text" /&gt; tag.

Can contain:empty

Example

<input:text name="text" id="text" value="${text}" />

Attributes

Name Description Type
accesskey XHTML attribute String
dir XHTML attribute String
disabled XHTML attribute String
lang XHTML attribute String
maxlength XHTML attribute String
name* XHTML attribute String
onblur XHTML attribute String
onchange XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onfocus XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
onselect XHTML attribute String
readonly XHTML attribute String
size XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "id" attribute, renamed to avoid collisions String
tabindex XHTML attribute String
title XHTML attribute String
value XHTML attribute String

<input:textarea>

JSP equivalent of XHTML &lt;textarea /&gt; tag.

Can contain:empty

Example

<input:textarea name="textarea" styleId="textarea" value="${textarea}" />

Attributes

Name Description Type
accesskey XHTML attribute String
cols XHTML attribute String
dir XHTML attribute String
disabled XHTML attribute String
lang XHTML attribute String
name* XHTML attribute String
onblur XHTML attribute String
onchange XHTML attribute String
onclick XHTML attribute String
ondblclick XHTML attribute String
onfocus XHTML attribute String
onkeydown XHTML attribute String
onkeypress XHTML attribute String
onkeyup XHTML attribute String
onmousedown XHTML attribute String
onmousemove XHTML attribute String
onmouseout XHTML attribute String
onmouseover XHTML attribute String
onmouseup XHTML attribute String
onselect XHTML attribute String
readonly XHTML attribute String
rows XHTML attribute String
style XHTML attribute String
styleClass XHTML "class" attribute, renamed to avoid collisions String
styleId XHTML "id" attribute, renamed to avoid collisions String
tabindex XHTML attribute String
title XHTML attribute String
value Field value of text area String

Escape - version 1.0

EL escape functions.

Namespace definition: xmlns:rcesc="http://randomcoder.org/tags-escape"

EL Functions

Required attributes are marked with a*

rcesc:attribute(java.lang.String)

Function class: org.randomcoder.taglibs.functions.EscapeElFunctions

Function signature: java.lang.String attribute(java.lang.String)

Attribute escape

rcesc:jsDouble(java.lang.String)

Function class: org.randomcoder.taglibs.functions.EscapeElFunctions

Function signature: java.lang.String jsDouble(java.lang.String)

JavaScript double-quote escape

rcesc:jsSingle(java.lang.String)

Function class: org.randomcoder.taglibs.functions.EscapeElFunctions

Function signature: java.lang.String jsSingle(java.lang.String)

JavaScript single-quote escape

rcesc:urlencode(java.lang.String)

Function class: org.randomcoder.taglibs.functions.EscapeElFunctions

Function signature: java.lang.String urlencode(java.lang.String)

URL encode