ch.ralscha.extdirectspring.api
Class ApiController

java.lang.Object
  extended by ch.ralscha.extdirectspring.api.ApiController
All Implemented Interfaces:
ApplicationContextAware

@Controller
public class ApiController
extends Object
implements ApplicationContextAware

Spring managed controller that handles /api.jsp and /api-debug.js requests

Author:
Ralph Schaer

Constructor Summary
ApiController()
           
 
Method Summary
 void api(String apiNs, String actionNs, String remotingApiVar, String pollingUrlsVar, String group, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Method that handles api.js calls.
 void setApplicationContext(ApplicationContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApiController

public ApiController()
Method Detail

setApplicationContext

public void setApplicationContext(ApplicationContext context)
Specified by:
setApplicationContext in interface ApplicationContextAware

api

@RequestMapping(value={"/api.js","/api-debug.js"},
                method=GET)
public void api(@RequestParam(value="apiNs",required=false,defaultValue="Ext.app")
                                             String apiNs,
                                             @RequestParam(value="actionNs",required=false)
                                             String actionNs,
                                             @RequestParam(value="remotingApiVar",required=false,defaultValue="REMOTING_API")
                                             String remotingApiVar,
                                             @RequestParam(value="pollingUrlsVar",required=false,defaultValue="POLLING_URLS")
                                             String pollingUrlsVar,
                                             @RequestParam(value="group",required=false)
                                             String group,
                                             javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response)
         throws IOException
Method that handles api.js calls. Generates a Javascript with the necessary code for Ext.Direct

Parameters:
apiNs - Name of the namespace the variable remotingApiVar will live in. Defaults to Ext.app
actionNs - Name of the namespace the action will live in.
remotingApiVar - Name of the remoting api variable. Defaults to REMOTING_API
pollingUrlsVar - Name of the polling urls object. Defaults to POLLING_URLS
group - Name of the api group
request -
response -
Throws:
IOException


Copyright © 2010. All Rights Reserved.