ch.ralscha.extdirectspring.controller
Class RouterController

java.lang.Object
  extended by ch.ralscha.extdirectspring.controller.RouterController
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean

@Controller
public class RouterController
extends Object
implements org.springframework.beans.factory.InitializingBean

Main router controller who handles polling, form handler and normal Ext.Direct calls

Author:
mansari, Ralph Schaer

Constructor Summary
RouterController(org.springframework.context.ApplicationContext context, org.springframework.core.convert.ConversionService conversionService, JsonHandler jsonHandler)
           
 
Method Summary
 void afterPropertiesSet()
           
 ExtDirectPollResponse poll(String beanName, String method, String event, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Locale locale)
           
 List<ExtDirectResponse> router(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Locale locale, Object requestData)
           
 String router(String extAction, String extMethod)
           
 void setConfiguration(Configuration configuration)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouterController

public RouterController(org.springframework.context.ApplicationContext context,
                        org.springframework.core.convert.ConversionService conversionService,
                        JsonHandler jsonHandler)
Method Detail

setConfiguration

public void setConfiguration(Configuration configuration)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

poll

@RequestMapping(value="/poll/{beanName}/{method}/{event}")
@ResponseBody
public ExtDirectPollResponse poll(@PathVariable(value="beanName")
                                                              String beanName,
                                                              @PathVariable(value="method")
                                                              String method,
                                                              @PathVariable(value="event")
                                                              String event,
                                                              javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response,
                                                              Locale locale)
                           throws Exception
Throws:
Exception

router

@RequestMapping(value="/router",
                method=POST,
                params="extAction")
public String router(@RequestParam(value="extAction")
                                    String extAction,
                                    @RequestParam(value="extMethod")
                                    String extMethod)

router

@RequestMapping(value="/router",
                method=POST,
                params="!extAction")
@ResponseBody
public List<ExtDirectResponse> router(javax.servlet.http.HttpServletRequest request,
                                                                  javax.servlet.http.HttpServletResponse response,
                                                                  Locale locale,
                                                                  @RequestBody
                                                                  Object requestData)


Copyright © 2010-2011. All Rights Reserved.