ch.ralscha.extdirectspring.api
Class ApiController
java.lang.Object
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, jeffreiffers
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ApiController
public ApiController()
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,
@RequestParam(value="fullRouterUrl",required=false,defaultValue="false")
boolean fullRouterUrl,
@RequestParam(value="format",required=false)
String format,
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.appactionNs - Name of the namespace the action will live in.remotingApiVar - Name of the remoting api variable. Defaults to REMOTING_APIpollingUrlsVar - Name of the polling urls object. Defaults to POLLING_URLSgroup - Name of the api groupfullRouterUrl - If true the router property contains the full request URL with method, server and port. Defaults to false
returns only the url without method, server and portformat - Only valid value is "json2. Ext Designer sends this parameter and the response is a valid JSON.
Defaults to null and response is standard Javascript.request - response -
- Throws:
IOException
Copyright © 2010-2011. All Rights Reserved.