【发布时间】:2012-12-05 04:31:19
【问题描述】:
这是我想要做的:
@POST
@Path("/MyPath")
@Produces("text/xml")
@RolesAllowed({"user"})
public Output myMethod (@QueryParam("itemId") long ItemId,
@QueryParam("plannedstartdate") Calendar plannedStartDate,
@QueryParam("plannedreturndate") Calendar plannedReturnDate)
我正在使用 JBoss AS7。据我了解,resteasy 已集成到 JBoss AS7 中。我能够运行简单的休息服务。
我发现的关于过时的唯一文档是在链接中: http://docs.jboss.org/resteasy/2.0.0.GA/userguide/html/StringConverter.html#StringParamUnmarshaller
由于说明不清楚,我无法按照此操作解决问题。 当我尝试创建示例中给出的注释 DateFormat 时,它无法识别 StringParamUnmarshaller。我不知道从哪里得到它。如果resteasy已经集成到JBoss AS7中了,这不应该被识别吗?
我的 pom.xml 有以下依赖:
<!-- Import the JAX-RS API, we use provided scope as the API is included
in JBoss AS 7 -->
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>
调用此方法失败,因为没有发生字符串到日历的转换。我不想传递字符串而不是日历,因为还有其他客户端直接进行 java 调用。谁能帮助我如何将日期传递给 Rest Calls?
谢谢 转向
【问题讨论】:
-
到底是什么问题?您收到什么错误/异常?
-
我很抱歉。我刚刚更新了最后一段中的问题。
标签: rest date jax-rs jboss7.x resteasy