Java Doc for AbstractUrlHandlerMapping.java in  » J2EE » spring-framework-2.0.6 » org » springframework » web » servlet » handler » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.web.servlet.handler 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.web.servlet.handler.AbstractHandlerMapping
   org.springframework.web.servlet.handler.AbstractUrlHandlerMapping

All known Subclasses:   org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping,  org.springframework.web.servlet.handler.metadata.AbstractPathMapHandlerMapping,  org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,  org.springframework.web.servlet.handler.SimpleUrlHandlerMapping,
AbstractUrlHandlerMapping
abstract public class AbstractUrlHandlerMapping extends AbstractHandlerMapping (Code)
Abstract base class for URL-mapped org.springframework.web.servlet.HandlerMapping implementations. Provides infrastructure for mapping handlers to URLs and configurable URL lookup. For information on the latter, see "alwaysUseFullPath" property.

Supports direct matches, e.g. a registered "/test" matches "/test", and various Ant-style pattern matches, e.g. a registered "/t*" pattern matches both "/test" and "/team", "/test/*" matches all paths in the "/test" directory, "/test/**" matches all paths below "/test". For details, see the org.springframework.util.AntPathMatcher AntPathMatcher javadoc.

Will search all path patterns to find the most exact match for the current request path. The most exact match is defined as the longest path pattern that matches the current request path.
author:
   Juergen Hoeller
since:
   16.04.2003
See Also:   AbstractUrlHandlerMapping.setAlwaysUseFullPath
See Also:   AbstractUrlHandlerMapping.setUrlDecode
See Also:   org.springframework.util.AntPathMatcher





Method Summary
protected  voidexposePathWithinMapping(String pathWithinMapping, HttpServletRequest request)
     Expose the path within the current mapping as request attribute.
protected  ObjectgetHandlerInternal(HttpServletRequest request)
     Look up a handler for the URL path of the given request.
final public  MapgetHandlerMap()
     Return the registered handlers as an unmodifiable Map, with the registered path as key and the handler object (or handler bean name in case of a lazy-init handler) as value.
public  ObjectgetRootHandler()
     Return the root handler for this handler mapping (registered for "/"), or null if none.
protected  ObjectlookupHandler(String urlPath, HttpServletRequest request)
     Look up a handler instance for the given URL path.

Supports direct matches, e.g.

protected  voidregisterHandler(String[] urlPaths, String beanName)
     Register the specified handler for the given URL paths.
protected  voidregisterHandler(String urlPath, Object handler)
     Register the specified handler for the given URL path.
public  voidsetAlwaysUseFullPath(boolean alwaysUseFullPath)
     Set if URL lookup should always use the full path within the current servlet context.
public  voidsetLazyInitHandlers(boolean lazyInitHandlers)
     Set whether to lazily initialize handlers.
public  voidsetPathMatcher(PathMatcher pathMatcher)
     Set the PathMatcher implementation to use for matching URL paths against registered URL patterns.
public  voidsetRootHandler(Object rootHandler)
     Set the root handler for this handler mapping, that is, the handler to be registered for the root path ("/").
public  voidsetUrlDecode(boolean urlDecode)
     Set if context path and request URI should be URL-decoded.
public  voidsetUrlPathHelper(UrlPathHelper urlPathHelper)
     Set the UrlPathHelper to use for resolution of lookup paths.



Method Detail
exposePathWithinMapping
protected void exposePathWithinMapping(String pathWithinMapping, HttpServletRequest request)(Code)
Expose the path within the current mapping as request attribute.
Parameters:
  pathWithinMapping - the path within the current mapping
Parameters:
  request - the request to expose the path to
See Also:   AbstractUrlHandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE



getHandlerInternal
protected Object getHandlerInternal(HttpServletRequest request) throws Exception(Code)
Look up a handler for the URL path of the given request.
Parameters:
  request - current HTTP request the handler instance, or null if none found



getHandlerMap
final public Map getHandlerMap()(Code)
Return the registered handlers as an unmodifiable Map, with the registered path as key and the handler object (or handler bean name in case of a lazy-init handler) as value.
See Also:   AbstractUrlHandlerMapping.getDefaultHandler()



getRootHandler
public Object getRootHandler()(Code)
Return the root handler for this handler mapping (registered for "/"), or null if none.



lookupHandler
protected Object lookupHandler(String urlPath, HttpServletRequest request)(Code)
Look up a handler instance for the given URL path.

Supports direct matches, e.g. a registered "/test" matches "/test", and various Ant-style pattern matches, e.g. a registered "/t*" matches both "/test" and "/team". For details, see the AntPathMatcher class.

Looks for the most exact pattern, where most exact is defined as the longest path pattern.
Parameters:
  urlPath - URL the bean is mapped to
Parameters:
  request - current HTTP request (to expose the path within the mapping to) the associated handler instance, or null if not found
See Also:   AbstractUrlHandlerMapping.exposePathWithinMapping
See Also:   org.springframework.util.AntPathMatcher




registerHandler
protected void registerHandler(String[] urlPaths, String beanName) throws BeansException, IllegalStateException(Code)
Register the specified handler for the given URL paths.
Parameters:
  urlPaths - the URLs that the bean should be mapped to
Parameters:
  beanName - the name of the handler bean
throws:
  BeansException - if the handler couldn't be registered
throws:
  IllegalStateException - if there is a conflicting handler registered



registerHandler
protected void registerHandler(String urlPath, Object handler) throws BeansException, IllegalStateException(Code)
Register the specified handler for the given URL path.
Parameters:
  urlPath - the URL the bean should be mapped to
Parameters:
  handler - the handler instance or handler bean name String(a bean name will automatically be resolved into the corrresponding handler bean)
throws:
  BeansException - if the handler couldn't be registered
throws:
  IllegalStateException - if there is a conflicting handler registered



setAlwaysUseFullPath
public void setAlwaysUseFullPath(boolean alwaysUseFullPath)(Code)
Set if URL lookup should always use the full path within the current servlet context. Else, the path within the current servlet mapping is used if applicable (that is, in the case of a ".../*" servlet mapping in web.xml).

Default is "false".
See Also:   org.springframework.web.util.UrlPathHelper.setAlwaysUseFullPath




setLazyInitHandlers
public void setLazyInitHandlers(boolean lazyInitHandlers)(Code)
Set whether to lazily initialize handlers. Only applicable to singleton handlers, as prototypes are always lazily initialized. Default is "false", as eager initialization allows for more efficiency through referencing the controller objects directly.

If you want to allow your controllers to be lazily initialized, make them "lazy-init" and set this flag to true. Just making them "lazy-init" will not work, as they are initialized through the references from the handler mapping in this case.




setPathMatcher
public void setPathMatcher(PathMatcher pathMatcher)(Code)
Set the PathMatcher implementation to use for matching URL paths against registered URL patterns. Default is AntPathMatcher.
See Also:   org.springframework.util.AntPathMatcher



setRootHandler
public void setRootHandler(Object rootHandler)(Code)
Set the root handler for this handler mapping, that is, the handler to be registered for the root path ("/").

Default is null, indicating no root handler.




setUrlDecode
public void setUrlDecode(boolean urlDecode)(Code)
Set if context path and request URI should be URL-decoded. Both are returned undecoded by the Servlet API, in contrast to the servlet path.

Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).

Note: Setting this to "true" requires JDK 1.4 if the encoding differs from the VM's platform default encoding, as JDK 1.3's URLDecoder class does not offer a way to specify the encoding.
See Also:   org.springframework.web.util.UrlPathHelper.setUrlDecode




setUrlPathHelper
public void setUrlPathHelper(UrlPathHelper urlPathHelper)(Code)
Set the UrlPathHelper to use for resolution of lookup paths.

Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple HandlerMappings and MethodNameResolvers.
See Also:   org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver.setUrlPathHelper




Methods inherited from org.springframework.web.servlet.handler.AbstractHandlerMapping
protected HandlerInterceptor adaptInterceptor(Object interceptor)(Code)(Java Doc)
protected void extendInterceptors(List interceptors)(Code)(Java Doc)
final protected HandlerInterceptor[] getAdaptedInterceptors()(Code)(Java Doc)
public Object getDefaultHandler()(Code)(Java Doc)
final public HandlerExecutionChain getHandler(HttpServletRequest request) throws Exception(Code)(Java Doc)
protected HandlerExecutionChain getHandlerExecutionChain(Object handler, HttpServletRequest request)(Code)(Java Doc)
abstract protected Object getHandlerInternal(HttpServletRequest request) throws Exception(Code)(Java Doc)
final public int getOrder()(Code)(Java Doc)
protected void initApplicationContext() throws BeansException(Code)(Java Doc)
protected void initInterceptors()(Code)(Java Doc)
public void setDefaultHandler(Object defaultHandler)(Code)(Java Doc)
public void setInterceptors(Object[] interceptors)(Code)(Java Doc)
final public void setOrder(int order)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.