论坛首页 入门技术论坛

Resources cannot be null

浏览 3772 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-06-30  
一.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的配置

三.资源文件找不到
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics