Eclipse Struts Errors集锦

来源:互联网 发布:程序运行立刻执行的js 编辑:程序博客网 时间:2024/06/05 08:44

 1. Unknown element <taglib>

在部署web应用程序时,在web.xml文件中加入<tablib>标签报错:Unknown element <taglib> 报错的原因是:对于2.4的web-app,taglib标签的放置位置已经发生改变,要放在<jsp-config>标签下 <jsp-config>   <taglib>    <taglib-uri>/WEB-INF/tld/struts-layout.tld</taglib-uri>    <taglib-location>/WEB-INF/tld/struts-layout.tld</taglib-location>   </taglib></jsp-config>  (from: http://tag.csdn.net/Article/7acbb523-805e-4e5c-b985-e4429962add7.html )

2. <html:errors/> 标签不显示错误信息

解决方案: http://topic.csdn.net/t/20050712/13/4139079.html  我的弄了半天,不知道为什么又好了,反正这个贴子挺不错.

3.

type Status report

message No input attribute for mapping path /login

description The server encountered an internal error (No input attribute for mapping path /login) that prevented it from fulfilling this request.

解决方案:在struts-config.xml里面设置表单验证的相关属性:

<action-mappings>
  <action path="/login" type="classmate.LoginAction" name="formBean1" scope="request" validate="true" input="/error.jsp" />
  <action path="/regist" forward="/regist.jsp"/>
 </action-mappings>

4.

HTTP Status 404 - Servlet actionServlet is not available

     如果你在 struts-config.xml 里面,把数据源 <data-sources><data-source key="access"/></data-sources> 配置错误的话,居然在点击,一个  ActionServlet 如:reg.do 的时候,居然会显示,”HTTP Status 404 - Servlet actionServlet is not available“
     对此,struts.apache.org 给出的解释是,一般是由于配置文件中代码有问题造成的。例如:数据源中驱动程序类型,登录用户名及密码错误;web.xml 以及 strusts-config.xml 配置文件中标记不匹配。配置文件中所设置的 formBean 等类名用错等。
     却没有给出,到底是什么错误,这一点让我很费解。
 
     其实你大可以,一边写.xml文件,一个打开浏览器,看一下,它是不是符合规范。
(上面的come form: http://elovenana.spaces.live.com/blog/cns!3816F973ACB0280A!121.entry)
天那,这错误真是太奇怪了,调了一天的错误这个错误居然是因为我没有起动oracle,但前面用到的几个Action根本就不用数据库啊!!,怎么会一开始不用的时候就去连接数据库了吗,还显示的是Action Bean有误,简直太ridiculous了

type Status report

message Servlet action is not available

description The requested resource (Servlet action is not available) is not available.