No configuration found for the specified action

用惯了Struts1.1的朋友,在用struts2时可能会出现如下错误:

Tomcat 控制台打出如下警告:
WARN - No configuration found for the specified action: ‘xxxxx’in namespace: ‘/’. Form action defaulting to ‘action’ attribute’s literal value.

主要由于在写struts2表单时有给action指定全名,如:<s:form action=”xxxAction.do”…>,直接写成<s:form action=”xxxAction”…>即可,因为在struts.xml中struts.action.extension属性有指定啦。
阅读更多

No configuration found for the specified action: 'Login' in namespace: ''. Form

08-09

请教各位大师,这个问题怎么解决,拜托大家了,帮帮忙,JSP页面提交按钮提交后就出这问题了。控制台信息容下:rn09-八月-11 下午 06:42 org.apache.struts2.components.Form evaluateExtraParamsServletRequestrnWARNING: No configuration found for the specified action: 'Login' in namespace: ''. Form action defaulting to 'action' attribute's literal value.rn09-八月-11 下午 06:42 org.apache.struts2.components.Form evaluateExtraParamsServletRequestrnWARNING: No configuration found for the specified action: 'Login' in namespace: ''. Form action defaulting to 'action' attribute's literal value.rnrnrnrnstruts.xml:rnrnrn rnrn rn rn rn rn /success.jsprn /login.jsprn rn rnrnrnrnrnlogin.jsp:rnrn<%@ page contentType="text/html;charset=UTF-8"%>rn<%@ taglib prefix="s" uri="/struts-tags"%>rnrnrnrn rn 登录系统rnrnrn rn $requestScope.messagern rn rn rn rn rn rn rnrnrnrnrnrnLoginAction.class:rnrnpackage amigo.struts.login.action;rnrnimport com.opensymphony.xwork2.ActionSupport;rnrnpublic class LoginAction extends ActionSupport rnrn rn public String loginName;rn public String password;rn public String message;rn rn public String getLoginName() rn return loginName;rn rn public void setLoginName(String loginName) rn this.loginName = loginName;rn rn public String getPassword() rn return password;rn rn public void setPassword(String password) rn this.password = password;rn rn rn rn public String getMessage() rn return message;rn rn public void setMessage(String message) rn this.message = message;rn rn public String execute() throws Exceptionrn if("amigo".equals(loginName)&&"amigo".equals(password))rn message=loginName+"登录成功!";rn elsern message=loginName+"登录失败!";rn return INPUT;rn rn return SUCCESS;rn rnrnrnrn是在struts2中rn

大家帮帮忙吧:警告: No configuration found for the specified action: 'login'

10-16

请教各位大师,这个问题怎么解决,index按钮提交后都是找不到资源(The requested resource (/struts2_01/login) is not available.rn),控制台信息容下:rn警告: No configuration found for the specified action: 'login' in namespace: ''. Form action defaulting to 'action' attribute's literal value.rn2010-10-16 9:46:49 org.apache.struts2.components.Form evaluateExtraParamsServletRequestrn警告: No configuration found for the specified action: 'login' in namespace: ''. Form action defaulting to 'action' attribute's literal value.rnrnrn[code=Java] rnstruts.xml:rnrnrn rn rn rn rn welcome.jsprn regist.jsprn index.jsprnrn rn rn rn rn /success.jsprn /success.jsprn /success.jsprn /index.jsprn rn rn rn rn /success.jsprn /success.jsprn /success.jsprn /index.jsprn rnrn rnrnindex.jsp:rnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnLoginAction.class:rnrnpackage com.zpj.action;rnrnimport com.opensymphony.xwork2.ActionSupport;rnimport com.zpj.domain.LoginBean;rnrnpublic class LoginAction extends ActionSupport rnrn /**rn * rn */rn private static final long serialVersionUID = 1L;rn private LoginBean loginBean;rnrn public LoginBean getLoginBean() rn return loginBean;rn rnrn public void setLoginBean(LoginBean loginBean) rn this.loginBean = loginBean;rn rnrn /*rn * 默认的validate()方法;rn */rn public void validate() rn System.out.println("这个是validate方法=====1");rn super.validate();rn rnrn /*rn * 执行完这个方法后将执行默认的validate()方法;rn */rn public void validateSaveUser() rn System.out.println("这个是validateSaveUser方法=====2");rn super.validate();rn rnrn /*rn * 默认的execute()方法;rn */rn public String execute() throws Exception rn System.out.println("这个是execute方法=====3");rn return "ok";rn rnrn /*rn * 如果执行了此方法,则不再执行默认的execute()方法;rn */rn public String saveUser() throws Exception rn System.out.println("这个是saveUser方法=====4");rn return "saveUserOk";rn rnrn /*rn * 如果执行了此方法,则不再执行默认的execute()方法;rn */rn public String checkUser() throws Exception rn System.out.println("这个是checkUser方法=====5");rn return "checkUserOk";rn rnrn rnrnLoginAction.classrnrnpackage com.test.action;rnimport com.opensymphony.xwork2.ActionSupport;rnrnpublic class LoginAction extends ActionSupport rn rn rn /**rn * rn */rn private static final long serialVersionUID = 1L;rn private Users users;rn rn public LoginAction()rn //System.out.println("构造函数执行");rn rn rn public Users getUsers() rn return users;rn rn public void setUsers(Users users) rn this.users = users;rn rn public String execute () throws Exception rn System.out.println("控制其11方法执行"+this.users.getPassword());rn rn if ("root".equals(this.users.getUsername())&&"root".equals(this.users.getPassword())) rn return "success" ; rn else rn this.addFieldError("users.username", "用户名或密码错误") ; rn return "input" ; rn rn rn rn public String login () throws Exception rn System.out.println("控制其11方法执行"+this.users.getPassword());rn rn if ("root".equals(this.users.getUsername())&&"root".equals(this.users.getPassword())) rn return "success" ; rn else rn this.addFieldError("username", "用户名或密码错误") ; rn return "input" ; rn rn rn rn public String login2 () throws Exception rn System.out.println("控制其22方法执行"+this.users.getPassword());rn rn if ("root".equals(this.users.getUsername())&&"root".equals(this.users.getPassword())) rn return "success" ; rn else rn this.addFieldError("username", "用户名或密码错误") ; rn return "input" ; rn rn rn rn public void validate() rn System.out.println("验证方法执行"+this.users.getPassword());rn if ("".equals(users.getUsername())||null==users.getUsername()) rn this.addFieldError("users.username","用户名不能为空") ; rn rn if ("".equals(users.getPassword())||null==users.getPassword()) rn this.addFieldError("users.password","密码不能为空") ; rn rn rn rnrn[/code]rn

No action config found for the specified url,急……

10-13

刚开始学习struts,用的是eclipse从入门到精通,想看下struts和eclipse是怎样结合的,现在利用书上的一个实例,出现了很烦人的问题,寻找了一个下午,也没有找到问题的所在,现在把情况贴出来,各位高手帮忙解答,谢谢!rn这是struts-config.xmlrnrnrnrn rn rn rn rn rn rn rn rn rn rnrn rnrn下面是web.xmlrnrn rnrn mywebrn rn rn actionrn org.apache.struts.action.ActionServletrn rn configrn /WEB-INF/struts-config.xmlrn rn 2rn rn rn rn actionrn *.dorn rn rn rn index.jsprn rnrn下面是index.jsprn<%@ page contentType="text/html; charset=GBK"%>rnrnrn显示用户列表rnrnrn下面是logonAction.javarnpackage cn.com.chengang.sms.user;rnrnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnimport javax.servlet.http.HttpSession;rnrnimport org.apache.struts.action.Action;rnimport org.apache.struts.action.ActionForm;rnimport org.apache.struts.action.ActionForward;rnimport org.apache.struts.action.ActionMapping;rnimport org.apache.struts.action.ActionMessage;rnimport org.apache.struts.action.ActionMessages;rnrnimport cn.com.chengang.sms.Constants;rnimport cn.com.chengang.sms.model.IUser;rnimport cn.com.chengang.sms.system.SmsFactory;rnrnpublic class LogonAction extends Action rn public ActionForward execute(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response)rn throws Exception rn UserForm actionForm = (UserForm) form;rn String userId = actionForm.getUserId();rn String password = actionForm.getPassword();rn IUser user = SmsFactory.getDbOperate().getUser(userId);// 从数据库中根据userId取得此用户rn ActionMessages messages = new ActionMessages();rn if (user == null) rn ActionMessage am = new ActionMessage("LogonAction.fail.userId",rn userId);rn messages.add("userId", am);rn saveErrors(request, messages);rn return (mapping.findForward("fail"));rn rn String dbPassword = user.getPassword();rn if (dbPassword == null || !dbPassword.equals(password)) rn ActionMessage am = new ActionMessage("LogonAction.fail.password");rn messages.add("password", am);rn saveErrors(request, messages);rn return (mapping.findForward("fail"));rn rn HttpSession session = request.getSession();rn session.setAttribute(Constants.CURRENT_USER, user);// 将当前登录用户缓存起来rn return (mapping.findForward("success"));rn rnrn下面是userForm.javarnpackage cn.com.chengang.sms.user;rnimport org.apache.struts.action.ActionForm;rnpublic class UserForm extends ActionForm rn private static final long serialVersionUID = 3238501586467275260L;rn private String userId_abc;rn private String password;rnrn public String getUserId() return userId_abc;rn public void setUserId(String userId) this.userId_abc = userId; rn public String getPassword() return password; rn public void setPassword(String password) this.password = password;rn rnrn编译之后,运用tomcat5.5的服务器,出现下面问题rnexception rnrnjavax.servlet.ServletException: No action config found for the specified url.rn org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:446)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:689)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnroot cause rnrnorg.apache.struts.chain.commands.InvalidPathException: No action config found for the specified url.rn org.apache.struts.chain.commands.AbstractSelectAction.execute(AbstractSelectAction.java:68)rn org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)rn org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)rn org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)rn org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)rn org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:446)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:689)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrn是不是struts-config.xml没有配置好,还是其他问题,请各位给指点下

"No action config found for the specified url"的错误

11-30

貌似很简单,我这里死活调不好。rnrn查来查去都是因为struts-config.xml里边的path没有配好。rn但是我感觉没有错呀rnrnstruts-config.xml内rn------------------------------------------------rnrn rn rnrnrnrnrnrnrn rn rn rn rnrn--------------------------------------------------------------rnrn代码内的类是rncom.yu.bbs.action包内的rnLoginAction.java类rnrncom.yu.bbs.actionform包内的rnTestActionForm.java类rn---------------------------rn项目名称是BBS,在tomcat下能找到BBS这个路径,但是点击之后,就会出现(如果是小写bbs就出现404错误)rnrn浏览器地址[http://localhost:8081/BBS/]rnrnHTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: No action config found for the specified url.rn org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:690)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnroot cause rnrnorg.apache.struts.chain.commands.InvalidPathException: No action config found for the specified url.rn org.apache.struts.chain.commands.AbstractSelectAction.execute(AbstractSelectAction.java:71)rn org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)rn org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)rn org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)rn org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)rn org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:690)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.rnrnrn--------------------------------------------------------------------------------rnrnApache Tomcat/5.5.23rnrnrnrnrn谢谢高手帮忙看看,怎么回事?

报错:javax.servlet.ServletException: No action config found for the specified url

05-25

这个报错信息是不是说我的struts-config.xml配置的有问题啊?rn可是我反复检查,也没觉得那块配置的不正确啊?请高手指点!rn报错信息:rnjavax.servlet.ServletException: No action config found for the specified url.rn org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnroot cause rnrnorg.apache.struts.chain.commands.InvalidPathException: No action config found for the specified url.rn org.apache.struts.chain.commands.AbstractSelectAction.execute(AbstractSelectAction.java:71)rn org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)rn org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)rn org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)rn org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)rn org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnjsp请求信息:rn rn rn rn rn rnrnstruts-config.xml配置如下:rn

没有更多推荐了,返回首页