ITeye博客

springmvc 使用中遇到的问题

blueram · 2013-08-07 18:49 · S2SH FrameWork · 编程语言 · Markdown

1、Name for argument type [java.lang.String] not available, and parameter name information not found in class file either

解决办法:http://jinnianshilongnian.iteye.com/blog/1705701

eclipse默认是debug级别的函数里面的参数名保留,但是ant编译就不行了。可以使用javac  debug=true

要不就是写全@RequestParam的参数

public String requestparam2(@RequestParam("username") String username)  

 

2、coutroller里面不能使用@Value

解决办法:项目使用了多个spring配置文件,然后properties需要多次引入,才可以使用。主要原因是扫描service类和controller不是一个spring配置文件

 

<context:property-placeholder location="classpath*:/Appkey.properties" />

 

      <bean id="placeholderConfig"

class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

<property name="locations">

<list>

<value>classpath*:/DataSourceConfig.properties</value>

<value>classpath*:/Appkey.properties</value>

</list>

</property>

</bean>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。