hi Greg,

*1. According to your explanation, I try to express the request
processing. *
When a request comes in:
(1) Firstly, several filterings will filter the request.
(2) Then, as you said, WeblogRequestMapper is the overall entry for
processing all request.  WeblogRequestMapper.handleRequest() will parse the
requesting url, then find the corresponding "Action name" to process the
request.
(3) After finding the "Action name", then corresponding Action Class will
really process the business function.  while the mapping from "action name'
to "action class" is specified in Struts.xml.
(4) The 'Action class' will process the logic. It firstly runs
its myPrepare() method, then call the execution() method.
(5)After processing the execute() method, then continue the pass the
several filterings.

The processing of an incoming request is right as what I said?

*2. From the structs, each "action" corresponds to a "action class".  Aslo,
There is more than one action is processed by the same action class.*
For example,

<action name="bookmarkAdd"
        class="org.apache.roller.weblogger.ui.struts2.editor.BookmarkEdit">
    <param name="actionName">bookmarkAdd</param>
    <param name="pageTitle">bookmarkForm.add.title</param>
    <result name="input" type="tiles">.BookmarkEdit</result>
    <result name="success" type="chain">bookmarks</result>
    <result name="error" type="chain">bookmarks</result>
</action>

<action name="bookmarkEdit"
        class="org.apache.roller.weblogger.ui.struts2.editor.BookmarkEdit">
    <param name="actionName">bookmarkEdit</param>
    <param name="pageTitle">bookmarkForm.edit.title</param>
    <result name="input" type="tiles">.BookmarkEdit</result>
    <result name="success" type="chain">bookmarks</result>
    <result name="cancel" type="redirectAction">
        <param name="actionName">bookmarks</param>
        <param name="weblog">${weblog}</param>
        <param name="folderId">${folderId}</param>
    </result>
    <result name="error" type="chain">bookmarkEdit</result>
</action>

(a) we can see "bookmarkAdd" and "bookmarkEdit' the two actions are both
processed by "org.apache.roller.weblogger.ui.struts2.editor.BookmarkEdit".
But there is only one execute() method in class BookmarkEdit. It means
"bookmarkAdd' and "bookmarkEdit" are processed by the same execution()
method?
If so, *how does execute() distinguish the two different actions to process
differently?*

(b) Another question is that, in class BookmarkEdit, there is "save()"
method besides "myPrepare()" and "execute()".
>From the code,* I cannot clearly see how the save() method is called, or
who will call save() method?*



I am new to structs and roller. A lot of details I would like to ask and
hope make it clear.
Thank you for your help.
Best regards,
Wuxia Jin


On Sat, Feb 24, 2018 at 12:07 PM, Greg Huber <gregh3...@gmail.com> wrote:

> .....should be WeblogRequestMapper
>
> Cheers Greg
>
> On 24 February 2018 at 04:39, x86 wj <wj86...@gmail.com> wrote:
>
> > Roller is in a web architecture of "presentation -> business logic ->
> > persistent layer". But the project is complex. From the source code, I
> have
> > no idea which packages(or classes) are responsible for the controller.
> The
> > following will list an example to express my meaning.
> >
> > For example, Jpetstore is a small project with only 24 classes.
> > https://github.com/mybatis/jpetstore-6/blob/master/src/
> > main/java/org/mybatis/jpetstore/web/actions/OrderActionBean.java
> >
> > This link shows that OrderActionBean is one of the controller class in
> > web.action package.  OrderActionBean.listOrders is one function entry
> > provided by system.
> >
> > So, I would like to know, in roller,* where can I find the similar
> > 'controllerClass.method()' that clearly present function's entry*. Can
> you
> > give me some example?
> >
> > Thanks a lot for your time. I really need your help.
> > Best regards,
> > Wuxia Jin
> >
>

Reply via email to