关于tiles问题请教

04-11-16 dreamdecker
使用<tiles:insert attribute="header" />出现以下异常
javax.servlet.ServletException: Error - tag.getAsString : component context is not defined. Check tag syntax

at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)

at org.apache.jsp.login_jsp._jspService(login_jsp.java:94)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)

dreamdecker
2004-11-16 11:22
但是去掉<tiles:insert attribute="header" />又出现
org.apache.jasper.JasperException

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)

at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)

at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)

at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)

at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)

at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)

at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)

at java.lang.Thread.run(Thread.java:534)
配置文件是这样的
<tiles-definitions>
<definition name="site.mainLayout" path="/main.jsp">
<put name="title" value="This is the Title." />
<put name="header" value="/header.jsp" />
<put name="menu" value="/menu.jsp" />
<put name="footer" value="/foot.jsp" />
<put name="body" value="/body.jsp" />
</definition>
</tiles-definitions>

dreamdecker
2004-11-16 11:23
<tiles-definitions>
<definition name="site.mainLayout" path="/main.jsp">
<put name="title" value="This is the Title." />
<put name="header" value="/header.jsp" />
<put name="menu" value="/menu.jsp" />
<put name="footer" value="/foot.jsp" />
<put name="body" value="/body.jsp" />
</definition>
</tiles-definitions>

dreamdecker
2004-11-16 11:24
<tiles-definitions>
<definition name="site.mainLayout" path="/main.jsp">
<put name="title" value="This is the Title." />
<put name="header" value="/header.jsp" />
<put name="menu" value="/menu.jsp" />
<put name="footer" value="/foot.jsp" />
<put name="body" value="/body.jsp" />
</definition>
</tiles-definitions>

banq
2004-11-17 10:26
getAsString标签有问题

张连民
2005-11-18 11:56
检查titls.jar 包是否已经引入.

Jamsa
2005-11-24 11:59
最初的那个报错应该是没有初始化Tiles,比如没有把插件加入到struts-config.xml中

猜你喜欢