本文整理汇总了Java中org.apache.struts.taglib.TagUtils.write方法的典型用法代码示例。如果您正苦于以下问题:Java TagUtils.write方法的具体用法?Java TagUtils.write怎么用?Java TagUtils.write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.struts.taglib.TagUtils
的用法示例。
在下文中一共展示了TagUtils.write方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doStartTag
import org.apache.struts.taglib.TagUtils; //导入方法依赖的package包/类
/**
* Generate the required input tag.
* <p>
* Support for indexed property since Struts 1.1
*
* @exception JspException
* if a JSP exception has occurred
*/
public int doStartTag() throws JspException {
TagUtils tagUtils = TagUtils.getInstance();
if (isAllowEdits()) {
return super.doStartTag();
} else {
// Look up the requested property value
Object value =
// RequestUtils.lookup(pageContext, name, property, null);
tagUtils.lookup(pageContext, name, property, null);
if (value == null)
return (SKIP_BODY); // Nothing to output
String output = value.toString();
if (getStyleClass() != null) {
output = "<span class=" + getStyleClass() + ">" + output
+ "</span>";
}
output = output + "\r\n" + "<INPUT type=\"hidden\" name=\""
+ getProperty() + "\"" + " value=\"" + value.toString()
+ "\"" + ">";
// ResponseUtils.write(pageContext, output);
tagUtils.write(pageContext, output);
}
return (EVAL_BODY_BUFFERED);
}
示例2: renderButton
import org.apache.struts.taglib.TagUtils; //导入方法依赖的package包/类
/**
* Renders a button control as a hyperlink for the page control.
*
* @param render Whether or not to render the control.
* @param page The page number that the control links to.
* @param index The page secondary index that the control links to.
* @param openDelim The opening delimeter to put around the control. (A snippet of HTML).
* @param url The url of the page action handler.
* @param text The text to render the control.
* @param active Whether or not the control should be made active.
*
* @throws JspException If an error occurs whilst writing out the response.
*/
private void renderButton(boolean render, int page, int index, String openDelim, String url, String text,
boolean active) throws JspException
{
log.fine(
"private void renderButton(boolean render, int page, int index, String openDelim, String url, String text, boolean active): called");
log.fine("render = " + render);
log.fine("page = " + page);
log.fine("index = " + index);
log.fine("openDelim = " + openDelim);
log.fine("url = " + url);
log.fine("text = " + text);
log.fine("active = " + active);
TagUtils tagUtils = TagUtils.getInstance();
if (render)
{
tagUtils.write(pageContext, openDelim);
// Only render the button as active if the active flag is set.
if (active)
{
tagUtils.write(pageContext,
"<a href=\"" + url + "?varName=" + name + "&number=" + page + "&index=" + index + "\">" + text +
"</a>");
}
// Render an inactive button.
else
{
tagUtils.write(pageContext, text);
}
tagUtils.write(pageContext, closeDelim);
}
}
示例3: doStartTag
import org.apache.struts.taglib.TagUtils; //导入方法依赖的package包/类
/**
* Render the beginning of this select tag.
* <p>
* Support for indexed property since Struts 1.1
*
* @exception JspException if a JSP exception has occurred
*/
public int doStartTag() throws JspException {
TagUtils tagUtils = TagUtils.getInstance();
if (isAllowEdits()) {
return super.doStartTag();
} else {
// Look up the requested property value
Object value =
// RequestUtils.lookup(pageContext, name, property, null);
tagUtils.lookup(pageContext, name, property, null);
if (value == null)
return (SKIP_BODY); // Nothing to output
String output = value.toString();
if (getStyleClass() != null) {
output = "<span class=" + getStyleClass() + ">" + output
+ "</span>";
}
output = output + "\r\n" + "<INPUT type=\"hidden\" name=\""
+ getProperty() + "\"" + " value=\"" + value.toString()
+ "\"" + ">";
// ResponseUtils.write(pageContext, output);
tagUtils.write(pageContext, output);
}
return (EVAL_BODY_BUFFERED);
}