
java
imlmy
这个作者很懒,什么都没留下…
展开
-
maven创建web工程Spring配置文件找不到问题解决方案
使用maven创建web工程,将Spring配置文件applicationContext.xml放在src/resource下,用eclipse编译时提示class path resource [applicationContext.xml] cannot be opened because it does not exist错误。但是用mvn clean package命令编译时成功的。web.原创 2012-12-06 10:06:31 · 37796 阅读 · 9 评论 -
eclipse加载maven工程提示pom.xml无法解析org.apache.maven.plugins:maven-resources-plugin:2.4.3解决方案
在别的机子上创建一个maven工程,复制到本机上导入,出现pom.xml文件错误,提示错误如下Multiple annotations found at this line:- Execution default-testResources of goal org.apache.maven.plugins:maven-resources- plugin:2.4.3:te原创 2012-12-07 10:34:42 · 359103 阅读 · 19 评论 -
发布Struts2工程打开action链接提示There is no Action mapped for namespace / and action name **解决方案
创建了一个struts2工程,发布到tomcat后,打开其中的action链接,出现There is no Action mapped for namespace / and action name **. - [unknown location] 。从错误信息可以看出是由于找不到对应的action map定义。查看工程struts.xml文件存在,并且配置正确。struts.xml文件是在s原创 2012-12-07 11:06:07 · 13870 阅读 · 2 评论 -
解决MyEclipse下引入的工程无法进行server deploy
用maven创建eclipse工程,导入MyEclipse后无法进行server deploy操作。这是由于MyEclipse不识别这个工程为web工程。在网上找到解决方法,通过Add Web Project Capabilities操作解决。整个方案如下解决MyEclipse下引入的工程无法进行server deploy 这里提到的无法进行server deploy转载 2012-12-07 17:45:02 · 6020 阅读 · 0 评论 -
使用maven创建Struts2+Spring工程
使用命令行创建Struts2+Spring工程,使用命令如下mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=MyProject -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter提示Failed原创 2012-12-07 16:57:53 · 3052 阅读 · 2 评论 -
spring aop版本问题
通过spring aop创建一个拦截器,applicationContext.xml文件配置如下helloWorldActionSpringAOPIntercepter其中SpringIntercepter是拦截器类,实现MethodBeforeAdvice。在发布到tomcat时出现nested exception is java.la原创 2012-12-11 18:55:10 · 2411 阅读 · 0 评论 -
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener错误解决方案
在myeclipse自带的tomcat中加载一个web工程,启动tomcat出现java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener错误。一般出现这种错误有可能是spring库没有包含,主要是spring-web.jar。不过工程中已经存在这个库文件,并且同一个工程之前加载过没原创 2013-01-17 14:54:22 · 104723 阅读 · 13 评论 -
Spring aop拦截器
今天加班,搞定了用spring拦截器捕获其他bean异常。功能比较简单,主要是之前对spring拦截器不熟悉,导致出现问题搞了半天才解决。新建一个自定义的Advice类MyAdvice实现ThrowsAdvice接口的afterThrowing方法。然后再applicationContext.xml中配置拦截器。 mybean myadvice 运原创 2013-03-16 17:51:37 · 3019 阅读 · 1 评论 -
struts返回对象json格式数据
想在struts中返回一个对象的json数据,通过定义 userInfo 结果返回的是整个action类的所有成员变量的json数据。要想返回userInfo对象的数据,需要将返回参数定义为root对象 userInfo 下面是返回各种json数据的定义原创 2013-04-07 10:50:20 · 3474 阅读 · 0 评论