`
seaairland
  • 浏览: 12577 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

Resources cannot be null

阅读更多
一.resources cannot be null 主要原因应该是没有定义actionform。
struts1.2.4中要把 Action中的perform()方法改成execute()方法
如:public ActionForward execute(ActionMapping mapping,
ActionForm form, HttpServletRequest req,
HttpServletResponse res)throws Exception

package book;
import javax.servlet.http.*;
import org.apache.struts.action.*;
public final class BookAction extends Action
{
public ActionForward execute(ActionMapping mapping,
ActionForm form, HttpServletRequest req,
HttpServletResponse res)throws Exception
{
System.out.println("Start perform("+form+")......");
String title=req.getParameter("title");
Book book=new Book();
book.setTitle(title);
System.out.println("After creation of book:"+book.getTitle());
req.setAttribute("BOOK",book);
return mapping.findForward("bookCreated");
}
}

二.Struts配置文件是缺少plug-in配置

如validator的配置

三.资源文件找不到
分享到:
评论

相关推荐

    东软代码规范编写大全

    throw new IllegalArgumentException("Username cannot be null or blank."); } // 检查密码是否为空 if (StringUtils.isBlank(password)) { throw new IllegalArgumentException("Password cannot be null or...

    微软内部资料-SQL性能优化5

    Because the trees are balanced, finding any record requires about the same amount of resources, and retrieval speed is consistent because the index has the same depth throughout. Clustered and ...

    Delphi7.1 Update

    * A TLargeIntField cannot be used as a linking field in a master/detail relationship. Doing so results in the error "Cannot access field <fieldname> as type variant." * TClientDataSet doesn...

    SSD7 选择题。Multiple-Choice

    For two tables to be union compatible, the tables should be the same with respect to which of the following? (a) keys (b) cardinality (c) name (d) degree Correct answer is (d) Your ...

    Java 编程 :常见问题汇总

    Objects.requireNonNull(obj, "obj cannot be null"); // 处理非空的obj } ``` 3. **数组越界:** 当访问数组元素时,应当确保索引值不会超出数组的有效范围。可以通过使用循环边界检查或使用`Arrays.asList()`...

    微软内部资料-SQL性能优化3

    Some of the resources have “sub-resources.” The followings are sub-resources displayed by the sp_lock output: Database Lock Sub-Resources: Full Database Lock (default) [BULK-OP-DB] – Bulk Operation...

    JavaExceptionsExtraclass

    throw new NullPointerException("File cannot be null"); } ``` 在编写异常处理代码时,应遵循一些最佳实践: - 尽量避免空指针异常,通过在使用对象前检查是否为null。 - 使用具体异常类,而不是笼统的`...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    Friends Exceptions Run-Time Type Information (RTTI) Casting Streams Preincrement and Predecrement Use of const Integer Types 64-bit Portability Preprocessor Macros 0 and NULL sizeof Boost C++0x ...

    acpi控制笔记本风扇转速

    ResourceTemplate, but cannot be disassembled as such because the EndTag does not appear at the very end of the buffer. AcpiExec - Added the "-t" command line option to enable the serialized mode of ...

    Effective C#

    throw new ArgumentException("Age cannot be negative."); _age = value; } } ``` **Item 2: Prefer readonly to const** - **Purpose:** `readonly` variables are initialized once and can't be changed,...

    Struts常见错误汇总

    - 如果是由于 NullPointer 异常,检查是否有 null 值被引用。 #### 10. Resources not defined for Validator **问题描述:** 在使用 Struts 的 Validator 组件进行表单验证时,如果配置文件中未定义所需的资源,...

    struts常见异常及处理

    - 如果是 `NullPointerException`,则关注是否有为 null 的引用被使用,通常是配置文件未被正确加载。 以上总结了 Struts 框架开发过程中常见的异常及其处理方法。针对每种异常,都给出了详细的解释与解决步骤。...

    win 3.11 for workgroup tcpip支持

    containing the LMHOSTS file must be in the Null Sessions list on the Server by adding the share name to the following Windows NT Registry key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services \...

    servlet2.4doc

    Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked. doFilter(ServletRequest, ...

    应用Dephi 开发佳能照相机API

    Calling this function releases all resources allocated by the libraries. This function delete all the reference or list objects that user has forgotten to delete. Parameters: In: None Out: ...

Global site tag (gtag.js) - Google Analytics