You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beehive.apache.org by "Miller, Michael P" <Mi...@mantech-ist.com> on 2005/04/01 00:48:23 UTC

questions ..

1.  Is a "begin" action required for all Controllers ?  because I'm
getting a compilation

     error There is no begin action defined for this PageFlowController.

  If so, why ?  I thought I could name my actions whatever I want.

 

2.  So my servlet mappings in web.xml look like this:

            <servlet-mapping>

        <servlet-name>action</servlet-name>

        <url-pattern>*.jpf</url-pattern>

     </servlet-mapping>

      ...

    <servlet-mapping>

        <servlet-name>action</servlet-name>

        <url-pattern>*.do</url-pattern>

    </servlet-mapping>

 

            So I hit my app using
http://localhost:8080/<appName>/begin.do
<http://localhost:8080/%3cappName%3e/begin.do> 

            This hits my "begin" action which is a SimpleAction.
Because these mapping all point to

            the same servlet, I would expect that if I hit that same URL
using .../begin.jpf, it would do

            the same thing, but instead it errors out.  Why does the
extension matter ??

 

Thanks,

Mike Miller

 


Re: questions ..

Posted by Richard Feit <ri...@bea.com>.
Hello Mike,

Miller, Michael P wrote:

>1.  Is a "begin" action required for all Controllers ?  because I'm
>getting a compilation
>
>     error There is no begin action defined for this PageFlowController.
>
>  If so, why ?  I thought I could name my actions whatever I want.
>
> 
>  
>
You can name your actions whatever you want, but every non-abstract page 
flow has to contain a begin action (which is actually the only thing a 
page flow is required to contain).  This is because a page flow is 
URL-addressable.  When you hit the page flow's URL (e.g., 
http://localhost:8080/<appName>/foo/Controller.jpf), its begin action is 
the thing that chooses what to display.

>2.  So my servlet mappings in web.xml look like this:
>
>            <servlet-mapping>
>
>        <servlet-name>action</servlet-name>
>
>        <url-pattern>*.jpf</url-pattern>
>
>     </servlet-mapping>
>
>      ...
>
>    <servlet-mapping>
>
>        <servlet-name>action</servlet-name>
>
>        <url-pattern>*.do</url-pattern>
>
>    </servlet-mapping>
>
> 
>
>            So I hit my app using
>http://localhost:8080/<appName>/begin.do
><http://localhost:8080/%3cappName%3e/begin.do> 
>
>            This hits my "begin" action which is a SimpleAction.
>Because these mapping all point to
>
>            the same servlet, I would expect that if I hit that same URL
>using .../begin.jpf, it would do
>
>            the same thing, but instead it errors out.  Why does the
>extension matter ??
>
> 
>  
>
This may be related to the first question.  PageFlowRequestProcessor is 
ultimately invoked for any ".jpf" or ".do" request in a directory that 
contains a page flow.  If the URL ends in ".jpf", it forwards to 
"begin.do" in that directory; this is what makes page flows URL-addressable.

hth,
Rich

>Thanks,
>
>Mike Miller
>
> 
>
>
>  
>