如何从 Apache Tiles 模板引用属性列表

发布于 2024-10-17 20:41:00 字数 22032 浏览 5 评论 0原文

我试图在基本模板中定义一个属性列表,其中包含所有 css 链接,子定义将根据需要附加其他 css 链接。我在tiles定义配置文件中定义了列表,并尝试使用template.jsp文件中的列表,但出现以下错误:

org.apache.tiles.template.NoSuchAttributeException: 导入属性时出错。属性 “链接”为空

Tiles 定义文件:

    <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC 
        "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN" 
        "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">       
<tiles-definitions>
    <definition name="master.template"
        template="/WEB-INF/tiles/templates/template.jsp">
        <put-attribute name="title" value="" />
        <put-attribute name="header" value="/WEB-INF/tiles/templates/header.jsp" />
        <put-attribute name="menu" value="/WEB-INF/tiles/templates/menu.jsp" />
        <put-attribute name="body" value="/WEB-INF/views/home.jsp" />
        <put-attribute name="footer" value="/WEB-INF/tiles/templates/footer.jsp" />         
        <put-list-attribute name="links" inherit="true" cascade="true">
            <add-attribute type="string" value="/stles/default.css" />
            <add-attribute type="string" value="/styles/another.css" />
        </put-list-attribute>
    </definition>
    <definition name="home" extends="master.template">
        <put-attribute name="title" value="Welcome Home" />
        <put-attribute name="body" value="/WEB-INF/views/home.jsp" />
    </definition>    
    <definition name="about" extends="master.template">
        <put-attribute name="title" value="About" />
        <put-attribute name="body" value="/WEB-INF/views/about.jsp" />

    </definition> 
</tiles-definitions>

Template.jsp

<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>    
        <title><tiles:insertAttribute name="title" ignore="true" /></title>         
        <!-- links -->      
        <tiles:useAttribute name="links"/>  
        <c:forEach var="href" items="${items}"> 
        <link type="text/css" rel="stylesheet" href="${href}" />
        </c:forEach>                    
    </head>
    <body>
        <div id="page">
            <div id="header"><tiles:insertAttribute name="header" /></div>
            <div id="menu"><tiles:insertAttribute name="menu" /></div>          
            <div id="body"><tiles:insertAttribute name="body" /></div>
            <div id="footer"><tiles:insertAttribute name="footer" /></div>
        </div>
    </body>
</html>

HTTP ERROR 500

访问 / 时出现问题。原因:

ServletException 包括路径“/WEB-INF/tiles/templates/template.jsp”。

原因:

org.apache.tiles.impl.CannotRenderException: ServletException 包括路径 '/WEB-INF/tiles/templates/template.jsp'。 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:692) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321) 在 org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124) 在 org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) 在 org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031) 在 org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815) 在 org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717) 在 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) 在 org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 在 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) 在 com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) 在 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) 在 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) 在 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) 在 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) 在 com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70) 在 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 在 com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349) 在 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 在 org.mortbay.jetty.Server.handle(Server.java:326) 在 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) 在 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) 在 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) 在 org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) 在 org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) 在 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) 在 org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) 造成原因: org.apache.tiles.util.TilesIOException: ServletException 包括路径 '/WEB-INF/tiles/templates/template.jsp'。 在 org.apache.tiles.servlet.context.ServletUtil.wrapServletException(ServletUtil.java:241) 在 org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:243) 在 org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222) 在 org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44) 在 org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690) ... 37 更多 原因: org.apache.tiles.template.NoSuchAttributeException: 导入属性时出错。属性 “链接”为空 org.apache.tiles.template.ImportAttributeModel.importSingleAttribute(ImportAttributeModel.java:133) 在 org.apache.tiles.template.ImportAttributeModel.getImportedAttributes(ImportAttributeModel.java:78) 在 org.apache.tiles.jsp.taglib.UseAttributeTag.doTag(UseAttributeTag.java:175) 在 org.apache.jsp.WEB_002dINF.tiles.templates.template_jsp._jspService(template_jsp.java:110) 在 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 在 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) 在 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) 在 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) 在 com.google.appengine.tools.development.PrivilegedJspServlet.access$101(PrivilegedJspServlet.java:23) 在 com.google.appengine.tools.development.PrivilegedJspServlet$2.run(PrivilegedJspServlet.java:59) 在 java.security.AccessController.doPrivileged(本机 方法)在 com.google.appengine.tools.development.PrivilegedJspServlet.service(PrivilegedJspServlet.java:57) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 在 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) 在 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) 在 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) 在 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) 在 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) 在 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) 在 com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70) 在 org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327) 在 org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) 在 org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241) ... 42 更多

原因:

org.apache.tiles.util.TilesIOException: ServletException 包括路径 '/WEB-INF/tiles/templates/template.jsp'。 在 org.apache.tiles.servlet.context.ServletUtil.wrapServletException(ServletUtil.java:241) 在 org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:243) 在 org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222) 在 org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44) 在 org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321) 在 org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124) 在 org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) 在 org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031) 在 org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815) 在 org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717) 在 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) 在 org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 在 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) 在 com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) 在 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) 在 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) 在 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) 在 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) 在 com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70) 在 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 在 com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349) 在 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 在 org.mortbay.jetty.Server.handle(Server.java:326) 在 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) 在 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) 在 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) 在 org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) 在 org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) 在 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) 在 org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) 造成原因: org.apache.tiles.template.NoSuchAttributeException: 导入属性时出错。属性 “链接”为空 org.apache.tiles.template.ImportAttributeModel.importSingleAttribute(ImportAttributeModel.java:133) 在 org.apache.tiles.template.ImportAttributeModel.getImportedAttributes(ImportAttributeModel.java:78) 在 org.apache.tiles.jsp.taglib.UseAttributeTag.doTag(UseAttributeTag.java:175) 在 org.apache.jsp.WEB_002dINF.tiles.templates.template_jsp._jspService(template_jsp.java:110) 在 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 在 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) 在 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) 在 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) 在 com.google.appengine.tools.development.PrivilegedJspServlet.access$101(PrivilegedJspServlet.java:23) 在 com.google.appengine.tools.development.PrivilegedJspServlet$2.run(PrivilegedJspServlet.java:59) 在 java.security.AccessController.doPrivileged(本机 方法)在 com.google.appengine.tools.development.PrivilegedJspServlet.service(PrivilegedJspServlet.java:57) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 在 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) 在 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) 在 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) 在 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) 在 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) 在 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) 在 com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70) 在 org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327) 在 org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) 在 org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241) ... 42 更多

原因:

org.apache.tiles.template.NoSuchAttributeException: 导入属性时出错。属性 “链接”为空 org.apache.tiles.template.ImportAttributeModel.importSingleAttribute(ImportAttributeModel.java:133) 在 org.apache.tiles.template.ImportAttributeModel.getImportedAttributes(ImportAttributeModel.java:78) 在 org.apache.tiles.jsp.taglib.UseAttributeTag.doTag(UseAttributeTag.java:175) 在 org.apache.jsp.WEB_002dINF.tiles.templates.template_jsp._jspService(template_jsp.java:110) 在 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 在 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) 在 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) 在 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) 在 com.google.appengine.tools.development.PrivilegedJspServlet.access$101(PrivilegedJspServlet.java:23) 在 com.google.appengine.tools.development.PrivilegedJspServlet$2.run(PrivilegedJspServlet.java:59) 在 java.security.AccessController.doPrivileged(本机 方法)在 com.google.appengine.tools.development.PrivilegedJspServlet.service(PrivilegedJspServlet.java:57) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 在 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) 在 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) 在 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) 在 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) 在 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) 在 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) 在 com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70) 在 org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327) 在 org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) 在 org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241) 在 org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222) 在 org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44) 在 org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627) 在 org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321) 在 org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124) 在 org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) 在 org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031) 在 org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815) 在 org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717) 在 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) 在 org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 在 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) 在 com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) 在 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) 在 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) 在 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) 在 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) 在 com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70) 在 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 在 com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349) 在 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 在 org.mortbay.jetty.Server.handle(Server.java:326) 在 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) 在 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) 在 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) 在 org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) 在 org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) 在 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) 在 org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

I am trying to define an attribute list in the base template that includes all css links and sub definitions would append additional css links as needed. I defined the list in the tiles definition configuration file and attempted to use the list in the template.jsp file, but i get the following error:

org.apache.tiles.template.NoSuchAttributeException:
Error importing attributes. Attribute
'links' is null

Tiles definition file:

    <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC 
        "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN" 
        "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">       
<tiles-definitions>
    <definition name="master.template"
        template="/WEB-INF/tiles/templates/template.jsp">
        <put-attribute name="title" value="" />
        <put-attribute name="header" value="/WEB-INF/tiles/templates/header.jsp" />
        <put-attribute name="menu" value="/WEB-INF/tiles/templates/menu.jsp" />
        <put-attribute name="body" value="/WEB-INF/views/home.jsp" />
        <put-attribute name="footer" value="/WEB-INF/tiles/templates/footer.jsp" />         
        <put-list-attribute name="links" inherit="true" cascade="true">
            <add-attribute type="string" value="/stles/default.css" />
            <add-attribute type="string" value="/styles/another.css" />
        </put-list-attribute>
    </definition>
    <definition name="home" extends="master.template">
        <put-attribute name="title" value="Welcome Home" />
        <put-attribute name="body" value="/WEB-INF/views/home.jsp" />
    </definition>    
    <definition name="about" extends="master.template">
        <put-attribute name="title" value="About" />
        <put-attribute name="body" value="/WEB-INF/views/about.jsp" />

    </definition> 
</tiles-definitions>

Template.jsp

<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>    
        <title><tiles:insertAttribute name="title" ignore="true" /></title>         
        <!-- links -->      
        <tiles:useAttribute name="links"/>  
        <c:forEach var="href" items="${items}"> 
        <link type="text/css" rel="stylesheet" href="${href}" />
        </c:forEach>                    
    </head>
    <body>
        <div id="page">
            <div id="header"><tiles:insertAttribute name="header" /></div>
            <div id="menu"><tiles:insertAttribute name="menu" /></div>          
            <div id="body"><tiles:insertAttribute name="body" /></div>
            <div id="footer"><tiles:insertAttribute name="footer" /></div>
        </div>
    </body>
</html>

HTTP ERROR 500

Problem accessing /. Reason:

ServletException including path '/WEB-INF/tiles/templates/template.jsp'.

Caused by:

org.apache.tiles.impl.CannotRenderException:
ServletException including path
'/WEB-INF/tiles/templates/template.jsp'.
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:692)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
at
org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124)
at
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at
com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at
org.mortbay.jetty.Server.handle(Server.java:326)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at
org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by:
org.apache.tiles.util.TilesIOException:
ServletException including path
'/WEB-INF/tiles/templates/template.jsp'.
at
org.apache.tiles.servlet.context.ServletUtil.wrapServletException(ServletUtil.java:241)
at
org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:243)
at
org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)
at
org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
at
org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690)
... 37 more Caused by:
org.apache.tiles.template.NoSuchAttributeException:
Error importing attributes. Attribute
'links' is null at
org.apache.tiles.template.ImportAttributeModel.importSingleAttribute(ImportAttributeModel.java:133)
at
org.apache.tiles.template.ImportAttributeModel.getImportedAttributes(ImportAttributeModel.java:78)
at
org.apache.tiles.jsp.taglib.UseAttributeTag.doTag(UseAttributeTag.java:175)
at
org.apache.jsp.WEB_002dINF.tiles.templates.template_jsp._jspService(template_jsp.java:110)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at
com.google.appengine.tools.development.PrivilegedJspServlet.access$101(PrivilegedJspServlet.java:23)
at
com.google.appengine.tools.development.PrivilegedJspServlet$2.run(PrivilegedJspServlet.java:59)
at
java.security.AccessController.doPrivileged(Native
Method) at
com.google.appengine.tools.development.PrivilegedJspServlet.service(PrivilegedJspServlet.java:57)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
at
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
at
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at
org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)
... 42 more

Caused by:

org.apache.tiles.util.TilesIOException:
ServletException including path
'/WEB-INF/tiles/templates/template.jsp'.
at
org.apache.tiles.servlet.context.ServletUtil.wrapServletException(ServletUtil.java:241)
at
org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:243)
at
org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)
at
org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
at
org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
at
org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124)
at
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at
com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at
org.mortbay.jetty.Server.handle(Server.java:326)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at
org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by:
org.apache.tiles.template.NoSuchAttributeException:
Error importing attributes. Attribute
'links' is null at
org.apache.tiles.template.ImportAttributeModel.importSingleAttribute(ImportAttributeModel.java:133)
at
org.apache.tiles.template.ImportAttributeModel.getImportedAttributes(ImportAttributeModel.java:78)
at
org.apache.tiles.jsp.taglib.UseAttributeTag.doTag(UseAttributeTag.java:175)
at
org.apache.jsp.WEB_002dINF.tiles.templates.template_jsp._jspService(template_jsp.java:110)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at
com.google.appengine.tools.development.PrivilegedJspServlet.access$101(PrivilegedJspServlet.java:23)
at
com.google.appengine.tools.development.PrivilegedJspServlet$2.run(PrivilegedJspServlet.java:59)
at
java.security.AccessController.doPrivileged(Native
Method) at
com.google.appengine.tools.development.PrivilegedJspServlet.service(PrivilegedJspServlet.java:57)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
at
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
at
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at
org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)
... 42 more

Caused by:

org.apache.tiles.template.NoSuchAttributeException:
Error importing attributes. Attribute
'links' is null at
org.apache.tiles.template.ImportAttributeModel.importSingleAttribute(ImportAttributeModel.java:133)
at
org.apache.tiles.template.ImportAttributeModel.getImportedAttributes(ImportAttributeModel.java:78)
at
org.apache.tiles.jsp.taglib.UseAttributeTag.doTag(UseAttributeTag.java:175)
at
org.apache.jsp.WEB_002dINF.tiles.templates.template_jsp._jspService(template_jsp.java:110)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at
com.google.appengine.tools.development.PrivilegedJspServlet.access$101(PrivilegedJspServlet.java:23)
at
com.google.appengine.tools.development.PrivilegedJspServlet$2.run(PrivilegedJspServlet.java:59)
at
java.security.AccessController.doPrivileged(Native
Method) at
com.google.appengine.tools.development.PrivilegedJspServlet.service(PrivilegedJspServlet.java:57)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
at
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
at
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at
org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)
at
org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)
at
org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
at
org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
at
org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124)
at
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at
com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at
org.mortbay.jetty.Server.handle(Server.java:326)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at
org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

入画浅相思 2024-10-24 20:41:00

我认为有一个问题:
继承=“真”
属性。由于您没有扩展定义,请尝试删除它并查看它是否有效。

I think there is a problem with the:
inherit="true"
attribute. Since you are not extending a definition, try removing it and see if it works.

ま柒月 2024-10-24 20:41:00

可能存在一些jar版本问题。因此请检查jar版本兼容性。还要检查 java 项目方面的 Dynamic-Web-Module 版本和 tomcat 版本。例如,如果您的动态 Web 模块是 3.0 并且部署在 Tomcat 7 上,则可能会发生此类错误。

There may be some jar version issue.So check jar version compatibility. Also check your Dynamic-Web-Module version in java project facets and tomcat version also. For example- if your dynamic-web-module is 3.0 and you deploy on Tomcat 7, then this type of errors might be occurred.

我不会写诗 2024-10-24 20:41:00
<put-list-attribute name="links" >
        <add-attribute value="/css/style.css"/>

        <add-attribute value="/css/magnific-popup.css"/>
        <add-attribute value="/css/datepicker.css"/>
        <add-attribute value="/css/font-awesome.min.css"/>      
 </put-list-attribute>


<tiles:useAttribute id="list" name="links" classname="java.util.List"/>
    <c:forEach var="href" items="${list}"> 
        <link  rel="stylesheet" href="<c:out value='${href}'/>" />
    </c:forEach> 

属性未加载???

<put-list-attribute name="links" >
        <add-attribute value="/css/style.css"/>

        <add-attribute value="/css/magnific-popup.css"/>
        <add-attribute value="/css/datepicker.css"/>
        <add-attribute value="/css/font-awesome.min.css"/>      
 </put-list-attribute>


<tiles:useAttribute id="list" name="links" classname="java.util.List"/>
    <c:forEach var="href" items="${list}"> 
        <link  rel="stylesheet" href="<c:out value='${href}'/>" />
    </c:forEach> 

Attrubute not loading ???

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文