日期:2014-05-18  浏览次数:20708 次

s:tree相关问题

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<s:head theme="ajax" debug="true" />  
</head>
<body>
<div style="float:left; margin-right: 50px;">
<s:tree id="parentId" theme="ajax" label="111" showRootGrid="false" showGrid="true" treeSelectedTopic="treeSelected">
<s:treenode theme="ajax" label="用户管理" >
<s:treenode theme="ajax" label="<a href="../web/select.jsp">查询用户</a>"></s:treenode>
<sx:treenode theme="ajax" label="添加用户"/>
</s:treenode>
</s:tree>
</div>
</body>

</html>

我的jsp这样写然后就报错:
org.apache.jasper.JasperException: /includ/left.jsp (line: 14, column: 0) No tag "tree" defined in tag library imported with prefix "s"
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:199)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1215)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1452)
org.apache.jasper.compiler.Parser.parse(Parser.java:138)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)
求大神指教啊
------解决方案--------------------
<s:tree/>  不是struts核心标签库的标签,是struts-dojo-tags里面的标签。
在你的页面上引入:<%@ taglib prefix="s" uri="/struts-dojo-tags"%>
并且确定导入了jar包:struts2-dojo-plugin-2.x.jar