Re: Please Help Me To Understand forward

2003-09-14 Thread Ted Husted
The first snippet redirects to a Struts ActionForward named welcome. 
This places controls within the Struts controller where it can be 
managed from the struts-config.

In the global-forwards section, the ActionForward element for welcome 
is mapped to the page /do/Menu. This application uses prefix mapping, 
so any request for /do/* is sent to the Struts ActionServlet. The Struts 
ActionSerlvet then looks for a matching ActionMapping.

The matching ActionMapping in this case is /Menu (the URI stripped of 
the prefix or suffix registered to the Servlet). If you look again, I 
think you will find this ActionMapping:

action path=/Menu name=menuForm 
type=org.apache.struts.scaffold.ExistsAttributeAction 
parameter=application;HOURS
forward name=success path=.article.Menu/
forward name=failure path=/do/MenuCreate/
/action

Here, if the attribute exists, the page will be rendered by the 
.article.Menu Tile. Otherwise, control will go the /MenuCreate action 
first.

The .article.Menu tile (in tiles-def.xml) assembles the page using these 
instructions:

definition name=.article.Menu extends=.article.Base
put name=title value=article.Menu.title/
put name=content value=/article/content/menu.jsp/
put name=navbar value=/article/common/navbarMenu.jsp/
/definition
The menu.jsp is the main content page, but other pages are also used to 
create the final response.

-Ted.

Caroline Jen wrote:

I am studying the code in Artimus_1_1 to make sure
that I understand how things actually work.  I am lost
at the beginning of the application.  Please kindly
help me.  The index.jsp of the application contains
two lines:
code:
--
%@ taglib uri=/tags/struts-logic prefix=logic %
logic:redirect forward=welcome/
---

Does this redirect forward tells the browser to submit
a new request to the path with logical name welcome?
I then searched the config.xml file, 

code:
---
global-forwards
!-- default forwards --
 forward
name=baseStyle 
path=/article/assets/styles/base.css/
!-- MENU forwards --
 forward
name=welcome
path=/do/Menu/
 forward
name=cancel
path=/do/Menu
redirect=true/
 forward
name=done
path=/do/Menu/
 ...
/global-forwards

---

The path of the logical name welcome is do/Menu
(note it is upper case Menu).  The other place that
do/Menu appears in the config.xml is:
action
path=/MenuCreate
name=menuForm
   
type=org.apache.struts.scaffold.ProcessAction
   
parameter=org.apache.artimus.article.MenuCreate
   forward
name=success
path=/do/Menu/
forward
name=failure
path=.article.Menu/
/action

There is no Menu ActionServlet in the application.

There is a menu.jsp (note it is lower case menu) file
in the application. Does this application display
menu.jsp when it is first launched? Apparently, it
does. This menu.jsp is in the
artimus_1_1/WEB-INF/src/pages/article/content folder.
I am confused - does /do/Menu locate the menu.jsp 

1. in the /src/pages/article/content folder?
2. regardless upper or lower cases? 



__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
Ted Husted,
  Junit in Action  - http://www.manning.com/massol/,
  Struts in Action - http://husted.com/struts/book.html,
  JSP Site Design  - http://www.amazon.com/exec/obidos/ISBN=1861005512.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Please Help Me To Understand forward

2003-09-12 Thread Caroline Jen
I am studying the code in Artimus_1_1 to make sure
that I understand how things actually work.  I am lost
at the beginning of the application.  Please kindly
help me.  The index.jsp of the application contains
two lines:

code:
--

%@ taglib uri=/tags/struts-logic prefix=logic %
logic:redirect forward=welcome/

---

Does this redirect forward tells the browser to submit
a new request to the path with logical name welcome?

I then searched the config.xml file, 


code:
---

global-forwards
!-- default forwards --
 forward
name=baseStyle 
path=/article/assets/styles/base.css/
!-- MENU forwards --
 forward
name=welcome
path=/do/Menu/
 forward
name=cancel
path=/do/Menu
redirect=true/
 forward
name=done
path=/do/Menu/
 ...
/global-forwards

---

The path of the logical name welcome is do/Menu
(note it is upper case Menu).  The other place that
do/Menu appears in the config.xml is:

action
path=/MenuCreate
name=menuForm
   
type=org.apache.struts.scaffold.ProcessAction
   
parameter=org.apache.artimus.article.MenuCreate
   forward
name=success
path=/do/Menu/
forward
name=failure
path=.article.Menu/
/action

There is no Menu ActionServlet in the application.

There is a menu.jsp (note it is lower case menu) file
in the application. Does this application display
menu.jsp when it is first launched? Apparently, it
does. This menu.jsp is in the
artimus_1_1/WEB-INF/src/pages/article/content folder.
I am confused - does /do/Menu locate the menu.jsp 

1. in the /src/pages/article/content folder?
2. regardless upper or lower cases? 



__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]