JAVA类文件中使用OUT

来源:互联网 发布:windows版本有哪些 编辑:程序博客网 时间:2024/05/20 07:13

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.yc.base.util.MessageResources;
import com.yc.ycportal.util.Constants;

 

 private static Log log = LogFactory.getLog("ContentTag.class");


  JspWriter writer = pageContext.getOut();
  try
  {
   writer.print("<div id=/"print_content/">/n");
   writer.print(
    (String) pageContext.getRequest().getAttribute(
     Constants.ACTION_RESULT));
   writer.print("/n</div>");
  }
  catch (IOException e)
  {
   log.error("write.io:" + e.toString());
   e.printStackTrace();
   //   throw new JspException(
   //    messages.getMessage("write.tag.io", e.toString()));
  }

原创粉丝点击