I've been working on various implementations of this all day, to try and
output a simple JSON response, as Content-Type: application/json, with
absolutely no luck.  My current class is setup as below.  However, when
sending a request to the "Feed" URL, it comes back as text/plain, with the
JSON formatted string embedded below.  What am I doing wrong?  Thanks.

-----------------
public class Feed extends WebPage implements IMarkupResourceStreamProvider {

        private static final long serialVersionUID = 1L;
        
        @Override 
    protected void configureResponse(WebResponse response) { 
        super.configureResponse(response); 
        response.setContentType("application/json"); 
        response.addHeader("Content-Type", "application/json");
    } 

        @Override 
    public void renderPage() { 
       
getResponse().write("[{'id':111,'title':'MainEvent','start':'2012-04-10T07:00:00','end':'2012-04-10T09:30:00','url':'?EventID=111','allDay':false}]");
 
    } 
        
        public IResourceStream getMarkupResourceStream(MarkupContainer 
container,
Class<?> containerClass) { 
        return new StringResourceStream(""); 
    } 

}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Generic-JSON-Response-tp4550807p4550807.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to