java调用wadl_java – Maven WADL插件没有生成可用的WADL

我正在尝试使用maven插件生成WADL.项目构建和服务工作.以下是POM插件的一部分:

com.sun.jersey.contribs

maven-wadl-plugin

1.19.2

generate

generate

package

${basedir}/src/main/docs/ThingREST.wadl

true

http://localhost:8080/ThingREST

samp.rest.ws.controller

com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc

applicationDocsFile

${basedir}/src/main/docs/xml/app-wadl-doc.xml

com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport

grammarsFile

${basedir}/src/main/docs/xml/app-wadl-grammar.xml

applicationDocFile和grammarFile存在,但它们不包含任何重要信息.我不知道该包括什么.

这是控制器:

package samp.rest.ws.controller;

import java.util.List;

import samp.rest.ws.ThingDB;

import samp.rest.ws.vo.Thing;

import org.springframework.web.bind.annotation.PathVariable;

import org.springframework.web.bind.annotation.RequestBody;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;

import org.springframework.web.bind.annotation.RestController;

/**

*

* @author Grayson

*/

@RestController

public class ThingController {

@RequestMapping(value = "/things", method = RequestMethod.GET, headers = "Accept=application/json") //produces = "application/json")

public List getThings() {

return ThingDB.getThings();

}

@RequestMapping(value = "/thing/{id}", method = RequestMethod.GET, headers = "Accept=application/json")

public Thing getThingById(@PathVariable int id) {

return ThingDB.getThing(id);

}

@RequestMapping(value = "/thingy/{id}", method = RequestMethod.GET)

public String getThingy(@PathVariable int id) {

return ThingDB.getThing(id).toString();

}

@RequestMapping(value = "/addthing", method = RequestMethod.PUT) //, headers = "Accept=application/json")

public void addThing(@RequestBody Thing thing) {

ThingDB.addThing(thing);

List lt = ThingDB.getThings();

for (Thing t : lt) {

System.out.println(" Post add: " + t.toString());

}

}

}

最后,这是WADL产生的:

jersey:generatedBy="Jersey: 1.19.2 08/25/2016 12:00 AM"

xmlns:jersey="http://jersey.java.net/"/>

title="Maven Spring REST Sample WADL"

xml:lang="en">

This is the Web Application Description Language (WADL) for

a Maven Spring REST Service. This service is intended to serve as

a workign model/sample.

]]>

我期望WADL包含可用的服务调用并识别输入类型.显然,我没有得到这个.

我已经搜索了高低版本的示例和文档来使用这个插件.任何和所有的帮助将不胜感激.遗憾的是,存在哪些文档/示例似乎已经过时了.

提前致谢.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值