本文整理汇总了Java中javax.servlet.jsp.tagext.JspFragment.invoke方法的典型用法代码示例。如果您正苦于以下问题:Java JspFragment.invoke方法的具体用法?Java JspFragment.invoke怎么用?Java JspFragment.invoke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.servlet.jsp.tagext.JspFragment
的用法示例。
在下文中一共展示了JspFragment.invoke方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
/**
* Create the form tag.
*
* @see javax.servlet.jsp.tagext.SimpleTagSupport#doTag()
*/
public void doTag() throws JspException {
context = (PageContext) getJspContext();
JspWriter out = context.getOut();
try {
out.print("<script ");
out.print(getJavascriptAttributes());
out.print(">");
JspFragment body = getJspBody();
if( body != null)
{
body.invoke(null);
}
out.print("</script>");
} catch (Exception e) {
throw new JspException(e);
}
}
示例2: doTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
public void doTag() throws JspException {
JspFragment body = getJspBody();
PageContext pageContext = (PageContext) getJspContext();
JspWriter o = pageContext.getOut();
try {
o.print("<th ");
o.print(getAttributes());
o.print(">");
if( body != null )
{
body.invoke(null);
}
o.print("</th>");
} catch (Exception e) {
throw new JspException(e);
}
}
示例3: doTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
public void doTag() throws JspException {
JspFragment body = getJspBody();
PageContext pageContext = (PageContext) getJspContext();
JspWriter o = pageContext.getOut();
try {
o.print("<thead ");
o.print(getAttributes());
o.print(">");
if( body != null)
{
body.invoke(null);
}
o.print("</thead>");
} catch (Exception e) {
throw new JspException(e);
}
}
示例4: doTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
public void doTag() throws JspException {
JspFragment body = getJspBody();
PageContext pageContext = (PageContext) getJspContext();
JspWriter out = pageContext.getOut();
try {
out.print("<th ");
out.print(getAttributes());
out.print(">\n");
if( body!= null )
{
body.invoke(null);
}
out.print("</th>");
} catch (Exception e) {
throw new JspException(e);
}
}
示例5: doTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
public void doTag() throws JspException {
log.debug("do tag called");
JspFragment body = getJspBody();
PageContext pageContext = (PageContext) getJspContext();
JspWriter o = pageContext.getOut();
try {
o.print("<table ");
o.print(getHtmlTableAttributes());
o.print(">");
if( body != null )
{
body.invoke(null);
}
o.print("</table>");
} catch (Exception e) {
throw new JspException(e);
}
}
示例6: doTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
/**
* Create the form tag.
*
* @see javax.servlet.jsp.tagext.SimpleTagSupport#doTag()
*/
public void doTag() throws JspException {
JspFragment body = getJspBody();
PageContext pageContext = (PageContext) getJspContext();
JspWriter out = pageContext.getOut();
try {
out.print("\n<form ");
out.print(getAttributes());
out.print(">");
if( body!= null )
{
out.print("<input type=\"hidden\" name=\"formName\" value=\"" + getName() + "\"/>");
body.invoke(null);
}
out.print("</form>");
} catch (Exception e) {
throw new JspException(e);
}
}
示例7: doTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
/**
* Create the form tag.
*
* @see javax.servlet.jsp.tagext.SimpleTagSupport#doTag()
*/
public void doTag() throws JspException {
PageContext context = (PageContext) getJspContext();
o = context.getOut();
JspFragment body = getJspBody();
try
{
o.print("<div " + getAttributes().toString() + ">");
if(body != null)
{
body.invoke(null);
}
o.print("</div>");
}
catch(Exception e)
{
throw new JspException("error occured in DivTag", e);
}
}
示例8: doTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
public void doTag() throws JspException {
JspFragment body = getJspBody();
PageContext pageContext = (PageContext) getJspContext();
JspWriter o = pageContext.getOut();
try {
o.print("<caption ");
o.print(getAttributes());
o.print(">");
if(body != null)
{
body.invoke(null);
}
o.print("</caption>");
} catch (Exception e) {
throw new JspException(e);
}
}
示例9: executeTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
@Override
public Tag executeTag() throws JspException, IOException {
Boolean testValue;
Object tagValue = getTagValue(test);
if (tagValue instanceof Boolean) {
testValue = (Boolean) tagValue;
} else {
testValue = Boolean.valueOf((String) tagValue);
}
if (testValue != null && testValue) {
JspFragment body = getJspBody();
if (body != null) {
body.invoke(null);
}
}
return null;
}
示例10: executeTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
@Override
public Tag executeTag() throws JspException, IOException {
JspTag parent = getParent();
if (!(parent instanceof FormTagHandler) && !(parent instanceof RestTagHandler)) {
throw ConstraintTagException.fromConstraint("recaptcha", "Tag must be placed inside [form] or [rest] tag");
}
// Just to call nested tags
JspFragment body = getJspBody();
if (body != null) {
body.invoke(null);
}
setRandomId("recaptcha");
// ReCaptcha V2
if (version.equals(ReCaptchaHandler.RECAPTCHA_V2)) {
return executeRecaptchaV2(parent);
}
// ReCaptcha V1
return executeRecaptchaV1(parent);
}
示例11: executeTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
@Override
public Tag executeTag() throws JspException, IOException {
// Just to call nested tags
JspFragment body = getJspBody();
if (body != null) {
body.invoke(null);
}
Tag inputPart = executeInputPart();
Tag listPart = executeListPart();
appendDocScript(getAjaxFunction());
Set set = new Set();
set.addTag(inputPart);
set.addTag(listPart);
return set;
}
示例12: invokeFragmentIfNeeded
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
private String invokeFragmentIfNeeded(
JspFragment fragment,
String defaultValue,
int currentIndex) throws JspException {
PageContext p = pageContext;
StringWriter w = new StringWriter();
if (fragment != null) {
if (currentIndex > 0) p.setAttribute(var, currentIndex);
try {
fragment.invoke(w);
} catch (IOException e) {throw new JspException(e);}
if (currentIndex > 0) p.removeAttribute(var);
} else {
w.append(Strings.substitute(
defaultValue,
Maps.hash(var, String.valueOf(currentIndex))));
}
return w.toString();
}
示例13: executeTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
@Override
public Tag executeTag() throws JspException, IOException {
StringWriter sw = new StringWriter();
JspFragment body = getJspBody();
if (body != null) {
body.invoke(sw);
}
Td td = new Td();
td.addAttribute("id", id)
.addAttribute("style", getTagValue(style))
.addAttribute("class", getTagValue(styleClass))
.addText(executeExpressions(sw.toString()));
return td;
}
示例14: executeTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
@Override
public Tag executeTag() throws JspException, IOException {
// Look for parameters
JspFragment body = getJspBody();
if (body != null) {
body.invoke(null);
}
String resource = (String) getTagValue(res);
String resourceKey = (String) getTagValue(key);
String message = getResourceString(resource, resourceKey);
if (!params.isEmpty()) {
message = formatText(message, params);
}
printOutput(message);
return null;
}
示例15: doTag
import javax.servlet.jsp.tagext.JspFragment; //导入方法依赖的package包/类
public void doTag() throws JspException {
try {
// Writer für die Ausgabe
JspWriter out = getJspContext().getOut();
out.println("Echo:");
// Ausgabe des Body
JspFragment f = getJspBody();
if (f != null) {
f.invoke(out);
}
} catch (IOException e) {
throw new JspException(e.getMessage());
}
}