Re: (newbie asking advice) in which order do I call my .do and .jsp?

2003-11-21 Thread Rick Reumann
Janice wrote:

(1) When I want to display a list of widgets, my link is to:

/projectTypes.do?action=showList

(2) My mapping looks like this (ProjectTypeCodeActions extends
DispatchAction):
actionpath=/projectTypes
   input=/projectTypeCode/project_type_code_form.jsp
   parameter=action
   scope=request
   type=projectTypeCode.ProjectTypeCodeActions
   validate=false
  forward name=form
path=/projectTypeCode/project_type_code_form.jsp /
  forward name=list
path=/projectTypeCode/project_type_code_list.jsp /
  forward name=failure path=/common/error.html /
/action
(3) So it goes off to the DB to get my list, and then forwards off to
project_type_code_list.jsp, which contains:
%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

tiles:insert page=../layouts/PPELayout.jsp
  tiles:put name=menuLinks value=../common/menu.jsp /
  tiles:put name=mainBody
value=../projectTypeCode/project_type_code_list_body.jsp /
/tiles:insert


I could be misunderstanding what you are trying to accomplish, but I 
think you are not utilizing the true benefit of tiles. In the example 
above it looks like you want an action to get you a List of project type 
codes and then display them(?).  Normally using tiles, the benefit would 
be that you would only have to code the actual 
project_type_code_list.jsp   which would just be the simple loop of 
the list and display the output. The layout portion (which you seem to 
defining in the project_type_code_list.jsp) is set up elsewhere as a 
definition that would use a base layout that all of your pages could use...

For example you'd define a main *layout.jsp* page that might look like...

%@ taglib uri=tiles prefix=tiles %
!-- possibly other tag imports --
html
headtitletiles:getAsString name='title'//title/head
body
table
tr
  tdtiles:insert attribute='menu'//td
  tdtiles:insert attribute='content'//td
/tr
/table
/body
/html
Then in your *tiles-def.xml* file you might have:

definition name=BaseDef template=layout.jsp
put name=title   value=${title}/
put name=menuvalue=yourMenu.jsp/
put name=content value=${content}/
/definition
!-- your definitions can extend the one above --
definition name=projectCodes.page extends =BaseDef
put name=title value=Project Codes List/
put name=content value=productCodes.jsp/
/definition
Your productCodes.jsp:
--
A JSP where you display the List you are getting in your Action



Your Action:

action  path=/projectTypes
input=projectForm.page
parameter=action
scope=request
type=projectTypeCode.ProjectTypeCodeActions
validate=false
  forward name=form path=projectFormTile.page /
  forward name=failure path=failureTile.page /
  !-- this is the tile just made above --
  forward name=list path=projectCodes.page /
/action
--
Rick
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: (newbie asking advice) in which order do I call my .do and .jsp?

2003-11-21 Thread Janice
Thanks Rick,

While that wasn't exactly what I was asking, I think you gave me a better answer than 
what I was looking for :)  That makes so much more sense than what I was doing!!

Janice