该帖已经被评为精华帖
|
|
---|---|
作者 | 正文 |
发表时间:2011-09-23
麻烦一下碰到这种问题:
我用的是spring 3.1.0版本的mvc. 我在webroot下有一个存放js的目录,是一个97的日期控件,然后我在spring-servlet.xml中使用<mvc:resources mapping="/js/**" location="/js/"/>让其加入静态资源。tomcat启动里也提示了加入成功了。但是,我在jsp页面用post提交form表单却失败了,提示404,这个form表单有二个text标签,一个用于选择时间的。 但如果我把<mvc:resources mapping="/js/**" location="/js/"/>取消掉,在jsp页面日期控件就失效了,但可以提交! 请问,这是什么原因导致的,如果解决? |
|
返回顶楼 | |
发表时间:2011-10-23
不回复还收藏不了啊?
通过启发,解决了日期转换的问题.感谢楼主! |
|
返回顶楼 | |
发表时间:2011-10-30
<mvc:resources mapping="/img/**" location="/img/"/>
<mvc:resources mapping="/js/**" location="/js/"/> <mvc:resources mapping="/style/**" location="/style/"/> <mvc:resources mapping="/html/**" location="/html/"/> 没有配置静态变量时,登录没有问题。可是在加上上面的配置后就回报 [WARN]: No mapping found for HTTP request with URI [/spirngmvc/welcome] in DispatcherServlet with name 'spring' 虽然是警告可是页面无法显示,很是郁闷... 贴上web.xml <servlet> <servlet-name>spring</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>spring</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> 楼主能帮忙看下是哪里不对不? 我用的是spring3.0.5 tomcat6下的环境 |
|
返回顶楼 | |
发表时间:2011-10-31
已经解决了没有加
<mvc:annotation-driven /> |
|
返回顶楼 | |
发表时间:2011-11-28
楼主能把jar包发送一份给我吗,我的jar老是报错!1105249192@qq.com
|
|
返回顶楼 | |
发表时间:2011-11-28
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0' defined in ServletContext resource [/WEB-INF/spring3-servlet.xml]: Cannot create inner bean 'org.springframework.http.converter.json.MappingJacksonHttpMessageConverter#836aae' of type [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter] while setting bean property 'messageConverters' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.http.converter.json.MappingJacksonHttpMessageConverter#836aae' defined in ServletContext resource [/WEB-INF/spring3-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.<init>(Ljava/lang/Class;)V
|
|
返回顶楼 | |
发表时间:2011-12-13
我也遇到这样的问题,在网上搜了好久也搜不到。哪位知道请指教下,谢谢:
Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0' defined in URL [file:/E:/jboss-4.2GA/server/default/deploy/Management.war/WEB-INF/classes/spring/springMVC-mvc.xml]: Cannot create inner bean 'org.springframework.http.converter.json.MappingJacksonHttpMessageConverter#18b1bc' of type [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter] while setting bean property 'messageConverters' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.http.converter.json.MappingJacksonHttpMessageConverter#18b1bc' defined in URL [file:/E:/jboss-4.2GA/server/default/deploy/Management.war/WEB-INF/classes/spring/springMVC-mvc.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.<init>(Ljava/lang/Class;) |
|
返回顶楼 | |
发表时间:2011-12-26
long502147 写道 RequestMapping注解里的这个属性method=RequestMethod.POST,一定要配置么?请问一下Lz不配置有什么不一样不?
不配置就是GET方式跳转 |
|
返回顶楼 | |
发表时间:2011-12-26
好帖子,楼主辛苦了。。。
|
|
返回顶楼 | |
发表时间:2011-12-27
很全很详细,不错!SPRING MVC的确很好用,零配置,以及和SPRING 能很好融合
|
|
返回顶楼 | |