springspring mvc 工程结构报错,不知道原因求解答

问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
要给公司做个小项目,上手Java没多久,发现配置个IDE真的是处处是坑。
IDE是Intellij Ultimat 2016.3版本,从git导入项目后一切正常,导入无报错,gradle无报错。并且已安装lombok plugin,已enable “annotation processor”。但是部分注解仍是红色报错,如下图。
问了下其他同事,他们的配置跟我一样但是没出现这个问题。有没有踩过此坑的大神来救命~
提前跪谢。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
解决了,是因为项目里配置文件设置的不合理。导入gradle的时候不能选择读取每个module的配置文件,不然就重复了。
分享到微博?
Hi,欢迎来到 SegmentFault 技术社区!⊙▽⊙ 在这里,你可以提出编程相关的疑惑,关注感兴趣的问题,对认可的回答投赞同票;大家会帮你解决编程的问题,和你探讨技术更新,为你的回答投上赞同票。
明天提醒我
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:
扫扫下载 App2016年10月 Java大版内专家分月排行榜第一2016年9月 Java大版内专家分月排行榜第一2016年8月 Java大版内专家分月排行榜第一2014年4月 Java大版内专家分月排行榜第一
2016年11月 Java大版内专家分月排行榜第二
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。SSM这个测试类的错误怎么解决啊,求大神解决!!!【springmvc吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:1,649贴子:
SSM这个测试类的错误怎么解决啊,求大神解决!!!收藏
Error creating bean with name 'org.feiLong.tests.loginTest': Injection of resource nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.feiLong.services.Tjc_Service] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
登录百度帐号推荐应用23:31 提问
用idea15开发 springmvc项目时报404错误,求大神告知原因
web.xml配置如下:restorg.springframework.web.servlet.DispatcherServletcontextConfigLocation/WEB-INF/rest-servlet.xml1rest/restful/*
rest-servlet.xml配置如下:
&beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&
&description&Spring MVC for Restful&/description&
&!--检测注解 --&
&context:component-scan base-package="com.onlyyou.java.controller" /&
&context:annotation-config /&
&mvc:annotation-driven /&
&mvc:default-servlet-handler/&
Controller代码如下:
@Controller
@RequestMapping("/hello")
public class HelloController {
@RequestMapping(value="/user", method= RequestMethod.GET)
@ResponseBody
public UserBean testParam(@RequestParam("username") String name) {
UserBean userBean = new UserBean();
userBean.setAvatar("123");
userBean.setBirthday("323");
userBean.setCensusRegister("dfda");
return userB
最后再浏览器访问http://localhost:6080/onlyyou/restful/hello/user?username=tom报404的错误
按赞数排序
重新粘贴一下代码,web.xml如下:
&?xml version="1.0" encoding="UTF-8"?&
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1"&contextConfigLocation/WEB-INF/applicationContext.xmlorg.springframework.web.context.ContextLoaderListener
&servlet-name&rest&/servlet-name&
&servlet-class&org.springframework.web.servlet.DispatcherServlet&/servlet-class&
&init-param&
&param-name&contextConfigLocation&/param-name&
&param-value&/WEB-INF/rest-servlet.xml&/param-value&
&/init-param&
&load-on-startup&1&/load-on-startup&
&/servlet&
&servlet-mapping&
&servlet-name&rest&/servlet-name&
&url-pattern&/restful/*&/url-pattern&
&/servlet-mapping&
6080端口,,写错了吗?
其他相似问题

我要回帖

更多关于 spring mvc工程模板 的文章

 

随机推荐