0

我试图在我的请求参数中通过电子邮件发送..

在我的控制器类中阅读它时,我遇到了异常..

[ Catch Exception :  Error Message: Unexpected end-of-input: was expecting closing quote for a string value
 at [Source: java.io.StringReader@200a200a; line: 1, column: 195] ]


http://localhost:8080/appln/fetch/
ipdata={"date":"2013-10-05","emailId":"my.email.com@gmail.com"}

如果我的 emailId 为“myemailcom@gmailcom”..它运作良好......

我的控制器代码看起来有点..

ObjectMapper mapper = new ObjectMapper();
mapper.readValue(ipdataString,InputRequestBean.class);

--

得到的是...
{"date":"2013-10-05","emailId":"my

我的豆子是

public class InputRequestBean {
    private String date;
    private String emailId;
    /**
     * @return the date
     */
    public String getDate() {
        return date;
    }
    /**
     * @param date the date to set
     */
    public void setDate(String date) {
        this.date = date;
    }
    /**
     * @return the emailId
     */
    public String getEmailId() {
        return emailId;
    }
    /**
     * @param emailId the emailId to set
     */
    public void setEmailId(String emailId) {
        this.emailId = emailId;
    }

}
4

1 回答 1

0

做了一些谷歌搜索..这是有效的修复..

@RequestMapping(value = "/appln/fetch/{ipdata:.+}", 方法 = RequestMethod.GET)

弹簧文档...: http ://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping-uri-templates-regex

于 2013-10-31T08:45:27.580 回答