|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.wps.portlets.struts.plugins.ViewCommandFactory
public class ViewCommandFactory
The ViewCommandFactory
class is the default factory used in the
Struts Portlet Framework. The ViewComandFactory will process the URI and
determine the correct type of WpsStrutsViewCommand to create. The createCommand
method will determine the type of WpsStrutsViewCommand object to create based on the
extension. For example, a URI path of "/login.jsp" will result in the creation of a
WpsStrutsViewJspCommand. This class can be extended to allow the application to add
new extension types that should result in the creation of a new type of
WpsStrutsViewCommand. The ViewCommandFactories are registered per Struts module. A
Struts plugin can be used to determine which ViewCommandFactory is used for each
Struts module.
Field Summary | |
---|---|
protected static Log |
log
The commons-logging instance for this class. |
Constructor Summary | |
---|---|
ViewCommandFactory()
Default constructor for the ViewCommandFactory class. |
Method Summary | |
---|---|
WpsStrutsViewCommand |
createCommand(ErrorResponseInfo errorInfo,
HttpServletRequest request,
ViewCommandExecutionContext executionContext)
Creates a command based on the given ErrorResponseInfo. |
WpsStrutsViewCommand |
createCommand(java.lang.String uri,
HttpServletRequest request,
ViewCommandExecutionContext executionContext)
Creates a command based on the given URI and request. |
protected java.lang.String |
getExtensionLowerCase(java.lang.String uri)
Gets the extension from the given String URI. |
protected java.lang.String |
getExtensionUpperCase(java.lang.String uri)
Gets the extension from the given String URI. |
static ViewCommandFactory |
getFactory(ModuleContext moduleContext)
Gets the ViewCommandFactory object for this context. |
static ViewCommandFactory |
getFactory(ViewCommandExecutionContext viewCommandContext)
Gets the ViewCommandFactory object for the module. |
protected WpsStrutsViewCommand |
handleUnrecognizedExtension(java.lang.String uri,
HttpServletRequest request,
ViewCommandExecutionContext executionContext)
Handles an unrecognized extension. |
protected boolean |
isDynamicallyIncludedContent(java.lang.String uri)
Determines whether the given path can be included dynamically (like a JSP). |
protected boolean |
isDynamicallyIncludedContent(java.lang.String uri,
java.lang.String extLowerCase)
Determines whether the given path can be included dynamically (like a JSP). |
protected boolean |
isStaticallyIncludedContent(java.lang.String uri)
Determines whether the given path can be included statically (like HTML). |
protected boolean |
isStaticallyIncludedContent(java.lang.String uri,
java.lang.String extLowerCase)
Determines whether the given path can be included statically (like HTML). |
protected boolean |
isTilesIncludedContent(java.lang.String uri,
java.lang.String extLowerCase,
HttpServletRequest request)
Determines whether the given path can be included as a Struts Tiles JSP. |
static void |
setFactory(ModuleContext moduleContext,
ViewCommandFactory factory)
Sets a new ViewCommandFactory object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Log log
Constructor Detail |
---|
public ViewCommandFactory()
Method Detail |
---|
public static void setFactory(ModuleContext moduleContext, ViewCommandFactory factory)
moduleContext
- the module contextfactory
- the ViewCommandFactory objectpublic static ViewCommandFactory getFactory(ModuleContext moduleContext)
moduleContext
- the module context to use to find the factory
public static ViewCommandFactory getFactory(ViewCommandExecutionContext viewCommandContext)
viewCommandContext
- the ViewCommandExecutionContext object
public WpsStrutsViewCommand createCommand(java.lang.String uri, HttpServletRequest request, ViewCommandExecutionContext executionContext)
uri
- path to resourcerequest
- the request objectexecutionContext
- the ViewCommandExecutionContext object
null
public WpsStrutsViewCommand createCommand(ErrorResponseInfo errorInfo, HttpServletRequest request, ViewCommandExecutionContext executionContext)
errorInfo
- ErrorResponseInforequest
- the requestcontext
- ViewCommandExecutionContext
protected boolean isStaticallyIncludedContent(java.lang.String uri)
uri
- path to resource
protected boolean isStaticallyIncludedContent(java.lang.String uri, java.lang.String extLowerCase)
uri
- path to resourceextLowerCase
- the file extension in lower case
protected boolean isDynamicallyIncludedContent(java.lang.String uri)
uri
- path to resource
protected boolean isDynamicallyIncludedContent(java.lang.String uri, java.lang.String extLowerCase)
uri
- path to resourceextLowerCase
- file extension from path in lower case
protected boolean isTilesIncludedContent(java.lang.String uri, java.lang.String extLowerCase, HttpServletRequest request)
uri
- path to resourceextLowerCase
- file extension from path in lower caserequest
- the request object
protected WpsStrutsViewCommand handleUnrecognizedExtension(java.lang.String uri, HttpServletRequest request, ViewCommandExecutionContext executionContext)
uri
- path to resourcerequest
- the request we are processingexecutionContext
- the ViewCommandExecutionContext object
protected java.lang.String getExtensionLowerCase(java.lang.String uri)
null
if no extension found.
uri
- path to resource
null
otherwiseprotected java.lang.String getExtensionUpperCase(java.lang.String uri)
null
if no extension found.
uri
- path to resource
null
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |