我正在使用Struts 1.1实现Tiles 2。我收到一些我无法解决的错误:
org.apache.tiles.template.NoSuchAttributeException:找不到属性'title'。
的struts-config.xml
public class TestAction extends DispatchAction {
public ActionForward cristales(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
return mapping.findForward("success");
}
}
TestAction.java
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<html>
<head><title><tiles:getAsString name="title"/></title>
</head>
<body>
<table>
<tr>
<td colspan="2">
<tiles:insertAttribute name="header" />
</td>
</tr>
<tr>
<td>
<tiles:insertAttribute name="body" />
</td>
</tr>
<tr>
<td colspan="2">
<tiles:insertAttribute name="footer" />
</td>
</tr>
</table>
</body>
</html>
template.jsp
<tiles-definition>
<definition name="page" template="/WEB-INF/template.jsp">
<put-attribute name="header" value="prueba"/>
<put-attribute name="footer" value="prueba"/>
</definition>
<definition name="tutorial" extends="page">
<put-attribute name="title" value="Tutorial" cascade="true"/>
<put-attribute name="body" value="prueba"/>
</definition>
tiles.xml
package pack;
public class St
{
public static void main(String args[])
{
Int y=9;
display(23,1);
}
}
class Animals
{
void display(int a,int b)
{
System.out.println("I am Animal Class");
}
}
当我转到URL:localhost:8080 / informacionRamoCristales.do?method = cristales 我收到了这个错误。
知道为什么吗?非常感谢你。