jerseyを使用して REST サービスを実装しました。応答の MIME タイプが「text/xml」の場合、関連するxml-stylesheetを指定する方法はありますか?
ありがとうございました。
更新: ここにコードのスニペットがあります:
@Path("/service")
@Stateless
public class MyServices
{
@PersistenceContext(unitName = "em")
private EntityManager em;
@Path("/id/{id}")
@GET
public MyClass getById(@PathParam("id")long id)
{
MyClass o=em.find(MyClass.class, id);
return o;
}
}
.
@Entity(name="X")
@XmlRootElement(name="X")
@NamedQueries(...)
public class MyClass
implements Serializable
{
private static final long serialVersionUID = 1L;
...
}