org.apache.struts2.codebehind
Class CodebehindUnknownHandler

java.lang.Object
  extended by org.apache.struts2.codebehind.CodebehindUnknownHandler
All Implemented Interfaces:
com.opensymphony.xwork2.UnknownHandler

public class CodebehindUnknownHandler
extends Object
implements com.opensymphony.xwork2.UnknownHandler

Uses code-behind conventions to solve the two unknown problems.


Field Summary
protected  Configuration configuration
           
protected  String defaultPackageName
           
protected static com.opensymphony.xwork2.util.logging.Logger LOG
           
protected  com.opensymphony.xwork2.ObjectFactory objectFactory
           
protected  Map<String,com.opensymphony.xwork2.config.entities.ResultTypeConfig> resultsByExtension
           
protected  javax.servlet.ServletContext servletContext
           
protected  String templatePathPrefix
           
 
Constructor Summary
CodebehindUnknownHandler(String defaultPackage, Configuration configuration)
           
 
Method Summary
protected  com.opensymphony.xwork2.config.entities.ActionConfig buildActionConfig(String path, String namespace, String actionName, com.opensymphony.xwork2.config.entities.ResultTypeConfig resultTypeConfig)
          Create a new ActionConfig in the default package, with the default interceptor stack and a single result
protected  com.opensymphony.xwork2.Result buildResult(String path, String resultCode, com.opensymphony.xwork2.config.entities.ResultTypeConfig config, com.opensymphony.xwork2.ActionContext invocationContext)
           
protected  String determinePath(String prefix, String ns)
           
 com.opensymphony.xwork2.config.entities.ActionConfig handleUnknownAction(String namespace, String actionName)
           
 Object handleUnknownActionMethod(Object action, String methodName)
          Not used
 com.opensymphony.xwork2.Result handleUnknownResult(com.opensymphony.xwork2.ActionContext actionContext, String actionName, com.opensymphony.xwork2.config.entities.ActionConfig actionConfig, String resultCode)
           
protected  String joinPaths(boolean leadingSlash, boolean trailingSlash, String... parts)
           
 void setObjectFactory(com.opensymphony.xwork2.ObjectFactory objectFactory)
           
 void setPathPrefix(String prefix)
           
 void setServletContext(javax.servlet.ServletContext servletContext)
           
protected  String string(String... parts)
           
protected  String stripLeadingSlash(String path)
           
protected  String stripSlashes(String path)
           
protected  String stripTrailingSlash(String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultPackageName

protected String defaultPackageName

servletContext

protected javax.servlet.ServletContext servletContext

resultsByExtension

protected Map<String,com.opensymphony.xwork2.config.entities.ResultTypeConfig> resultsByExtension

templatePathPrefix

protected String templatePathPrefix

configuration

protected Configuration configuration

objectFactory

protected com.opensymphony.xwork2.ObjectFactory objectFactory

LOG

protected static final com.opensymphony.xwork2.util.logging.Logger LOG
Constructor Detail

CodebehindUnknownHandler

public CodebehindUnknownHandler(String defaultPackage,
                                Configuration configuration)
Method Detail

setPathPrefix

public void setPathPrefix(String prefix)

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)

setObjectFactory

public void setObjectFactory(com.opensymphony.xwork2.ObjectFactory objectFactory)

handleUnknownAction

public com.opensymphony.xwork2.config.entities.ActionConfig handleUnknownAction(String namespace,
                                                                                String actionName)
                                                                         throws com.opensymphony.xwork2.XWorkException
Specified by:
handleUnknownAction in interface com.opensymphony.xwork2.UnknownHandler
Throws:
com.opensymphony.xwork2.XWorkException

buildActionConfig

protected com.opensymphony.xwork2.config.entities.ActionConfig buildActionConfig(String path,
                                                                                 String namespace,
                                                                                 String actionName,
                                                                                 com.opensymphony.xwork2.config.entities.ResultTypeConfig resultTypeConfig)
Create a new ActionConfig in the default package, with the default interceptor stack and a single result


handleUnknownResult

public com.opensymphony.xwork2.Result handleUnknownResult(com.opensymphony.xwork2.ActionContext actionContext,
                                                          String actionName,
                                                          com.opensymphony.xwork2.config.entities.ActionConfig actionConfig,
                                                          String resultCode)
                                                   throws com.opensymphony.xwork2.XWorkException
Specified by:
handleUnknownResult in interface com.opensymphony.xwork2.UnknownHandler
Throws:
com.opensymphony.xwork2.XWorkException

buildResult

protected com.opensymphony.xwork2.Result buildResult(String path,
                                                     String resultCode,
                                                     com.opensymphony.xwork2.config.entities.ResultTypeConfig config,
                                                     com.opensymphony.xwork2.ActionContext invocationContext)

string

protected String string(String... parts)

joinPaths

protected String joinPaths(boolean leadingSlash,
                           boolean trailingSlash,
                           String... parts)

determinePath

protected String determinePath(String prefix,
                               String ns)

stripLeadingSlash

protected String stripLeadingSlash(String path)

stripTrailingSlash

protected String stripTrailingSlash(String path)

stripSlashes

protected String stripSlashes(String path)

handleUnknownActionMethod

public Object handleUnknownActionMethod(Object action,
                                        String methodName)
                                 throws NoSuchMethodException
Not used

Specified by:
handleUnknownActionMethod in interface com.opensymphony.xwork2.UnknownHandler
Throws:
NoSuchMethodException


Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.