Return to www.inductionframework.org

com.acciente.induction.resolver
Class URLPathControllerResolver

java.lang.Object
  extended by com.acciente.induction.resolver.URLPathControllerResolver
All Implemented Interfaces:
ControllerResolver

public class URLPathControllerResolver
extends java.lang.Object
implements ControllerResolver

This class implements a controller resolver that maps the path info in the URL to a controller class name and method name. On the path following the servlet's context path is used. So assuming the servlet's context path is /myapp/cgi then given the URL:

/myapp/cgi/myapp/cart/CartController/addItem?item_id=widget-202&qty=500

the following part of the URL will be used for determining which controller/method to invoke:

/myapp/cart/CartController/additem

which would resolve to:

class-name: myapp.cart.CartController

method-name: addItem

If the path ends with a trailing slash the, it is assumed that no method name is given and the resolver will set the method name to null, which will cause the framework to invoke a default user-configurable controller method name.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.acciente.induction.resolver.ControllerResolver
ControllerResolver.Resolution
 
Constructor Summary
URLPathControllerResolver(Config.ControllerResolver oConfig)
           
 
Method Summary
 ControllerResolver.Resolution resolve(javax.servlet.http.HttpServletRequest oRequest)
          This method should resolve the class name of the controller and method name within same to be invoked in response to the specified HTTP request
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLPathControllerResolver

public URLPathControllerResolver(Config.ControllerResolver oConfig)
Method Detail

resolve

public ControllerResolver.Resolution resolve(javax.servlet.http.HttpServletRequest oRequest)
Description copied from interface: ControllerResolver
This method should resolve the class name of the controller and method name within same to be invoked in response to the specified HTTP request

Specified by:
resolve in interface ControllerResolver
Parameters:
oRequest - the HTTP request context in which the resolution is requested
Returns:
an object containing the class name of the controller to be invoked and the method name within same

Return to www.inductionframework.org

Copyright (c) 2008 Acciente, LLC. All rights reserved.