要命了,帮我~~~~~~~~~~~~~~

05-04-07 angel_jdon

用tomcat5.0.27 [jsp:include page=".do"/]问题

a2.jsp
----------------------------------------------------------------------

[%@ page contentType="text/html; charset=gb2312" language="java"%]

[html]

[head]

[title][/title]

[meta http-equiv="Content-Type" content="text/html; charset=gb2312"]

[/head]

[body]

[jsp:include page="../temp.do"/]
a2

[/body]

[/html]

temp.java
----------------------------------------------------------------------
package web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class temp extends Action {
public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm,HttpServletRequest request,javax.servlet.http.HttpServletResponse response) throws Exception {
return actionMapping.findForward("success");
}
}

struts-config.xml
-----------------------------------------------------------------------
[action path="/temp" type="web.temp" scope="request" validate="false"]
[forward name="success" path="/include/head.jsp" redirect="false"/]
[/action]

head.jsp
----------------------------------------------------------------------

[%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %]

[html]

[head]

[title][/title]

[meta http-equiv="Content-Type" content="text/html; charset=gb2312"]

[/head]

[body]
head

[/body]

[/html]
========================================================================
运行时报错:
2005-4-7 9:33:57 org.apache.jasper.runtime.PageContextImpl release
警告: Internal error flushing the buffer in release()

页面显示:
head
----
a2不显示,也就是说,在[jsp:include]之后的内容不显示,我怀疑是上面的错误导致,但单运行temp.do又没错,也不报错.
而且resin都能显示出a2,可能是纠错能力强,55555,怎么办呀,错误是什么问题.有什么办法解决...急死我了..
include 调用.do文件就出错....晕

banq
2005-04-16 13:44

既然用了Struts,为什么还在Jsp页面中有如下语句?

[%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %]


import="java.sql.*"是笔误吧!

supertrouper
2005-04-18 00:45

你的action没有配置Formbean