Java Doc for FlowController.java in  » Library » Apache-beehive-1.0.2-src » org » apache » beehive » netui » pageflow » 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 » Library » Apache beehive 1.0.2 src » org.apache.beehive.netui.pageflow 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.beehive.netui.pageflow.PageFlowManagedObject
      org.apache.beehive.netui.pageflow.FlowController

All known Subclasses:   org.apache.beehive.netui.pageflow.PageFlowController,  org.apache.beehive.netui.pageflow.SharedFlowController,
FlowController
abstract public class FlowController extends PageFlowManagedObject implements PageFlowConstants,ActionResolver(Code)
Base class for user-written flow controllers - PageFlowController s and SharedFlowController s.

Inner Class :static class PerRequestState

Field Summary
protected static  LocaledefaultLocale
     The system default Locale.

Constructor Summary
protected  FlowController()
     Default constructor.

Method Summary
protected  voidaddActionError(String propertyName, String messageKey, Object[] messageArgs)
     Add a property-related message that will be shown with the Errors and Error tags.
protected  voidaddActionErrorExpression(String propertyName, String expression, Object[] messageArgs)
     Add a property-related message as an expression that will be evaluated and shown with the Errors and Error tags.
protected  voidaddValidationError(String propertyName, String messageKey, Object[] messageArgs)
     Add a validation error that will be shown with the Errors and Error tags.
protected  voidaddValidationError(String propertyName, String messageKey)
     Add a validation error that will be shown with the Errors and Error tags.
protected synchronized  voidafterAction()
     Callback that occurs after any user action method is invoked.
protected  booleanalwaysTrackPreviousAction()
     When this FlowController does not use a org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward annotation with a navigateTo= org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo.previousAction Jpf.NavigateTo.previousAction attribute, the following methods always return null by default.
protected  booleanalwaysTrackPreviousPage()
     When this FlowController does not use a org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward annotation with either a navigateTo= org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo.currentPage Jpf.NavigateTo.currentPage attribute or a navigateTo= org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo.previousPage Jpf.NavigateTo.previousPage attribute, the following methods always return null by default.
protected synchronized  voidbeforeAction()
     Callback that occurs before any user action method is invoked.
public synchronized  voidcreate(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
     Initialize after object creation.
 NotLoggedInExceptioncreateNotLoggedInException(String actionName, HttpServletRequest request)
    
 voiddecrementRequestCount(HttpServletRequest request)
    
 voiddestroy(HttpSession session)
     Internal destroy method that is invoked when this object is being removed from the session.
public  ActionForwardexecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
     Perform decision logic to determine the next URI to be displayed.
Parameters:
  mapping - the Struts ActionMapping for the current action being processed.
Parameters:
  form - the form-bean (if any) associated with the Struts action being processed.
 ActionForwardforwardTo(ActionForward fwd, ActionMapping mapping, PageFlowExceptionConfig exceptionConfig, String actionName, ModuleConfig altModuleConfig, ActionForm form, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
    
protected  StringgenerateToken(HttpServletRequest request)
     Generate a new transaction token, to be used for enforcing a single request for a particular transaction.
protected  StringgenerateToken()
     Generate a new transaction token, to be used for enforcing a single request for a particular transaction.
final protected  ActionMappinggetActionMapping()
     Get the current Struts ActionMapping, which is information from the Struts-XML <action> tag that corresponds to the current action being executed.
protected  MethodgetActionMethod(String methodName, Class argType)
     Get an action handler method of the given name/signature.
Parameters:
  methodName - the name of the action handler method to query.
Parameters:
  argType - the type of the argument to the action handler method; if null,the method takes no arguments.
 ActionForwardgetActionMethodForward(String actionName, Object inputForm, HttpServletRequest request, HttpServletResponse response, ActionMapping mapping)
     Get the ActionForward returned by the action handler method that corresponds to the given action name and form-bean, or send an error to the browser if there is no matching method.
Parameters:
  actionName - the name of the Struts action to handle.
Parameters:
  inputForm - the form-bean associated with the action.
public  MutableURIgetActionURI(String actionName)
     Create a raw action URI, which can be modified before being sent through the registered URL rewriting chain using org.apache.beehive.netui.core.urls.URLRewriterService.rewriteURL .
Parameters:
  actionName - the action name to convert into a MutableURI; may be qualified with a path from the webapproot, in which case the parent directory from the current request is not used.
protected  String[]getActions()
     Get a list of the names of actions handled by methods in this PageFlowController.
protected  StringgetCurrentActionName()
     Get the name of the current action being executed.
protected  DataSourcegetDataSource(HttpServletRequest request)
     Return the default data source for the Struts module associated with this FlowController.
protected  DataSourcegetDataSource(HttpServletRequest request, String key)
     Return the specified data source for the current Struts module.
protected static  LocalegetDefaultLocale()
     Get the system default locale.
public  ActionFormgetFormBean(ActionMapping mapping)
     Get the flow-scoped form bean member associated with the given ActionMapping.
 FlowControllerHandlerContextgetHandlerContext()
    
protected  LocalegetLocale(HttpServletRequest request)
     Return the user's currently selected Locale.
Parameters:
  request - the current request.
protected  LocalegetLocale()
     Get the user's currently selected Locale.
final protected  ActionMappinggetMapping()
     Get the current Struts ActionMapping, which is information from the Struts-XML <action> tag that corresponds to the current action being executed.
protected  MessageResourcesgetMessageResources()
     Get the default message resources for this FlowController.
protected  MessageResourcesgetMessageResources(String key)
     Get the specified message resources for this FlowController.
final protected  ModuleConfiggetModuleConfig()
     Get the Struts ModuleConfig object associated with this FlowController.
public  ModuleConfiggetModuleConfig(ServletContext servletContext, HttpServletRequest request)
     Gets the Struts module configuration associated with this controller. FlowController.getModuleConfig()
Parameters:
  servletContext - the current ServletContext.
abstract public  StringgetModulePath()
     Get the Struts module path for this controller.
abstract public  PreviousPageInfogetPreviousPageInfoLegacy(PageFlowController curJpf, HttpServletRequest request)
     Get a legacy PreviousPageInfo.
final protected  HttpServletRequestgetRequest()
     Get the current HttpServletRequest.
 PageFlowRequestProcessorgetRequestProcessor()
    
protected  MessageResourcesgetResources()
     Return the message resources for the default module.
protected  MessageResourcesgetResources(HttpServletRequest request)
     Return the default message resources for the current module.
protected  MessageResourcesgetResources(HttpServletRequest request, String key)
     Return the specified message resources for the current module.
final protected  HttpServletResponsegetResponse()
     Get the current HttpServletResponse.
public  StringgetRewrittenActionURI(String actionName, Map parameters, boolean asValidXml)
     Create a fully-rewritten URI given an action and parameters.
protected  ActionServletgetServlet()
     Get the current Struts ActionServlet.
final protected  HttpSessiongetSession()
     Get the current user session.
public  PrincipalgetUserPrincipal()
     Get the current logged-in user.
public synchronized  ActionForwardhandleException(Throwable ex, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
     Handle the given exception - invoke user code if appropriate and return a destination URI.
Parameters:
  ex - the Exception to handle.
Parameters:
  mapping - the Struts action mapping for current Struts action being processed.
Parameters:
  form - the form-bean (if any) associated with the Struts action being processed.
 booleanincrementRequestCount(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
     Increment the count of concurrent requests to this FlowController.
protected  ActionForwardinternalExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
     Internal method used to execute an action on a FlowController.
protected  ActionForwardinvokeActionMethod(Method method, Object arg)
     Invoke the given action handler method, passing it an argument if appropriate.
Parameters:
  method - the action handler method to invoke.
Parameters:
  arg - the form-bean to pass; may be null.
 ActionForwardinvokeActionMethod(Method method, Object arg, HttpServletRequest request, ActionMapping mapping)
     Invoke the given action handler method, passing it an argument if appropriate.
Parameters:
  method - the action handler method to invoke.
Parameters:
  arg - the form-bean to pass; may be null.
Parameters:
  request - the current HttpServletRequest.
public synchronized  ActionForwardinvokeExceptionHandler(Method method, Throwable ex, String message, ActionForm wrappedFormBean, PageFlowExceptionConfig exceptionConfig, ActionMapping actionMapping, HttpServletRequest request, HttpServletResponse response)
     Invoke the given exception handler method.
public  booleanisAction(String name)
     Tell whether a given String is the name of an action handled by a method in this PageFlowController.
Parameters:
  name - the action-name to query.
protected  booleanisCancelled(HttpServletRequest request)
    

Returns true if the current form's cancel button was pressed.

public  booleanisPageFlow()
     Tell whether this is a PageFlowController .
protected  booleanisTokenValid(HttpServletRequest request)
     Return true if there is a transaction token stored in the user's current session, and the value submitted as a request parameter with this action matches it.
protected  booleanisTokenValid()
     Return true if there is a transaction token stored in the user's current session, and the value submitted as a request parameter with this action matches it.
protected  booleanisTokenValid(HttpServletRequest request, boolean reset)
     Return true if there is a transaction token stored in the user's current session, and the value submitted as a request parameter with this action matches it.
protected  booleanisTokenValid(boolean reset)
     Return true if there is a transaction token stored in the user's current session, and the value submitted as a request parameter with this action matches it.
public  booleanisUserInRole(String roleName)
     Tell whether the current logged-in user is a member of a given role.
public  voidlogin(String username, String password)
     Log in the user, using "weak" username/password authentication.
public  voidlogout(boolean invalidateSessions)
     Log out the current user.
public static  ActionResultlookup(String actionName, ServletContext context, HttpServletRequest request, HttpServletResponse response)
     Resolve the given action name to a URI.
public static  ActionResultlookup(String actionName, ServletContext context, HttpServletRequest request, HttpServletResponse response, String actionServletClassName)
     Resolve the given action name to a URI. Note: this method invokes the full action-processing cycle on a ScopedRequest .
protected  voidonCreate()
     Callback that is invoked when this controller instance is created.
protected  voidonDestroy()
     Callback that is invoked when this controller instance is "destroyed", i.e., removed from the user session.
protected  voidonDestroy(HttpSession session)
     Callback that is invoked when this controller instance is "destroyed", i.e., removed from the user session.
protected  voidonRefresh()
     Callback that is invoked when this controller is involved in a refresh request, as can happen in a portal environment on a request where no action is run in the current page flow, but a previously-displayed page in the page flow is re-rendered.
final public synchronized  voidrefresh(HttpServletRequest request, HttpServletResponse response)
     Called on this object for non-lookup (refresh) requests.
public  voidreinitialize(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
     Reinitialize the object for a new request.
protected  voidremove()
     Remove this instance from the user session.
protected  voidresetToken(HttpServletRequest request)
     Reset the saved transaction token in the user's session.
protected  voidresetToken()
     Reset the saved transaction token in the user's session.
public  StringresolveAction(String actionName, Object form, HttpServletRequest request, HttpServletResponse response)
     Call an action and return the result URI.
Parameters:
  actionName - the name of the action to run.
Parameters:
  form - the form bean instance to pass to the action, or null if none should be passed.
public  StringresolveAction(String actionName, Object form)
     Call an action and return the result URI. FlowController.resolveAction(StringObjectHttpServletRequestHttpServletResponse)
Parameters:
  actionName - the name of the action to run.
Parameters:
  form - the form bean instance to pass to the action, or null if none should be passed.
public static  LocaleretrieveUserLocale(HttpServletRequest request, String locale)
    
protected  voidsaveActionErrors(ActionMessages errors)
     Save the specified messages keys into the request for use by the <netui:error> or <netui:errors> tags.
protected  voidsaveErrors(HttpServletRequest request, ActionMessages errors)
     Save the specified messages keys into the request for use by the <netui:error> or <netui:errors> tags.
protected  voidsaveMessages(HttpServletRequest request, ActionMessages messages)
     Save the specified messages keys into the appropriate request attribute for use by the Struts <html:messages> tag (if messages="true" is set), if any messages are required.
 voidsavePreviousActionInfo(ActionForm form, HttpServletRequest request, ActionMapping mapping, ServletContext servletContext)
     Used by derived classes to store information on the most recent action executed.
public  voidsavePreviousPageInfo(ActionForward forward, ActionForm form, ActionMapping mapping, HttpServletRequest request, ServletContext servletContext, boolean isSpecialForward)
     Store information about recent pages displayed.
protected  voidsaveToken(HttpServletRequest request)
     Save a new transaction token in the user's current session, creating a new session if necessary.
protected  voidsendError(String errText, HttpServletResponse response)
     Send a Page Flow error to the browser.
protected  voidsendError(String errText, HttpServletRequest request, HttpServletResponse response)
     Send a Page Flow error to the browser.
protected  voidsetLocale(HttpServletRequest request, Locale locale)
     Set the user's currently selected Locale.
protected  voidsetLocale(Locale locale)
     Set the user's currently selected Locale.
 PerRequestStatesetPerRequestState(PerRequestState state)
    
final public  ModuleConfigtheModuleConfig()
     This is a non-property public accessor that will return the property value moduleConfig.

Field Detail
defaultLocale
protected static Locale defaultLocale(Code)
The system default Locale. FlowController.getDefaultLocale




Constructor Detail
FlowController
protected FlowController()(Code)
Default constructor.




Method Detail
addActionError
protected void addActionError(String propertyName, String messageKey, Object[] messageArgs)(Code)
Add a property-related message that will be shown with the Errors and Error tags.
Parameters:
  propertyName - the name of the property with which to associate this error.
Parameters:
  messageKey - the message-resources key for the message.
Parameters:
  messageArgs - zero or more arguments to the message.



addActionErrorExpression
protected void addActionErrorExpression(String propertyName, String expression, Object[] messageArgs)(Code)
Add a property-related message as an expression that will be evaluated and shown with the Errors and Error tags.
Parameters:
  propertyName - the name of the property with which to associate this error.
Parameters:
  expression - the expression that will be evaluated to generate the error message.
Parameters:
  messageArgs - zero or more arguments to the message; may be expressions.



addValidationError
protected void addValidationError(String propertyName, String messageKey, Object[] messageArgs)(Code)
Add a validation error that will be shown with the Errors and Error tags. FlowController.addActionError
Parameters:
  propertyName - the name of the property with which to associate this error.
Parameters:
  messageKey - the message-resources key for the error message.
Parameters:
  messageArgs - an array of arguments for the error message.



addValidationError
protected void addValidationError(String propertyName, String messageKey)(Code)
Add a validation error that will be shown with the Errors and Error tags. FlowController.addActionError
Parameters:
  propertyName - the name of the property with which to associate this error.
Parameters:
  messageKey - the message-resources key for the error message.



afterAction
protected synchronized void afterAction() throws Exception(Code)
Callback that occurs after any user action method is invoked. FlowController.getRequest , FlowController.getResponse , FlowController.getSession , and FlowController.getActionMapping may all be used during this method. The action that was run can be discovered by calling ActionMapping.getPath on the value returned from FlowController.getActionMapping .



alwaysTrackPreviousAction
protected boolean alwaysTrackPreviousAction()(Code)
When this FlowController does not use a org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward annotation with a navigateTo= org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo.previousAction Jpf.NavigateTo.previousAction attribute, the following methods always return null by default.
  • getPreviousActionInfo
  • getPreviousActionURI
  • getPreviousForm
Override alwaysTrackPreviousAction (which always returns false) to enable these methods in all cases. true if the previous action should always be tracked, regardless of whetherreturn-to="previousAction" is used.
See Also:   PageFlowController.getPreviousActionInfo
See Also:   PageFlowController.getPreviousActionURI
See Also:   PageFlowController.getPreviousFormBean



alwaysTrackPreviousPage
protected boolean alwaysTrackPreviousPage()(Code)
When this FlowController does not use a org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward annotation with either a navigateTo= org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo.currentPage Jpf.NavigateTo.currentPage attribute or a navigateTo= org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo.previousPage Jpf.NavigateTo.previousPage attribute, the following methods always return null by default.
  • getCurrentPageInfo
  • getPreviousPageInfo
  • getCurrentForwardPath
  • getPreviousForwardPath
Override alwaysTrackPreviousPage (which always returns false) to enable these methods in all cases. true if the previous page should always be tracked, regardlessof whether return-to="currentPage" or return-to="previousPage"is used.
See Also:   PageFlowController.getCurrentPageInfo
See Also:   PageFlowController.getPreviousPageInfo
See Also:   PageFlowController.getCurrentForwardPath
See Also:   PageFlowController.getPreviousForwardPath



beforeAction
protected synchronized void beforeAction() throws Exception(Code)
Callback that occurs before any user action method is invoked. FlowController.getRequest , FlowController.getResponse , FlowController.getSession , and FlowController.getActionMapping may all be used during this method. The action to be run can be discovered by calling ActionMapping.getPath on the value returned from FlowController.getActionMapping .



create
public synchronized void create(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)(Code)
Initialize after object creation. This is a framework-invoked method; it should not normally be called directly.



createNotLoggedInException
NotLoggedInException createNotLoggedInException(String actionName, HttpServletRequest request)(Code)



decrementRequestCount
void decrementRequestCount(HttpServletRequest request)(Code)



destroy
void destroy(HttpSession session)(Code)
Internal destroy method that is invoked when this object is being removed from the session. This is a framework-invoked method; it should not normally be called directly.



execute
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception(Code)
Perform decision logic to determine the next URI to be displayed.
Parameters:
  mapping - the Struts ActionMapping for the current action being processed.
Parameters:
  form - the form-bean (if any) associated with the Struts action being processed. May be null.
Parameters:
  request - the current HttpServletRequest.
Parameters:
  response - the current HttpServletResponse. a Struts ActionForward object that specifies the next URI to be displayed.
throws:
  Exception - if an Exception was thrown during user action-handling code.



forwardTo
ActionForward forwardTo(ActionForward fwd, ActionMapping mapping, PageFlowExceptionConfig exceptionConfig, String actionName, ModuleConfig altModuleConfig, ActionForm form, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)(Code)



generateToken
protected String generateToken(HttpServletRequest request)(Code)
Generate a new transaction token, to be used for enforcing a single request for a particular transaction.
Parameters:
  request - the current request.FlowController.generateToken()



generateToken
protected String generateToken()(Code)
Generate a new transaction token, to be used for enforcing a single request for a particular transaction.
See Also:   FlowController.isTokenValid()
See Also:   FlowController.isTokenValid(boolean)
See Also:   FlowController.resetToken()



getActionMapping
final protected ActionMapping getActionMapping()(Code)
Get the current Struts ActionMapping, which is information from the Struts-XML <action> tag that corresponds to the current action being executed. This call is only valid during FlowController.execute (where any user action method is invoked), and during the lifecycle methods FlowController.beforeAction and FlowController.afterAction . the current Struts ActionMapping.
throws:
  IllegalStateException - if this method is invoked outside of action methodexecution (i.e., outside of the call to FlowController.execute, and outside ofFlowController.onCreate, FlowController.beforeAction, FlowController.afterAction.



getActionMethod
protected Method getActionMethod(String methodName, Class argType)(Code)
Get an action handler method of the given name/signature.
Parameters:
  methodName - the name of the action handler method to query.
Parameters:
  argType - the type of the argument to the action handler method; if null,the method takes no arguments. the desired Method, or null if it doesn't exist.



getActionMethodForward
ActionForward getActionMethodForward(String actionName, Object inputForm, HttpServletRequest request, HttpServletResponse response, ActionMapping mapping) throws Exception(Code)
Get the ActionForward returned by the action handler method that corresponds to the given action name and form-bean, or send an error to the browser if there is no matching method.
Parameters:
  actionName - the name of the Struts action to handle.
Parameters:
  inputForm - the form-bean associated with the action. May be null.
Parameters:
  response - the current HttpServletResponse. the ActionForward returned by the action handler method, or null ifthere was no matching method (in which case an error was written to thebrowser.
throws:
  Exception - if an Exception was raised in user code.



getActionURI
public MutableURI getActionURI(String actionName) throws URISyntaxException(Code)
Create a raw action URI, which can be modified before being sent through the registered URL rewriting chain using org.apache.beehive.netui.core.urls.URLRewriterService.rewriteURL .
Parameters:
  actionName - the action name to convert into a MutableURI; may be qualified with a path from the webapproot, in which case the parent directory from the current request is not used. a MutableURI for the given action, suitable for URL rewriting.
throws:
  URISyntaxException - if there is a problem converting the action URI (derivedfrom processing the given action name) into a MutableURI.
throws:
  IllegalStateException - if this method is invoked outside of action methodexecution (i.e., outside of the call to FlowController.execute,and outside of FlowController.onCreate,FlowController.beforeAction, FlowController.afterAction.



getActions
protected String[] getActions()(Code)
Get a list of the names of actions handled by methods in this PageFlowController. a String array containing the names of actions handled by methods in this PageFlowController.



getCurrentActionName
protected String getCurrentActionName()(Code)
Get the name of the current action being executed. This call is only valid during FlowController.execute (where any user action method is invoked), and during the lifecycle methods FlowController.beforeAction and FlowController.afterAction . the name of the current action being executed.
throws:
  IllegalStateException - if this method is invoked outside of action methodexecution (i.e., outside of the call to FlowController.execute, and outside ofFlowController.onCreate, FlowController.beforeAction, FlowController.afterAction.



getDataSource
protected DataSource getDataSource(HttpServletRequest request)(Code)
Return the default data source for the Struts module associated with this FlowController.
Parameters:
  request - the current request.



getDataSource
protected DataSource getDataSource(HttpServletRequest request, String key)(Code)
Return the specified data source for the current Struts module.
Parameters:
  request - The servlet request we are processing
Parameters:
  key - The key specified in the<message-resources> element for therequested bundle



getDefaultLocale
protected static Locale getDefaultLocale()(Code)
Get the system default locale. the system default locale.



getFormBean
public ActionForm getFormBean(ActionMapping mapping)(Code)
Get the flow-scoped form bean member associated with the given ActionMapping. This is a framework-invoked method that should not normally be called directly.



getHandlerContext
FlowControllerHandlerContext getHandlerContext()(Code)



getLocale
protected Locale getLocale(HttpServletRequest request)(Code)
Return the user's currently selected Locale.
Parameters:
  request - the current request. the user's currently selected Locale, stored in the session.FlowController.getLocaleFlowController.retrieveUserLocale



getLocale
protected Locale getLocale()(Code)
Get the user's currently selected Locale. the user's currently selected Locale, stored in the session.



getMapping
final protected ActionMapping getMapping()(Code)
Get the current Struts ActionMapping, which is information from the Struts-XML <action> tag that corresponds to the current action being executed. This call is only valid during FlowController.execute (where any user action method is invoked), and during the lifecycle methods FlowController.beforeAction and FlowController.afterAction . FlowController.getActionMapping the current Struts ActionMapping.
throws:
  IllegalStateException - if this method is invoked outside of action methodexecution (i.e., outside of the call to FlowController.execute, and outside ofFlowController.onCreate, FlowController.beforeAction, FlowController.afterAction.



getMessageResources
protected MessageResources getMessageResources()(Code)
Get the default message resources for this FlowController.



getMessageResources
protected MessageResources getMessageResources(String key)(Code)
Get the specified message resources for this FlowController.
Parameters:
  key - The bundle key specified in aorg.apache.beehive.netui.pageflow.annotations.Jpf.MessageBundle @Jpf.MessageBundle annotation.



getModuleConfig
final protected ModuleConfig getModuleConfig()(Code)
Get the Struts ModuleConfig object associated with this FlowController.



getModuleConfig
public ModuleConfig getModuleConfig(ServletContext servletContext, HttpServletRequest request)(Code)
Gets the Struts module configuration associated with this controller. FlowController.getModuleConfig()
Parameters:
  servletContext - the current ServletContext. the Struts ModuleConfig for this controller.



getModulePath
abstract public String getModulePath()(Code)
Get the Struts module path for this controller. a String that is the Struts module path for this controller.



getPreviousPageInfoLegacy
abstract public PreviousPageInfo getPreviousPageInfoLegacy(PageFlowController curJpf, HttpServletRequest request)(Code)
Get a legacy PreviousPageInfo.



getRequest
final protected HttpServletRequest getRequest()(Code)
Get the current HttpServletRequest. This call is only valid during FlowController.execute (where any user action method is invoked), and during the lifecycle methods FlowController.onCreate , FlowController.beforeAction , FlowController.afterAction . the current HttpServletRequest.
throws:
  IllegalStateException - if this method is invoked outside of action methodexecution (i.e., outside of the call to FlowController.execute, and outside ofFlowController.onCreate, FlowController.beforeAction, FlowController.afterAction.



getRequestProcessor
PageFlowRequestProcessor getRequestProcessor()(Code)



getResources
protected MessageResources getResources()(Code)
Return the message resources for the default module. FlowController.getMessageResources()



getResources
protected MessageResources getResources(HttpServletRequest request)(Code)
Return the default message resources for the current module. FlowController.getMessageResources()
Parameters:
  request - The servlet request we are processing



getResources
protected MessageResources getResources(HttpServletRequest request, String key)(Code)
Return the specified message resources for the current module. FlowController.getMessageResources(String)
Parameters:
  request - the current request.
Parameters:
  key - The bundle key specified in aorg.apache.beehive.netui.pageflow.annotations.Jpf.MessageBundle @Jpf.MessageBundle annotation.



getResponse
final protected HttpServletResponse getResponse()(Code)
Get the current HttpServletResponse. This call is only valid during FlowController.execute (where any user action method is invoked), and during the lifecycle methods FlowController.onCreate , FlowController.beforeAction , FlowController.afterAction . the current HttpServletResponse.
throws:
  IllegalStateException - if this method is invoked outside of action methodexecution (i.e., outside of the call to FlowController.execute, and outside ofFlowController.onCreate, FlowController.beforeAction, FlowController.afterAction.



getRewrittenActionURI
public String getRewrittenActionURI(String actionName, Map parameters, boolean asValidXml) throws URISyntaxException(Code)
Create a fully-rewritten URI given an action and parameters.
Parameters:
  actionName - the action name to convert into a fully-rewritten URI; may be qualified with a path from thewebapp root, in which case the parent directory from the current request is not used.
Parameters:
  parameters - the additional parameters to include in the URI query.
Parameters:
  asValidXml - flag indicating that the query of the uri should be writtenusing the "&amp;" entity, rather than the character, '&' a fully-rewritten URI for the given action.
throws:
  URISyntaxException - if there is a problem converting the action url (derivedfrom processing the given action name) into a URI.
throws:
  IllegalStateException - if this method is invoked outside of action methodexecution (i.e., outside of the call to FlowController.execute,and outside of FlowController.onCreate,FlowController.beforeAction, FlowController.afterAction.



getServlet
protected ActionServlet getServlet()(Code)
Get the current Struts ActionServlet. FlowController.getServletContextGlobals.ACTION_SERVLET_KEY the ActionServlet.



getSession
final protected HttpSession getSession()(Code)
Get the current user session. This call is only valid during FlowController.execute (where any user action method is invoked), and during the lifecycle methods FlowController.onCreate , FlowController.onDestroy , FlowController.beforeAction , FlowController.afterAction . the HttpSession for the current user session.
throws:
  IllegalStateException - if this method is invoked outside of action methodexecution (i.e., outside of the call to FlowController.execute, and outside ofFlowController.onCreate, FlowController.onDestroy, FlowController.beforeAction, FlowController.afterAction.



getUserPrincipal
public Principal getUserPrincipal()(Code)
Get the current logged-in user. Goes through a custom LoginHandler , if one has been configured in beehive-netui-config.xml. the current logged-in Principal, or null if there is no logged-in user.



handleException
public synchronized ActionForward handleException(Throwable ex, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException(Code)
Handle the given exception - invoke user code if appropriate and return a destination URI.
Parameters:
  ex - the Exception to handle.
Parameters:
  mapping - the Struts action mapping for current Struts action being processed.
Parameters:
  form - the form-bean (if any) associated with the Struts action being processed. May be null.
Parameters:
  request - the current HttpServletRequest.
Parameters:
  response - the current HttpServletResponse. a Struts ActionForward object that specifies the URI that should be displayed.
throws:
  ServletException - if another Exception is thrown during handling of ex.



incrementRequestCount
boolean incrementRequestCount(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) throws IOException(Code)
Increment the count of concurrent requests to this FlowController. Note that this method is not synchronized -- we use it to decide whether to synchronize on this instance, or to bail out with an error message about too many concurrent requests.



internalExecute
protected ActionForward internalExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception(Code)
Internal method used to execute an action on a FlowController. This is where the magic generally happens as the FlowController.beforeAction() , login, action execution (simple and normal), and FlowController.afterAction() are all executed by this method. This method is considered internal and should not be invoked direclty.



invokeActionMethod
protected ActionForward invokeActionMethod(Method method, Object arg) throws Exception(Code)
Invoke the given action handler method, passing it an argument if appropriate.
Parameters:
  method - the action handler method to invoke.
Parameters:
  arg - the form-bean to pass; may be null. the ActionForward returned by the action handler method.
throws:
  Exception - if an Exception was raised in user code.



invokeActionMethod
ActionForward invokeActionMethod(Method method, Object arg, HttpServletRequest request, ActionMapping mapping) throws Exception(Code)
Invoke the given action handler method, passing it an argument if appropriate.
Parameters:
  method - the action handler method to invoke.
Parameters:
  arg - the form-bean to pass; may be null.
Parameters:
  request - the current HttpServletRequest. the ActionForward returned by the action handler method.
throws:
  Exception - if an Exception was raised in user code.



invokeExceptionHandler
public synchronized ActionForward invokeExceptionHandler(Method method, Throwable ex, String message, ActionForm wrappedFormBean, PageFlowExceptionConfig exceptionConfig, ActionMapping actionMapping, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException(Code)
Invoke the given exception handler method. This is a framework-invoked method that should not normally be called directly
Parameters:
  method - the action handler method to invoke.
Parameters:
  ex - the Throwable that is to be handled.
Parameters:
  message - the String message that is to be passed to the handler method.
Parameters:
  wrappedFormBean - the wrapped form bean that is associated with the action being processed; may be null.
Parameters:
  exceptionConfig - the exception configuration object for the current exception handler.
Parameters:
  actionMapping - the action configuration object for the requested action.
Parameters:
  request - the current HttpServletRequest.
Parameters:
  response - the current HttpServletResponse. the ActionForward returned by the exception handler method.



isAction
public boolean isAction(String name)(Code)
Tell whether a given String is the name of an action handled by a method in this PageFlowController.
Parameters:
  name - the action-name to query. true if name is the name of an action handled by a method in thisPageFlowController.



isCancelled
protected boolean isCancelled(HttpServletRequest request)(Code)

Returns true if the current form's cancel button was pressed. This method will check if the Globals.CANCEL_KEY request attribute has been set, which normally occurs if the cancel button generated by the Struts CancelTag was pressed by the user in the current request. If true, validation performed by an ActionForm's validate() method will have been skipped by the controller servlet.

org.apache.beehive.netui.tags.html.Button
Parameters:
  request - The servlet request we are processing
See Also:   org.apache.struts.taglib.html.CancelTag



isPageFlow
public boolean isPageFlow()(Code)
Tell whether this is a PageFlowController . true if this is a PageFlowController.



isTokenValid
protected boolean isTokenValid(HttpServletRequest request)(Code)
Return true if there is a transaction token stored in the user's current session, and the value submitted as a request parameter with this action matches it. Returns false under any of the following circumstances:
  • No session associated with this request
  • No transaction token saved in the session
  • No transaction token included as a request parameter
  • The included transaction token value does not match the transaction token in the user's session
FlowController.isTokenValid()
Parameters:
  request - The servlet request we are processing



isTokenValid
protected boolean isTokenValid()(Code)
Return true if there is a transaction token stored in the user's current session, and the value submitted as a request parameter with this action matches it. Returns false under any of the following circumstances:
  • No session associated with this request
  • No transaction token saved in the session
  • No transaction token included as a request parameter
  • The included transaction token value does not match the transaction token in the user's session

See Also:   FlowController.generateToken()
See Also:   FlowController.resetToken()



isTokenValid
protected boolean isTokenValid(HttpServletRequest request, boolean reset)(Code)
Return true if there is a transaction token stored in the user's current session, and the value submitted as a request parameter with this action matches it. Returns false
  • No session associated with this request
  • No transaction token saved in the session
  • No transaction token included as a request parameter
  • The included transaction token value does not match the transaction token in the user's session
FlowController.isTokenValid(boolean)
Parameters:
  request - The servlet request we are processing
Parameters:
  reset - Should we reset the token after checking it?



isTokenValid
protected boolean isTokenValid(boolean reset)(Code)
Return true if there is a transaction token stored in the user's current session, and the value submitted as a request parameter with this action matches it. Returns false
  • No session associated with this request
  • No transaction token saved in the session
  • No transaction token included as a request parameter
  • The included transaction token value does not match the transaction token in the user's session

Parameters:
  reset - Should we reset the token after checking it?
See Also:   FlowController.generateToken()
See Also:   FlowController.resetToken()



isUserInRole
public boolean isUserInRole(String roleName)(Code)
Tell whether the current logged-in user is a member of a given role. Goes through a custom LoginHandler , if one has been configured in beehive-netui-config.xml.
Parameters:
  roleName - the name of the role to test. true if there is a current logged-in user and the user is a member of the given role.
See Also:   FlowController.getUserPrincipal



login
public void login(String username, String password) throws LoginException(Code)
Log in the user, using "weak" username/password authentication. Goes through a custom LoginHandler , if one has been configured in beehive-netui-config.xml.
Parameters:
  username - the user's login name
Parameters:
  password - the user's password
exception:
  LoginException - if the authentication failed



logout
public void logout(boolean invalidateSessions)(Code)
Log out the current user. Goes through a custom LoginHandler , if one has been configured in beehive-netui-config.xml.
Parameters:
  invalidateSessions - if true, the session is invalidated (on all single-signon webapps); otherwise the session and its data are left intact (except for authenticationinformation used internally by the server). To invalidate the session in only thecurrent webapp, set this parameter to false and callFlowController.getSession.invalidate().



lookup
public static ActionResult lookup(String actionName, ServletContext context, HttpServletRequest request, HttpServletResponse response) throws Exception(Code)
Resolve the given action name to a URI. This version assumes that the ActionServlet class should be PageFlowActionServlet . Note: this method invokes the full action-processing cycle on a ScopedRequest . Use FlowController.resolveAction to resolve the URI for an action in the current page flow. PageFlowUtils.strutsLookup



lookup
public static ActionResult lookup(String actionName, ServletContext context, HttpServletRequest request, HttpServletResponse response, String actionServletClassName) throws Exception(Code)
Resolve the given action name to a URI. Note: this method invokes the full action-processing cycle on a ScopedRequest . Use FlowController.resolveAction to resolve the URI for an action in the current page flow. PageFlowUtils.strutsLookup



onCreate
protected void onCreate() throws Exception(Code)
Callback that is invoked when this controller instance is created. FlowController.getRequest , FlowController.getResponse , FlowController.getSession may all be used during this method.



onDestroy
protected void onDestroy()(Code)
Callback that is invoked when this controller instance is "destroyed", i.e., removed from the user session. FlowController.getRequest , FlowController.getResponse , and FlowController.getActionMapping may not be used during this method, since it may be called due to session termination outside of a request. FlowController.getSession also may not be used, but the session is passed as an argument to FlowController.onDestroy(HttpSession) , which should be used in place of this method.
Note that this method is not synchronized. It is dangerous to synchronize your override of this method because it is invoked during a callback from the Servlet container. Depending on the container, synchronization here can cause deadlocks. FlowController.onDestroy(HttpSession)



onDestroy
protected void onDestroy(HttpSession session)(Code)
Callback that is invoked when this controller instance is "destroyed", i.e., removed from the user session. FlowController.getRequest , FlowController.getResponse , and FlowController.getActionMapping may not be used during this method, since it may be called due to session termination outside of a request. FlowController.getSession also may not be used, but the session is passed as an argument.
Note that this method is not synchronized. It is dangerous to synchronize your override of this method because it is invoked during a callback from the Servlet container. Depending on the container, synchronization here can cause deadlocks.



onRefresh
protected void onRefresh()(Code)
Callback that is invoked when this controller is involved in a refresh request, as can happen in a portal environment on a request where no action is run in the current page flow, but a previously-displayed page in the page flow is re-rendered.



refresh
final public synchronized void refresh(HttpServletRequest request, HttpServletResponse response)(Code)
Called on this object for non-lookup (refresh) requests. This is a framework-invoked method that should not normally be called directly.



reinitialize
public void reinitialize(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)(Code)
Reinitialize the object for a new request. Used by the framework; normally should not be called directly.



remove
protected void remove()(Code)
Remove this instance from the user session.



resetToken
protected void resetToken(HttpServletRequest request)(Code)
Reset the saved transaction token in the user's session. This indicates that transactional token checking will not be needed on the next request that is submitted. FlowController.resetToken()
Parameters:
  request - The servlet request we are processing



resetToken
protected void resetToken()(Code)
Reset the saved transaction token in the user's session. This indicates that transactional token checking will not be needed on the next request that is submitted.
See Also:   FlowController.isTokenValid()
See Also:   FlowController.isTokenValid(boolean)
See Also:   FlowController.generateToken()



resolveAction
public String resolveAction(String actionName, Object form, HttpServletRequest request, HttpServletResponse response) throws Exception(Code)
Call an action and return the result URI.
Parameters:
  actionName - the name of the action to run.
Parameters:
  form - the form bean instance to pass to the action, or null if none should be passed. the result webapp-relative URI, as a String.
throws:
  ActionNotFoundException - when the given action does not exist in this FlowController.
throws:
  Exception - if the action method throws an Exception.



resolveAction
public String resolveAction(String actionName, Object form) throws Exception(Code)
Call an action and return the result URI. FlowController.resolveAction(StringObjectHttpServletRequestHttpServletResponse)
Parameters:
  actionName - the name of the action to run.
Parameters:
  form - the form bean instance to pass to the action, or null if none should be passed. the result webapp-relative URI, as a String.
throws:
  ActionNotFoundException - when the given action does not exist in this FlowController.
throws:
  Exception - if the action method throws an Exception.



retrieveUserLocale
public static Locale retrieveUserLocale(HttpServletRequest request, String locale)(Code)



saveActionErrors
protected void saveActionErrors(ActionMessages errors)(Code)
Save the specified messages keys into the request for use by the <netui:error> or <netui:errors> tags.
Parameters:
  errors - the ActionMessages to save in the request.



saveErrors
protected void saveErrors(HttpServletRequest request, ActionMessages errors)(Code)
Save the specified messages keys into the request for use by the <netui:error> or <netui:errors> tags. FlowController.saveActionErrors
Parameters:
  errors - the ActionMessages to save in the request.



saveMessages
protected void saveMessages(HttpServletRequest request, ActionMessages messages)(Code)
Save the specified messages keys into the appropriate request attribute for use by the Struts <html:messages> tag (if messages="true" is set), if any messages are required. Otherwise, ensure that the request attribute is not created.
Parameters:
  request - The servlet request we are processing
Parameters:
  messages - Messages object



savePreviousActionInfo
void savePreviousActionInfo(ActionForm form, HttpServletRequest request, ActionMapping mapping, ServletContext servletContext)(Code)
Used by derived classes to store information on the most recent action executed.



savePreviousPageInfo
public void savePreviousPageInfo(ActionForward forward, ActionForm form, ActionMapping mapping, HttpServletRequest request, ServletContext servletContext, boolean isSpecialForward)(Code)
Store information about recent pages displayed. This is a framework-invoked method that should not normally be called directly.



saveToken
protected void saveToken(HttpServletRequest request)(Code)
Save a new transaction token in the user's current session, creating a new session if necessary.
Parameters:
  request - The servlet request we are processing



sendError
protected void sendError(String errText, HttpServletResponse response) throws IOException(Code)
Send a Page Flow error to the browser. FlowController.sendError(StringHttpServletRequestHttpServletResponse)
Parameters:
  errText - the error message to display.
Parameters:
  response - the current HttpServletResponse.



sendError
protected void sendError(String errText, HttpServletRequest request, HttpServletResponse response) throws IOException(Code)
Send a Page Flow error to the browser.
Parameters:
  errText - the error message to display.
Parameters:
  response - the current HttpServletResponse.



setLocale
protected void setLocale(HttpServletRequest request, Locale locale)(Code)
Set the user's currently selected Locale.
Parameters:
  request - The request we are processing
Parameters:
  locale - The user's selected Locale to be set, or nullto select the server's default LocaleFlowController.setLocale(Locale)



setLocale
protected void setLocale(Locale locale)(Code)
Set the user's currently selected Locale.
Parameters:
  locale - The user's selected Locale to be set, or null to select the server's default Locale



setPerRequestState
PerRequestState setPerRequestState(PerRequestState state)(Code)



theModuleConfig
final public ModuleConfig theModuleConfig()(Code)
This is a non-property public accessor that will return the property value moduleConfig. This is a non-property method because properties are exposed to databinding and that would expose internal data structures to attack. the ModuleConfig for this FlowController



Methods inherited from org.apache.beehive.netui.pageflow.PageFlowManagedObject
public synchronized void create(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) throws Exception(Code)(Java Doc)
void destroy(HttpSession session)(Code)(Java Doc)
abstract public void ensureFailover(HttpServletRequest request)(Code)(Java Doc)
protected boolean fieldIsUninitialized(Field field)(Code)(Java Doc)
public long getCreateTime()(Code)(Java Doc)
abstract public String getDisplayName()(Code)(Java Doc)
protected ServletContext getServletContext()(Code)(Java Doc)
protected void initializeField(Field field, Object instance)(Code)(Java Doc)
boolean isDestroyed()(Code)(Java Doc)
protected void onCreate() throws Exception(Code)(Java Doc)
protected void onDestroy(HttpSession session)(Code)(Java Doc)
abstract public void persistInSession(HttpServletRequest request, HttpServletResponse response)(Code)(Java Doc)
public void reinitialize(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)(Code)(Java Doc)
void reinitializeIfNecessary(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)(Code)(Java Doc)
abstract public void removeFromSession(HttpServletRequest request)(Code)(Java Doc)
public void valueBound(HttpSessionBindingEvent event)(Code)(Java Doc)
public void valueUnbound(HttpSessionBindingEvent event)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.