关于SSH的问题! Could not execute action: /mainaction 求大神支招!困扰5天了,什么方法都用了!!帮帮忙呀!!

问题描述

问题:如下014-9-2714:17:04org.apache.catalina.core.AprLifecycleListenerinit信息:TheApacheTomcatNativelibrarywhichallowsoptimalperformanceinproductionenvironmentswasnotfoundonthejava.library.path:E:anzhuangbaoMyEclipsebin;E:anzhuangbaoMyEclipsemyeclipseeclipsepluginscom.genuitec.eclipse.easie.tomcat.myeclipse_6.5.0.zmyeclipse650200806tomcatbin2014-9-2714:17:04org.apache.coyote.http11.Http11Protocolinit信息:InitializingCoyoteHTTP/1.1onhttp-80802014-9-2714:17:04org.apache.catalina.startup.Catalinaload信息:Initializationprocessedin846ms2014-9-2714:17:04org.apache.catalina.core.StandardServicestart信息:StartingserviceCatalina2014-9-2714:17:04org.apache.catalina.core.StandardEnginestart信息:StartingServletEngine:ApacheTomcat/6.0.132014-9-2714:17:09org.apache.catalina.core.ApplicationContextlog信息:InitializingSpringrootWebApplicationContext2014-09-2714:17:17,212WARN[Settings.java:143]:Settings:Couldnotparsestruts.localesetting,substitutingdefaultVMlocale2014-9-2714:17:18org.apache.coyote.http11.Http11Protocolstart信息:StartingCoyoteHTTP/1.1onhttp-80802014-9-2714:17:18org.apache.jk.common.ChannelSocketinit信息:JK:ajp13listeningon/0.0.0.0:80092014-9-2714:17:19org.apache.jk.server.JkMainstart信息:JkrunningID=0time=0/37config=null2014-9-2714:17:19org.apache.catalina.startup.Catalinastart信息:Serverstartupin14241ms2014-09-2714:18:28,107ERROR[ActionComponent.java:259]:Couldnotexecuteaction:/mainactionThereisnoActionmappedforactionnamemainaction.-[unknownlocation]atcom.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)atorg.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)atorg.apache.struts2.components.ActionComponent.executeAction(ActionComponent.java:249)JSP界面:<center><s:actionname="mainaction"executeResult="false"></s:action><divid="right"><ulclass="list"><liclass="listTitle">最新上架<aclass="more">更多..</a></li><s:iteratorvalue="#request.newbookList"status="st"><liclass="listPicture"><ahref="singleBook.jsp?bookId=<s:propertyvalue="lid"/>"><imgsrc='upload/<s:propertyvalue="lpricture"/>'/></a></li><liclass="listMaessage"><aclass="bookName"href="singleBook.jsp?bookId=<s:propertyvalue="bookId"/>"><s:propertyvalue="lname"/></a><br/><br/>作者:<aclass="bookStyle"href="oneType.jsp?searchType=bookAuthor&searchDescribe=<s:propertyvalue="lauthor"/>"><s:propertyvalue="lauthor"/></a><br/><br/>出版社:<aclass="bookStyle"href="oneType.jsp?searchType=bookPress&searchDescribe=<s:propertyvalue="lpress"/>"><s:propertyvalue="lpress"/></a><br/><br/>类别:<aclass="bookStyle"href="oneType.jsp?searchType=bookType&searchDescribe=<s:propertyvalue="ltype"/>"><s:propertyvalue="ltype"/></a><br/><br/></li></s:iterator></ul>struts配置界面如下:<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEstrutsPUBLIC"-//ApacheSoftwareFoundation//DTDStrutsConfiguration2.0//EN""http://struts.apache.org/dtds/struts-2.0.dtd"><struts><constantname="struts.enable.DynamicMethodInvocation"value="false"/><constantname="struts.objectFactory"value="spring"/><constantname="struts.devMode"value="false"/><constantname="struts.locale"value="en_UTF-8"/><packagename="default"namespace="/"extends="struts-default"><!--登录判断--><actionname="adenglu"class="actionclass"method="denglu"><resultname="userok">user.jsp</result><resultname="adminok">/admin/admin.jsp</result><resultname="error">error.jsp</result></action><!--判断昵称是否唯一,然后注册新用户--><actionname="aselectname"class="actionclass"method="selectname"><resultname="UserRegisterOk">error.jsp</result><resultname="error">error.jsp</result></action><!--退出用户登录--><actionname="aExitLogin"class="actionclass"method="ExitLogin"><resultname="AdminExitLoginOk">enter.jsp</result><resultname="UserExitLoginOk">login.jsp</result><resultname="error">error.jsp</result></action><actionname="mainaction"class="mainAction"></action>application。。。。配置界面:<beanid="bookQ"class="query.bookQuery"abstract="false"lazy-init="default"autowire="default"dependency-check="default"><propertyname="sessionFactory"><reflocal="sessionFactory"/></property></bean><beanid="mainAction"class="com.onlinebookstore.action.mainAction"scope="protoType"><propertyname="bookQ"><refbean="bookQ"/></property></bean>Action界面:publicclassmainActionextendsActionSupport{privatebookQuerybookQ;publicvoidsetBookQ(bookQuerybookQ){this.bookQ=bookQ;}publicStringexecute(){//最新上架System.out.println("ceshi");ListnewbookList=bookQ.newbook(1,6);HttpServletRequestrequest=ServletActionContext.getRequest();request.setAttribute("newbookList",newbookList);returnnull;}}bookQuery代码://显示最新上架的图书publicListnewbook(intpageNumber,intpageSize){//List<Library>标明将结果及转换成Library型Stringsql="fromLibrarylwherel.lsum>0orderbyl.lshelvetimedesc";try{Listnewbook=this.getHibernateTemplate().find(sql);returnnewbook;}catch(RuntimeExceptionre){throwre;}}}请大神帮帮忙,分析一下这是什么原因!!早上起床,就开始调现在还没有吃饭了,小弟先去吃个饭哈!!有劳大神啦!!如果程序这样分析不出来原因,小弟可提供源码及数据库供大神分析!!

解决方案

解决方案二:
小弟先顶一下!!

时间: 2024-10-25 03:35:40

关于SSH的问题! Could not execute action: /mainaction 求大神支招!困扰5天了,什么方法都用了!!帮帮忙呀!!的相关文章

java-非典型SSH项目,启动服务器,出现如下错误,求大神支招

问题描述 非典型SSH项目,启动服务器,出现如下错误,求大神支招 10:19:56.250 WARN org.hibernate.ejb.Ejb3Configuration[1132] - HHH000144: hibernate.connection.autocommit = false breaks the EJB3 specification 10:19:56.745 WARN o.h.e.jdbc.internal.JdbcServicesImpl[169] - HHH000342: C

ssh整合jar包 求大神支招

问题描述 ssh整合jar包 求大神支招 想知道 asm-attrs.jar 和 asm.jar 这两个jar包的区别,同时使用时会出现异常

javascript-实现点击图片的超链接 就会执行一个action,求大神给个详细指导

问题描述 实现点击图片的超链接 就会执行一个action,求大神给个详细指导 下边代码是实现图片内容的.我现在想实现点击图片的超链接 就会执行一个action,然后把图片中的那条记录存到另一张表里.求大神给个详细指导,最好能给代码例子.跪求 <TD align="lift"> <a href="javascript:window.parent.addtSub('<s:property value="id"/>','<s:

注入失败-SSH 整合 当Action切面引入事务管理后,属性无法注入,求大神帮忙看一下

问题描述 SSH 整合 当Action切面引入事务管理后,属性无法注入,求大神帮忙看一下 没加入事务切面前,Action中的注入costDao可以注入,可是applicationContext.xml加入了一下配置后 <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="ses

ssh框架登录报404求大神解答!!!

问题描述 ssh框架登录报404求大神解答!!! 我的源码: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > context

代码-求大神指点 SSH框架部分

问题描述 求大神指点 SSH框架部分 public class LoginAction extends ActionSupport{ public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { return mapping.findForward("success"); } } 这段代码

java-报错!!!找不到action中welcome方法,求大神们赐教!

问题描述 报错!!!找不到action中welcome方法,求大神们赐教! HTTP Status 500 - The welcome() is not defined in action class com.opensymphony.xwork2.ActionSupport type Exception report message The welcome() is not defined in action class com.opensymphony.xwork2.ActionSuppor

jsp增删改查怎么写?怎么与actiong,dao结合?ssh框架 求大神指导!跪求~

问题描述 jsp增删改查怎么写?怎么与actiong,dao结合?ssh框架 求大神指导!跪求~ <%@page contentType="text/html; charset=UTF-8" import="java.util.*" %> <%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <jsp:inclu

ssh整合-集成ssh时出错,求大神解

问题描述 集成ssh时出错,求大神解 JBOSS已启动,使用的是7.1.1的服务器 错误描述: 10:58:00,574 信息 [org.jboss.modules] JBoss Modules version 1.1.1.GA 10:58:00,853 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA 10:58:00,920 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes