无法查看jax rs restful web服务

时间:2014-02-07 03:35:46

标签: web-services rest java-ee-6 java-ee-5 java-ee-7

我是jaxrs的新手,我遵循这个http://www.youtube.com/watch?v=-Aec0KEDdzE教程来创建和部署一个宁静的Web应用程序,我还创建了一个实体类,并从实体类创建了一个宁静的Web服务,当我从服务器和键入服务的路径我从服务器获取页面错误错误和Web应用程序是Web应用程序的工作内容可以在网页上查看但无法查看宁静的Web服务

package com.example.example;
import java.io.Serializable; 
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
 import javax.xml.bind.annotation.XmlRootElement;
 @javax.persistence.Entity
 @XmlRootElement
 public class Entity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

public Long getId() {
    return id;
}

public void setId(Long id) {
    this.id = id;
}

@Override
public int hashCode() {
    int hash = 0;
    hash += (id != null ? id.hashCode() : 0);
    return hash;
}

@Override
public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof Entity)) {
        return false;
    }
    Entity other = (Entity) object;
    if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
        return false;
    }
    return true;
}

private String firstName;

/**
 * Get the value of firstName
 *
 * @return the value of firstName
 */
public String getFirstName() {
    return firstName;
}

/**
 * Set the value of firstName
 *
 * @param firstName new value of firstName
 */
public void setFirstName(String firstName) {
    this.firstName = firstName;
}

private String lastName;

/**
 * Get the value of lastName
 *
 * @return the value of lastName
 */
public String getLastName() {
    return lastName;
}

/**
 * Set the value of lastName
 *
 * @param lastName new value of lastName
 */
public void setLastName(String lastName) {
    this.lastName = lastName;
}

@Override
public String toString() {
    return "com.example.example.Entity[ id=" + id + " ]";
}

}

0 个答案:

没有答案