English 中文(简体)
RESTEasy——简单地铺设阵列/收集船
原标题:RESTEasy - simple string array/collection marshalling

是否有一种简单的方法,可以用来对“努力”或列入“RESTEasy”名单进行分类和进行划界?

我的法典样本:

@GET
@Path("/getSomething")
@Produces(MediaType.APPLICATION_JSON)
public List<String> getSomeData() {
    return Arrays.asList("a","b","c","d");

}

以上是:

Could not find MessageBodyWriter for response object 
of type: java.util.Arrays$ArrayList of media type: application/json
问题回答

您也许需要总结一下:

public List<JaxbString> getList(){
     List<JaxbString> ret= new ArrayList<JaxbString>();
     List<String> list = Array.asList("a","b","c");
          for(String s:list){
              ret.add(new JaxbString(s));
          }
     return ret;
}

@XmlRootElement
public class JaxbString {

    private String value;

    public JaxbString(){}

    public JaxbString(String v){
        this.setValue(v);
    }

    public void setValue(String value) {
        this.value = value;
    }

    @XmlElement
    public String getValue() {
        return value;
    }

}

我在XML和JSON问题上也存在同样的问题。 至今尚未找到解决办法,但我认为它必须与日本宇宙航空研究开发机构合作。

因此,问题在于,日本宇宙航空研究开发机构已经与JDK6公司发生,而来自JBos的附属公司则不正确。 他们应当找到另一种解决办法,即现在如何做到这一点。 如何解决这一问题:

<!-- JAXB Reasteasy support -->
<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-jaxb-provider</artifactId>
<version>1.2.1.GA</version>
<scope>compile</scope>
<exclusions>
    <exclusion>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
    </exclusion>
    <exclusion>
        <groupId>com.sun.xml.stream</groupId>
        <artifactId>sjsxp</artifactId>
    </exclusion>
</exclusions>

你们将获得REESTEASY JAXB提供商,但不是日本宇宙航空研究开发机构档案。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签