关于struts简单问题

来源:百度知道 编辑:UC知道 时间:2024/05/13 18:41:05
用MyEclipse 建了一个web 工程
然后右键add生成struts框架

建了一个 index.jsp 里面用了 4个标签(都是生成的)

tomcat6部署好以后
以上东西都是我刚安装的 怎么办?
我直接访问这个页面为什么是 500错误? 是不是标签找不到还是什么怎么设置?

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: The absolute uri: http://struts.apache.org/tags-bean cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java

好像是你界面用到了struts的bean标签 要先注册
现在web-xml中把这个添上
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
</jsp-config>
然后再页面
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>

你写的不太明白,没看懂。看错误代码,你没把struts类包部署到tomcat去。
1 添加struts支持
2 书写jsp页面
3 部署项目到tomcat
4 启动tomcat服务器。