本文整理汇总了Java中javax.servlet.jsp.tagext.JspFragment类的典型用法代码示例。如果您正苦于以下问题:Java JspFragment类的具体用法?Java JspFragment怎么用?Java JspFragment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JspFragment类属于javax.servlet.jsp.tagext包,在下文中一共展示了JspFragment类的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("<a ");
o.print(getAttributes());
o.print(">");
if( body != null )
{
body.invoke(null);
}
o.print("</a>");
} catch (Exception e) {
throw new JspException(e);
}
}
示例3: doTag
import javax.servlet.jsp.tagext.JspFragment; //导入依赖的package包/类
public void doTag() throws JspException {
TableRowTag rowTag = (TableRowTag) findAncestorWithClass(this,
TableRowTag.class);
ColumnTag columnTag = (ColumnTag)findAncestorWithClass(this,
ColumnTag.class);
if (columnTag == null) {
throw new JspTagException("the <ur:columnContent> tag must"
+ " be nested within a <ur:column> tag");
}
if (rowTag.isProcessColumn())
{
JspFragment body = getJspBody();
try {
body.invoke(null);
} catch (IOException e) {
e.printStackTrace();
throw new JspException("Error in columnContent", e);
}
}
}
示例4: 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);
}
}
示例5: 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);
}
}
示例6: 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);
}
}
示例7: 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("<td ");
o.print(getAttributes());
o.print(">");
if( body != null)
{
body.invoke(null);
}
o.print("</td>");
} catch (Exception e) {
throw new JspException(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: 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("<tr ");
o.print(getAttributes());
o.print(">");
if( body != null )
{
body.invoke(null);
}
o.print("</tr>");
} catch (Exception e) {
throw new JspException(e);
}
}
示例10: 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);
}
}
示例11: 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);
}
}
示例12: 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);
}
}
示例13: doTag
import javax.servlet.jsp.tagext.JspFragment; //导入依赖的package包/类
@SuppressWarnings ( "unchecked" )
@Override
public void doTag () throws JspException, IOException
{
final Map<String, LinkedList<JspFragment>> stacks = (Map<String, LinkedList<JspFragment>>)getJspContext ().getAttribute ( PushTag.ATTR, PageContext.REQUEST_SCOPE );
if ( stacks == null )
{
return;
}
final LinkedList<JspFragment> stack = stacks.get ( this.name );
if ( stack == null )
{
return;
}
for ( final JspFragment fragment : stack )
{
fragment.invoke ( getJspContext ().getOut () );
}
stack.clear ();
}
示例14: setJspBody
import javax.servlet.jsp.tagext.JspFragment; //导入依赖的package包/类
@Override
@SuppressWarnings ( "unchecked" )
public void setJspBody ( final JspFragment jspBody )
{
super.setJspBody ( jspBody );
Map<String, LinkedList<JspFragment>> stacks = (Map<String, LinkedList<JspFragment>>)getJspContext ().getAttribute ( ATTR, PageContext.REQUEST_SCOPE );
if ( stacks == null )
{
stacks = new HashMap<> ();
getJspContext ().setAttribute ( ATTR, stacks, PageContext.REQUEST_SCOPE );
}
LinkedList<JspFragment> stack = stacks.get ( this.name );
if ( stack == null )
{
stack = new LinkedList<> ();
stacks.put ( this.name, stack );
}
stack.add ( jspBody );
}
示例15: 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;
}