can produce the same media type
来源:互联网 发布:淘宝月销多少才有销量 编辑:程序博客网 时间:2024/06/07 14:20
今天启动项目的时候,报错提示 can produce the same media type,原因是什么呢?
在StackOverflow上面找到了答案:
是Java中Path的问题,程序里实际两个方法的Path是这么写的:
@GET@Produces(MediaType.APPLICATION_JSON)@Path("/itembase/{userId}")
@GET@Produces(MediaType.APPLICATION_JSON)@Path("/itembase/{id}")
虽然是不同的方法,返回内容也不一样,但HTTP请求方法一样、产生的媒体类型也一样,Path的形式也一样,所以报这个错。
解决的办法是修改一下Path,把第一个Path改为:
@Path("/itembases/{userId}")
把itembase改为itembases,加个s变成复数。
OK,问题解决。
0 0
- can produce the same media type
- swap two value of the same type
- Two classes have the same XML type
- wo or more files with the name of logging.cc will produce outputs to the same location.
- media-type,media-query
- Two classes have the same XML type name 排错
- JAD did not have the correct media type
- media type与media query
- media type与media query
- media type与media query
- media type与media query
- media type与media query
- media type与media query
- The import org.junit.Test conflicts with a type defined in the same file
- The import java.util.Collection conflicts with a type defined in the same file
- The import java.util.TreeSet conflicts with a type defined in the same file
- The import org.junit.Test conflicts with a type defined in the same file报错
- Blended Learning Media Type
- Servlet处理Json请求数据包
- u盘在linux系统下文件只读方式的解决方案
- HDU ACM 1269迷宫城堡->有向强连通分量(tarjan算法实践)
- IM设计思考:点对点消息交换
- Show Dictionary in Inspector[Dictionary serialize]
- can produce the same media type
- Makefile语法学习
- gradle+android+idea上手笔记
- 黑马程序员——集合框架
- 第八周阅读一
- Android Notification 的声音和震动
- Android studio在使用过程中常见的问题及解决方法(不定期更新)
- 数据结构(c语言)之动态数组
- HTTP网络请求