org.mmbase.bridge.jsp.taglib.pageflow
Class UrlTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.mmbase.bridge.jsp.taglib.ContextReferrerTag
              extended byorg.mmbase.bridge.jsp.taglib.CloudReferrerTag
                  extended byorg.mmbase.bridge.jsp.taglib.pageflow.UrlTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, ParamHandler, java.io.Serializable, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
IncludeTag, LeafFileTag, RedirectTag, TreeFileTag

public class UrlTag
extends CloudReferrerTag
implements ParamHandler

A Tag to produce an URL with parameters. It can use 'context' parameters easily.

Version:
$Id: UrlTag.java,v 1.62.2.3 2004/07/05 17:20:03 michiel Exp $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Nested Class Summary
protected static class UrlTag.Param
           
 
Field Summary
protected  java.util.List extraParameters
           
protected  Attribute page
           
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
contextId, EVAL_BODY, helper, id, pageContextTag, referid, writerid
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
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
UrlTag()
           
 
Method Summary
 void addParameter(java.lang.String key, java.lang.Object value)
           
 int doAfterBody()
           
protected  void doAfterBodySetValue()
           
 int doEndTag()
           
protected  boolean doMakeRelative()
          Whether URL must be generatored relatively.
 int doStartTag()
           
protected  java.lang.String getPage()
           
protected  java.lang.String getUrl()
           
protected  java.lang.String getUrl(boolean e)
           
protected  java.lang.String getUrl(boolean writeamp, boolean encode)
          Returns url with the extra parameters (of referids and sub-param-tags).
protected  java.lang.StringBuffer makeRelative(java.lang.StringBuffer show)
          If it would be nice that an URL starting with '/' would be generated relatively to the current request URL, then this method can do it.
 void setEscapeamps(java.lang.String e)
           
 void setPage(java.lang.String p)
           
 void setReferids(java.lang.String r)
           
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.CloudReferrerTag
findCloudProvider, findCloudProvider, getCloud, getCloudContext, getCloudVar, getNode, getNodeOrNull, setCloud
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
findParentTag, findParentTag, findParentTag, findParentTag, findWriter, findWriter, getAttribute, getAttributeBoolean, getAttributeInteger, getAttributeInteger, getAttributeValue, getContentTag, getContextProvider, getContextTag, getId, getLocale, getObject, getPageContext, getReferid, getString, getWriterValue, haveBody, release, setContext, setEscape, setId, setJspvar, setPageContext, setReferid, setVartype, setWrite, setWriter
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setParent
 

Field Detail

extraParameters

protected java.util.List extraParameters

page

protected Attribute page
Constructor Detail

UrlTag

public UrlTag()
Method Detail

setReferids

public void setReferids(java.lang.String r)
                 throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

setPage

public void setPage(java.lang.String p)
             throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

setEscapeamps

public void setEscapeamps(java.lang.String e)
                   throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

addParameter

public void addParameter(java.lang.String key,
                         java.lang.Object value)
                  throws javax.servlet.jsp.JspTagException
Specified by:
addParameter in interface ParamHandler
Throws:
javax.servlet.jsp.JspTagException

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspTagException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Throws:
javax.servlet.jsp.JspTagException

getPage

protected java.lang.String getPage()
                            throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

makeRelative

protected java.lang.StringBuffer makeRelative(java.lang.StringBuffer show)
If it would be nice that an URL starting with '/' would be generated relatively to the current request URL, then this method can do it. If the URL is not used to write to (this) page, then you probably don't want that. The behaviour can be overruled by starting the URL with two '/'s.

Since:
MMBase-1.7

doMakeRelative

protected boolean doMakeRelative()
Whether URL must be generatored relatively. This default to false, and can be configured with the servlet context init parameter 'mmbase.taglib.url.makerelative'. It can be useful to be sure that url's are relative, if e.g. the context path is taken away in an URL-rewrite (e.g. by proxy). This might give problems with redirects, but if you happen to solve that too, or don't do that...

Since:
MMBase-1.7

getUrl

protected java.lang.String getUrl(boolean writeamp,
                                  boolean encode)
                           throws javax.servlet.jsp.JspTagException
Returns url with the extra parameters (of referids and sub-param-tags).

Throws:
javax.servlet.jsp.JspTagException

getUrl

protected java.lang.String getUrl()
                           throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

getUrl

protected java.lang.String getUrl(boolean e)
                           throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

doAfterBodySetValue

protected void doAfterBodySetValue()
                            throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspTagException
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class ContextReferrerTag
Throws:
javax.servlet.jsp.JspTagException


MMBase build 1.7.1.20041002