Try this,

@@@@@ tiles-definition.xml @@@@@
  <definition name="site.organization.list.page" extends="site.mainLayout" >
       <put name="title"  value="Organizations" />
       <put name="body"   value="/organization/list.jsp" />
  </definition>

  <definition name="site.organization.details.page"
extends="site.mainLayout" >
       <put name="title"  value="Details of organization" />
       <put name="body"   value="/organization/details.jsp" />
  </definition>

@@@@@ struts-config.xml @@@@@@
  <action path="/organization/list"
          type="mypackage.OrganizationAction">
   <forward name="success" path="site.organization.list.page"
redirect="false"/>
  </action>

  <action path="/organization/details"
          type="mypackage.OrganizationAction">
   <forward name="success" path="site.organization.details.page"
redirect="false"/>
  </action>

@@@@@ class mypackage.OrganizationAction @@@@@

execute(...) {

    if (mapping.getPath().equals("/organization/list"))
            return onList(mapping, form, request, response);
    else if (mapping.getPath().equals("/organization/details"))
            return onDetails(mapping, form, request, response);
}

onDetails(...) {

   Vector allOrganizations = BUSINESS_OBJECT.getAllOrganizations();
   request.setAttribute("organizations", allOrganizations);

  return mapping.findForward("success");
}

onDetails(...) {
    id = request.getParameter("orgId");
   OrganizationBean oneOrganization = BUSINESS_OBJECT.getOrganization(id);
   request.setAttribute("organization", oneOrganization);

  return mapping.findForward("success");
}



@@@@@@ organization/list.jsp @@@@@@@@@@

<iterate id="org">

    <jsp:useBean id="params" class="java.util.HashMap"/>
    <bean:parameter id="orgId" name="org" property="organizationId" />
    <% params.put("orgId", orgId); %>

                <html:link action="/organization/details"
                              name="params">
                    <bean:message key="global.details.info"/>
                </html:link>
</iterate>



@@@@@@ organization/details.jsp @@@@@@@@@@

ID : <bean:write name="organization" property="organizationId" />
Name : <bean:write name="organization" property="name" />
Address : <bean:write name="organization" property="address" />
.......

@@@@@@ remark @@@@@@@@@@
Don't use <html:link page="" when you reffers to action, use <html:link
action="" instead (without action suffix/prefix)

----- Original Message -----
From: "koen boutsen" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, August 20, 2003 1:53 PM
Subject: RE: <html:link> and tiles definitions


> thanks for your answer, but maybe I did't explain my problem correctly.
> I start from a page where different organisation names are shown.
>
> This is the source for this page :
>
> <logic:iterate id="i" name="listAllOrganisations">
> <tr><td><html:link page="/loadOrganisation.do" name="i"
property="orgId">myOrganisationName</html:link>
> </td></tr>
> </logic:iterate>
>
> When a user clicks on on organisation, I want to pass the organisation Id
, go to my Action and in the action get all the data from the database.
Then I want to go to a page where all the organisation details are shown.
This last page is part of a definition.  I tried to use the definition as a
forward, but it didn't work.
>
> Maybe my logic is not correct, or maybe my <html:link syntax
>
> Could you help me ?
>
> Koen
> --
>
> --------- Original Message ---------
>
> DATE: Wed, 20 Aug 2003 12:14:19
> From: "Hue Holleran" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List"
<[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
> Cc:
>
> >I posted a (long) reply to this recently with code, see:
> >
> >http://marc.theaimsgroup.com/?l=struts-user&m=106096350227227&w=2
> >
> >(look towards the end - there is a generic action class that forwards to
a
> >tiles def - you only need one generic action)
> >
> >Let me know if that does not solve your problem.
> >
> >Hue.
> >
> >> -----Original Message-----
> >> From: koen boutsen [mailto:[EMAIL PROTECTED]
> >> Sent: 20 August 2003 08:54
> >> To: Struts Users Mailing List
> >> Subject: <html:link> and tiles definitions
> >>
> >>
> >> hi
> >>
> >> I'm trying to use tiles definitions with struts. On one page I
> >> want to create a <html:link> so that the user is sent to another
> >> page. Does anyone know how I can do this with tiles definitions.
> >> I'm really stuck, I'm looking for a few days now without finding
> >> the solution.
> >> I read that you can't link to a tiles definition, but there must
> >> be some solution, I hope.
> >>
> >> Koen
> >>
> >>
> >>
> >>
> >> ____________________________________________________________
> >> Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
> >> http://login.mail.lycos.com/r/referral?aid=27005
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >> ---
> >> Incoming mail is certified Virus Free.
> >> Checked by AVG anti-virus system (http://www.grisoft.com).
> >> Version: 6.0.511 / Virus Database: 308 - Release Date: 18/08/2003
> >>
> >---
> >Outgoing mail is certified Virus Free.
> >Checked by AVG anti-virus system (http://www.grisoft.com).
> >Version: 6.0.511 / Virus Database: 308 - Release Date: 18/08/2003
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> ____________________________________________________________
> Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
> http://login.mail.lycos.com/r/referral?aid=27005
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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

Reply via email to