Search code examples
strutsstruts-1

Basic struts1 question: Where is the ActionForm data coming from in Struts 1?


I am maintaining a struts 1 app and need to find the point of the code where (or find out how) the ActionForm object is passed to the Action class, which is the first entry point of the code that I know of, but there is obviously another entry point where data is assembled into an ActionForm object since the Action class entrypoint method signature is this:

public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, 

Idea anybody?


Solution

  • The request processor, org.apache.struts.action.RequestProcessor.

    The specific method depends on the exact Struts version, e.g., in Struts 1.2 it's the process method, in Struts 1.3 it's the processActionCreate method.

    Custom request processors are a well-known extension point in Struts 1; it would probably be worth your time to do some web searching as this is fairly well covered, but again, it's specific to the version.

    In addition, request processors are often used in different ways by different extension points (e.g., Tiles and Workflow), which drove some of the changes in Struts 1.3 (ComposableRequestProcessor).