0

我在 StackOverflow 上读了很多书,但这是我的第一个问题!我已经阅读了规则,但如果我错过了什么,请多多包涵:)。如果我在我的问题中遗漏了什么,请随时告诉我。

我正在尝试学习 jax-rs,但由于我是新手,所以有点令人困惑。我正在尝试mykong 的教程,它工作正常。

我一直在 Eclipse 下工作,这是我所拥有的教程中的确切代码:

package com.mkyong.rest;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Response;

@Path("/hello")
public class HelloWorldService {

@GET
@Path("/{param}")
public Response getMsg(@PathParam("param") String msg) {

    String output = "Jersey say : " + msg;

    return Response.status(200).entity(output).build();

}

}

我一直在尝试修改该行:

String output = "Jersey say : " + msg;

让我们说:

String output = "Another message : " + msg;

当我在 Debug 中重新启动 Tomcat 时,它仍然给我“Jersey say :...”消息,即使在 Debug 中当我查看输出值时,它也给了我这个值...我必须重新发布吗?或者每次我修改源代码时删除服务器并重新配置一个?

先感谢您!

4

1 回答 1

0

本教程可以帮助您配置它:http ://ducquoc.wordpress.com/2010/11/06/eclipse-wtp-tomcat-hot-deploy/

于 2013-02-19T20:14:29.557 回答