Ahijah wrote
> 
> Martin Grigorov-4 wrote
>> On Thu, Apr 12, 2012 at 7:38 AM, Ahijah <

>> darren.greer@

>> > wrote:
>> 
>> mountResource("/Feed2", new MyResourceReference());
>> 
>> class MyResourceReference extends ResourceReference {
>>   public IResource getResource() { return new MyResource(); }
>> }
> Thanks Martin!  For everyone else's reference, the final code that is
> working looks like this:
> 
> --------------Feed.class----------------
> public class Feed extends AbstractResource {
>       
>       private static final long serialVersionUID = 1L;
>       
>       protected ResourceResponse newResourceResponse(Attributes a) { 
>               ResourceResponse r = new ResourceResponse(); 
>               r.setContentType("application/json");
>               r.setWriteCallback(new WriteCallback() { 
>                       public void writeData(Attributes a) { 
>                       
> a.getResponse().write("[{\"id\":111,\"title\":\"MainEvent\",\"start\":\"2012-04-10T07:00:00\",\"end\":\"2012-04-10T09:30:00\",\"url\":\"?EventID=111\",\"allDay\":false}]");
> } 
>               }); 
>               return r; 
>       } 
> 
> }
> -----------End Feed.class--------------
> 
> --------------Application.class----------------
>       @Override
>       protected void init() {
>               super.init();                                           
>               mountResource("/Feed", new FeedReference());
>       }
> 
>       public class FeedReference extends ResourceReference { 
>               public FeedReference() {
>                       super(FeedReference.class, "feed");
>               }
>               public IResource getResource() { return new Feed(); } 
>       } 
> -----------End Application.class-------------

Is there any way to tie this to the standard wicket security model? Right
now, our web pages are all annotated with @AuthorizeInstantiation("admin"),
so how would we be able to apply it to this scenario?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Generic-JSON-Response-tp4550807p4652432.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