Re: Struts2 REST plugin: Passing array in JSON

2012-10-10 Thread Chris Pratt
You *might* need to initialize the countries array. I wouldn't be surprised if internally the JSON library is doing a getCountries().add("CA") and throwing a null pointer exception because getCountries is returning a null. Also, you should really be programming to interfaces, not implementations.

Struts2 REST plugin: Passing array in JSON

2012-10-10 Thread Shaun Lim
My entity class: import java.util.ArrayList; public class Test { private String name; private String description; private ArrayList countries; public Test() { } public String getName() { return name; } public void setName(String name) { this.na

Re: content-language header with Struts2 does not uses the invocation locale

2012-10-10 Thread JOSE L MARTINEZ-AVIAL
Created!! https://issues.apache.org/jira/browse/WW-3886 I hope the explanation is clear. Thanks JL 2012/10/10 Lukasz Lenart > 2012/10/10 JOSE L MARTINEZ-AVIAL : > > Hi all, > > I'm using Struts 2.2.3. I've setup a property "struts.locale" with value > > "es_ES", for Spanish. But my applicati

Re: content-language header with Struts2 does not uses the invocation locale

2012-10-10 Thread Lukasz Lenart
2012/10/10 JOSE L MARTINEZ-AVIAL : > Hi all, > I'm using Struts 2.2.3. I've setup a property "struts.locale" with value > "es_ES", for Spanish. But my application is multilanguage, so I setup the > locale in the request using an interceptor: > > public String intercept(ActionInvocation invocation)

Re: content-language header with Struts2 does not uses the invocation locale

2012-10-10 Thread Chris Pratt
As a work-around, you could implement ServletResponseAware and call setHeader() on the injected HttpServletResponse to set the proper locale value. But I agree that Struts should take the value for the header from it's defined location. (*Chris*) On Wed, Oct 10, 2012 at 9:20 AM, JOSE L MARTINEZ

Re: Struts 2 Rest plugin without automatic configuration of both actions and results

2012-10-10 Thread Frans Thamura
we here try to remove the struts.xml become all annonation http://java.net/projects/s2restplugins/pages/Home @Action(name = "/hello") @Results({ @Result(name = "success", location = "/WEB-INF/view/hello.jsp") }) @Action(name = "/profile") public class ProfileAction { @Action(name = "/list", meth