---
title: "springmvc 使用中遇到的问题"
author: "blueram"
date: "2013-08-07T18:49:00Z"
tags: []
categories: ["编程语言"]
slug: "springmvc"
draft: false
lastmod: "2013-08-07T18:49:00Z"
id: 1921693
url: "https://blueram.iteye.com/blog/1921693"
---

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](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配置文件

 

&lt;context:property-placeholder location="classpath\*:/Appkey.properties" /&gt;

 

      &lt;bean id="placeholderConfig"

class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;

&lt;property name="locations"&gt;

&lt;list&gt;

&lt;value&gt;classpath\*:/DataSourceConfig.properties&lt;/value&gt;

&lt;value&gt;classpath\*:/Appkey.properties&lt;/value&gt;

&lt;/list&gt;

&lt;/property&gt;

&lt;/bean&gt;