我是facelets的新手,我使用netbeans生成了一个项目但是我在使用标签时遇到了困难.
我有
<h:selectOneMenu id="country" value="#{organisation.organisation.country}" title="Country" >
<f:selectItems value="#{country.countryItemsAvailableSelectOne}"/>
</h:selectOneMenu>
Run Code Online (Sandbox Code Playgroud)
在select I get classpath.Country [iso = GB]我可以看到它是一个对象,但我真的想看到country.prinableName值.我已经看了半天,并且已经画了一个空白谢谢你的帮助
我已经尝试了两个小时尝试从REST Web服务获取返回值,但是Netbeans生成了但是我尝试了一个错误.netbeans生成的代码是
@GET
@Override
@Produces({"application/xml", "application/json"})
public List<Person> findAll() {
return super.findAll();
}
Run Code Online (Sandbox Code Playgroud)
当我创建客户端时,我得到了这个生成的代码
public <T> T findAll_XML(Class<T> responseType) throws UniformInterfaceException {
WebResource resource = webResource;
return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(responseType);
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试了很多方法来调用它,经过大量的冲浪决定这应该可以做到,但事实并非如此.
public static void main(String[] args) {
PersonRESTClient prc = new PersonRESTClient();
Person person = prc.find_XML(Person.class, "100");
System.out.println(person.getFirstname() + " " + person.getSecondname()); //THIS WORKS!!
GenericType<List<Person>> gType = new GenericType<List<Person>>(){};
List<Person> persons = (List<Person>) prc.findAll_XML(gType.getClass());
for (Person p : persons) {
System.out.println(person.getFirstname() + " " + person.getSecondname());
}
}
Run Code Online (Sandbox Code Playgroud)
我得到的错误是
2013年3月7日下午2:23:31 …