当前位置: 技术问答>java相关
问题严重啊!!!tomcat下正常,Weblogic下产生错误---->>>>关于Iteration Tag的!!
来源: 互联网 发布时间:2015-01-25
本文导语: 问题1. weblogic6下在doStartTag()方法中return 的值不论为咋,doEndTag()均不会被call到,why????????????即结果为 Now time is Tue Aug 21 11:22:11 CST 2001________ 在tomcat下却运行良好,即结果为 Now time is Tue Aug 21 11:22:11 CST ...
问题1. weblogic6下在doStartTag()方法中return 的值不论为咋,doEndTag()均不会被call到,why????????????即结果为
Now time is Tue Aug 21 11:22:11 CST 2001________
在tomcat下却运行良好,即结果为
Now time is Tue Aug 21 11:22:11 CST 2001________
aaaa0
aaaa1
aaaa2
aaaa3
aaaa4
aaaa5
aaaa6
aaaa7
aaaa8
aaaa9
aaaa
问题2.weblogic6下在doStartTag()方法中return 的值不能为EVAL_BODY_INCLUDE, 而在tomcat下却可以,why?????????????
错误为运行期产生,LOG如下:
####
javax.servlet.jsp.JspTagException: Since tag class mytag.ShowtimeTag2 implements BodyTag, it cannot return Tag.EVAL_BODY_INCLUDE
at jsp_servlet._testtag2._jspService(_testtag2.java:106)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:213)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:1265)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1622)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
//////下面是TAG实现文件ShowtimeTag.java
package mytag;
import java.io.*;
import java.util.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class ShowtimeTag extends BodyTagSupport {
int iii=0;
public int doStartTag() throws JspException {
StringBuffer html = new StringBuffer();
java.util.Date nowdate=new java.util.Date();
String dateStr=nowdate.toString();
dateStr+="________
";
html.append(dateStr);
try {
pageContext.getOut().write(html.toString());
} catch (IOException ioe) {
throw new JspException(ioe.getMessage());
}
return EVAL_BODY_TAG;//SKIP_BODY;//EVAL_BODY_INCLUDE;这题就在这里!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
public int doAfterBody() throws JspException {
StringBuffer html = new StringBuffer();
String dateStr = "";
dateStr+=iii;
dateStr+="
";
html.append(dateStr);
if (iii++
Now time is Tue Aug 21 11:22:11 CST 2001________
在tomcat下却运行良好,即结果为
Now time is Tue Aug 21 11:22:11 CST 2001________
aaaa0
aaaa1
aaaa2
aaaa3
aaaa4
aaaa5
aaaa6
aaaa7
aaaa8
aaaa9
aaaa
问题2.weblogic6下在doStartTag()方法中return 的值不能为EVAL_BODY_INCLUDE, 而在tomcat下却可以,why?????????????
错误为运行期产生,LOG如下:
####
javax.servlet.jsp.JspTagException: Since tag class mytag.ShowtimeTag2 implements BodyTag, it cannot return Tag.EVAL_BODY_INCLUDE
at jsp_servlet._testtag2._jspService(_testtag2.java:106)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:213)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:1265)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1622)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
//////下面是TAG实现文件ShowtimeTag.java
package mytag;
import java.io.*;
import java.util.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class ShowtimeTag extends BodyTagSupport {
int iii=0;
public int doStartTag() throws JspException {
StringBuffer html = new StringBuffer();
java.util.Date nowdate=new java.util.Date();
String dateStr=nowdate.toString();
dateStr+="________
";
html.append(dateStr);
try {
pageContext.getOut().write(html.toString());
} catch (IOException ioe) {
throw new JspException(ioe.getMessage());
}
return EVAL_BODY_TAG;//SKIP_BODY;//EVAL_BODY_INCLUDE;这题就在这里!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
public int doAfterBody() throws JspException {
StringBuffer html = new StringBuffer();
String dateStr = "";
dateStr+=iii;
dateStr+="
";
html.append(dateStr);
if (iii++