having("application/xml") is an alias for both:
> .accept("application/xml")
> .as("application/xml")
Let us know about the @Consumes.
Regards
Guilherme Silveira
Caelum | Ensino e Inovação
http://www.caelum.com.br/
@XStreamAlias("sale")
public class Sale
{
private Integer id;
private Double ammount = new Double(0.0);
private List<Item> items;
public void sellItem(Item item)
{
getItems().add(item);
ammount += item.getPrice();
}
private List<Item> getItems() {
if(items==null) items = new ArrayList<Item>();
return items;
}
}
Can you also try debugging or logging (sysouting is fine) to check
that the logic method has been invoked?
Guilherme Silveira
Caelum | Ensino e Inovação
http://www.caelum.com.br/
Hi rafael, did you try the code I sent?
It might be due to xstream not using reflection to instantiating your model.then some collateral effect is throwing the error...
2011. 2. 2. 오후 4:03에 "RafaelViana" <rfl....@gmail.com>님이 작성:
The error happens because the collection. It's strange.
Using the Sale with collection ( even using your implementation ) the
content type arrives to getResponse() in ApacheResponse as text/html.
However, using the sale without the collection the content type
arrives as application/xml.
This test was made changing only the model, without changes in the
controller or test code.
On 2 fev, 15:42, Guilherme Silveira <guilherme.silve...@caelum.com.br>
wrote:
> Hi Rafael, can you try the following?
>
> @XStreamAlias("sale")
> public class Sale
> {
> p...
> Caelum | Ensino e Inovaçãohttp://www.caelum.com.br/
>
> On Wed, Feb 2, 2011 at 3:17 PM, RafaelViana <rfl.vi...@gmail.com> wrote:
> > I set the headers a...
text/xml or text/html?
Regards
Guilherme Silveira
Caelum | Ensino e Inovação
Hi Rafael,
Can you extract the example in a simple project so we can run the same code?
Regards
2011. 2. 2. 오후 7:22에 "RafaelViana" <rfl....@gmail.com>님이 작성:
Premature end of file
On 2 fev, 18:35, Lucas Cavalcanti <lucasmrtu...@gmail.com> wrote:
> what is the exception?
>
> On Wed, Feb 2, 2011 at 5:04 PM, RafaelViana <rfl.vi...@gmail.com> wrote:
> > text/html
>
> > On 2 ...