<sigh>You must be new to Tiles :)  It doesn't seem to work.  Try it for
yourself, make yourself a controller called MyController who's success
forward, forwards to a tiles template called "tiles.template".

The tiles template can looks something like this:

<definition path="mainlayout.jsp" name="tiles.template">
  <put name="page1"   value="/page1.jsp" />
  <put name="page2"   value="/page2.jsp"/>
</definition>

Your mainlayout.jsp would look something like this:

<html>
<body>
<tiles:insert attribute="page1"/>
<tiles:insert attribute="page2"/>
</body>
</html>

In page1.jsp put the following:

<h1><%=request.getParameter("param1")%></h1>

Call your controller like so: MyController.do?param1=1

You will get the error: "bean param1 not found within scope".

However, I found a solution.  In MyController, I simply use
request.getParameter("param1") and then take that value and place it back in
using request.setAttribute.  Tiles or Struts does not seem to preserve the
request parameters from the original call for the Tiles which are being
forwarded to, so you have to do it manually (which might make sense?).

Craig.

P.S. I have read the specs :)

----- Original Message -----
From: "Van Riper, Mike" <[EMAIL PROTECTED]>
To: "'Craig Tataryn'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, November 26, 2002 11:42 AM
Subject: RE: Tiles and parameters...


> Unless I'm missing something here, you simply use:
>
>   request.getParameter("fieldid");
>
> in scriptlet code in any of your leaf JSPs to access this request
parameter.
> You can also use  <bean:define> in conjunction with this to define a bean
at
> the top of your page for use as a bean reference in other Struts tags
within
> your JSP pages. You must be new to JSP development. I recommend taking a
> look at the JSP spec. In particular, section 2.8 of the JSP 1.1 spec lists
> the implicit objects available to all JSP pages.
>
> Good Luck,
>   Mike "Van" Riper
>   mailto:[EMAIL PROTECTED]
>
> > -----Original Message-----
> > From: Craig Tataryn [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, November 26, 2002 5:03 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Tiles and parameters...
> >
> >
> >
> > Anyone have any suggestions?
> >
> > >From: "Craig Tataryn" <[EMAIL PROTECTED]>
> > >Reply-To: "Struts Users Mailing List"
> > <[EMAIL PROTECTED]>
> > >To: [EMAIL PROTECTED]
> > >Subject: Tiles and parameters...
> > >Date: Sun, 24 Nov 2002 00:39:23 -0600
> > >
> > >I am using a tiles for a project where I have the following scenario:
> > >
> > ><a href="forecast.do?fieldid=1">Forecast for Field 1</a>
> > >
> > >The action for forecast.do, simply does some data extraction
> > and then
> > >returns a forward to a tiles def which displays this data.
> > >
> > >Here is what the existing tiles def looks like:
> > >
> > ><definition name="site.forecast" extends="site.introPage">
> > >   <put name="body"   value="/chart.jsp" />
> > >   <put name="left"   value="/form/displayChartSummary.jsp"/>
> > ></definition>
> > >
> > >However, each of these jsp pages really should be passed the fieldid
> > >parameter that the Forecast action was passed.
> > >
> > >Is there anyway to get my Forecast action to pass this
> > fieldid parameter to
> > >the pages setup in the tiles def it is going to forward to?
> > Or is there
> > >any other technique you might suggest as a workaround (don't
> > particularly
> > >want to throw things in the session as I want the fieldid to
> > be at the
> > >request level so users can see forecasts for different
> > fields at the same
> > >time).
> > >
> > >Thanks,
> > >
> > >Craig.
> > >Craig W. Tataryn
> > >Programmer/Analyst
> > >Compuware
> > >
> > >_________________________________________________________________
> > >MSN 8 with e-mail virus protection service: 2 months FREE*
> > >http://join.msn.com/?page=features/virus
> > >
> > >
> > >--
> > >To unsubscribe, e-mail:
> > ><mailto:[EMAIL PROTECTED]>
> > >For additional commands, e-mail:
> > ><mailto:[EMAIL PROTECTED]>
> >
> >
> > Craig W. Tataryn
> > Programmer/Analyst
> > Compuware
> >
> > _________________________________________________________________
> > Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> > http://join.msn.com/?page=features/junkmail
> >
> >
>

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

Reply via email to