`
wangyanlong0107
  • 浏览: 511290 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
社区版块
存档分类
最新评论

Cannot find bean XXXForm in any scope

 
阅读更多

 

action-mappings >
    <action
      attribute="calcForm"
      input="/form/calc.jsp"
      name="calcForm"
      path="/calc"
      scope="request"
      type="com.yourcompany.struts.action.CalcAction">
      <forward name="result" path="/result.jsp" />
    </action>

原来实例化对象的名字叫“calcForm”,而我将jsp页面的form首字母大写了CalcForm,故造成错误。

也就是说,<bean:write name="CalcForm" property="result"/>里用到的实例化对象和配置文件里的实例化对象不匹配造成此错误的!

 

分享到:
评论

相关推荐

    SSH错误集锦

    3. “Cannot find bean XXX in any scope” 这个错误通常发生在 Action 里一般会 request.setAttribute() 一些对象,然后在转向的 JSP 文件里(用 tag 或 request.getAttribute() 方法)得到这些对象并显示出来。...

    J2EE综合—Struts常见错误的全面总结

    Cannot find bean XXX in any scope **错误描述**:此错误提示表明无法在任何作用域(request、session、application等)中找到指定的bean。通常发生在试图通过`request.setAttribute()`设置bean后,在JSP页面上...

    struts常见异常及处理

    “Cannot find bean XXX in any scope” - **异常描述**:JSP 文件试图访问通过 `request.setAttribute()` 方法存储的对象,但实际 Action 中未设置该对象。 - **解决方案**: - 检查 JSP 中 `&lt;%-- tag --%&gt;` 的 ...

    Struts常见错误汇总

    #### 二、Cannot find bean XXX in any scope **问题描述:** 此错误表示在请求(request)、会话(session)或应用(application)作用域中找不到指定的 Bean。这通常发生在 JSP 页面尝试通过 `&lt;bean:write&gt;` 或 `...

    Struts常见错误汇总.txt

    #### 二、Cannot find bean XXX in any scope 当试图从当前作用域或其父作用域中查找一个 Bean 但未能找到时,会抛出此异常。这可能是因为 Action 中的 `request.setAttribute()` 方法没有正确地设置 Bean,或者在 ...

    struts常见错误以及解决

    javax.servlet.jsp.JspException: Cannot find bean: "list" in any scope ``` **问题解析:** 此异常表明JSP页面无法找到名为“list”的bean。根据提供的代码片段,我们可以看出在`&lt;logic:iterate&gt;`标签中指定了...

    外文翻译 stus MVC

    If you cannot find something you need in the library, contribute. In addition, Struts provides a starting point if you are learning JSP tag technology. • Open source You have all the advantages of...

Global site tag (gtag.js) - Google Analytics