ch.ralscha.extdirectspring.api
Class ApiController

java.lang.Object
  extended by ch.ralscha.extdirectspring.api.ApiController

@Controller
public class ApiController
extends Object

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

Author:
Ralph Schaer, jeffreiffers

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

Constructor Detail

ApiController

public ApiController(org.springframework.context.ApplicationContext context)
Method Detail

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.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
fullRouterUrl - 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 port
format - 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.