开发者社区 问答 正文

SpringMVC扫描@Value注解报错 ?报错

SpringMVC扫描bean,bean中使用的@Value会报错(字符串转Integer错误,NumberFormatException: For input string: "${serverPort}")
修改成使用Spring扫描bean,@Value就能正常运行,有大神了解么???

展开
收起
爱吃鱼的程序员 2020-06-23 16:08:07 492 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    在配置文件properties中加入serverPort=1111即可,1111是假设的

    2020-06-23 16:08:26
    赞同 展开评论