Hi Bala,
Here's a brief description of the steps required for the tiles
support. I'll also add a beehive wiki page and reply with link
link.
- First, create a definitions configuration file to declare
your tiles definitions, as you would with a tiles application.
The configuration file can be located in the same directory
as the JPF controller. It does not have to be located in the
WEB-INF directory. However, if it is placed locally, you
probably want to define a "<security-constraint>" to make
direct access to tiles definitions and components inaccessible.
- Create the JSP files that will be the template(s) for the
layout, using <tiles:insert> tags from the tiles tag library.
- Create the JSP files that are the individual components,
such as header, footer, menu, etc. used to fill out the
templates based on your definitions.
- Add the tilesDefinitionsConfigs attribute to your
@Jpf.Controller annotation. It is an array of paths so
that we support the use of multiple tiles-definitions
files if desired. If you just have a single configuration
file, named "my-tiles-defs.xml" located in the same
directory as you JPF controller, the annotation and
attribute would be...
@Jpf.Controller(
tilesDefinitionsConfigs = { "my-tiles-defs.xml" }
)
Then, for any @Jpf.Forward annotation you've defined
in the actions of your controller, rather than set the
path attribute for a JSP, you could set the new tiles
attribute, "tilesDefinition". This attribute should
be the name of the definition you want to use. If your
definitions file has a default layout definition defined
as...
<definition name="defaultLayout" path="layout.jsp">
<put name="title" value="Some Title" />
<put name="header" value="header.jsp" />
<put name="topPanel" value="panel1.jsp" />
<put name="sidePanel" value="panel2.jsp" />
<put name="body" value="content.jsp" />
<put name="footer" value="footer.jsp" />
</definition>
Then the action and forward annotations might look like
this...
@Jpf.Action(
forwards = {
@Jpf.Forward(
name = "continue",
tilesDefinition = "defaultLayout")
})
I did include test that you can refer to as a basic example.
Take a look at the files in...
netui/test/webapps/drt/coreWeb/miniTests/tiles/
Hope that helps get you started.
Kind regards,
Carlin
Balasubramanian Krishnan wrote:
Hi Rich,
I am planning to do that in diablo. Will try that out and as you said i
misunderstood that tiles is supported in 8.1. Now i am clear about that.
Thanks for clarifications
with regards,
bala
Richard Feit <[EMAIL PROTECTED]>
12/21/2004 12:24 PM
Please respond to
"Beehive Developers" <[email protected]>
To
Beehive Developers <[email protected]>
cc
Subject
Re: checkin request NetUI - Tiles support
Hi Bala,
I just want to make sure I understand what you're asking. Are you
trying to get this running on WebLogic 8.1? If so... unfortunately, it
won't work. Beehive requires things like Servlet 2.4 / JSP 2.0 which
aren't part of 8.1. If you want to try this out on WebLogic, you can
give WebLogic 9.0 (Diablo) beta a shot... or you can try it on Tomcat
5.0.x, or on JOnAS 4.1.4 patched for Java 5 (see the thread "Running
Beehive on JOnAS, from Bryan Che).
If you're looking for information on the programming model (annotations)
support, or details on how this got implemented, I'll defer to Carlin,
who submitted the patch for Tiles support.
Rich
Balasubramanian Krishnan wrote:
Hi Rich,
That's cool. i wld love to first test it in v8.1 based on the current
research done for tiles. may be if you can send me the document on tiles
support in JPF, i would do the sample work in v8.1 and will test for
certain features in it.Thanks for your update. That's cool work rich.
hat's off. Its really a much awaited stuff.
with regards,
bala
Richard Feit <[EMAIL PROTECTED]>
12/21/2004 11:40 AM
Please respond to
"Beehive Developers" <[email protected]>
To
Beehive Developers <[email protected]>
cc
Subject
Re: checkin request NetUI - Tiles support
Hi Bala,
That was fast! :) I'll let Carlin fill in the details, but I just want
to mention that some of this *could* change upon review/test/use. We're
definitely supporting Tiles, but the annotations/attributes could
conceivably be altered, for instance. The feature will be in final form
at the next official release. That said, if you're willing to try out
the feature given that caveat, we'd love to get your feedback.
Rich
Balasubramanian Krishnan wrote:
Hi all,
its really a great news that tiles is supported in the JPF's. Its
awesome.
Can anyone send me the document which covers the step by step process of
achieving it??
with regards,
bala
Richard Feit <[EMAIL PROTECTED]>
12/21/2004 10:56 AM
Please respond to
"Beehive Developers" <[email protected]>
To
Beehive Developers <[email protected]>
cc
Subject
Re: checkin request NetUI - Tiles support
Hey Carlin,
Thanks for implementing the long-awaited, much-requested Tiles support
for Page Flows. You're sure to have some new fans out there now. Looks
great -- I just checked this in. I made three minor changes -- let me
know if any of this seems problematic.
In GenStrutsApp, I changed this:
paths.add( prefix + File.separator + definitionsConfig );
to this:
paths.add( prefix + '/' + definitionsConfig );
It looks like Tiles can accept either one, but since all other
webapp-relative paths use forward slashes, I thought we should follow
the same convention here.
In StrutsApp, I removed the following line:
if ( TILES_MODULE_AWARE_PROPERTY.equals( name ) )
{
// Make sure "moduleAware" is true
<-- existingSetProperties[i].setValue( "true" );
moduleAwarePropertyIsSet = true;
}
If the user has specified a value for this property in the
Struts-merge file, we don't want to overwrite it, even if we think it
will break our auto-generated functionality.
Also, I changed the following loop to prevent a ',' at the end of
the list of Tiles configs. Doesn't seem to change the behavior, but it
looks better in the generated output. :)
for ( String definitionsConfig : _tilesDefinitionsConfigs )
{
pathNames.append( definitionsConfig ).append( ',' );
}
is changed to:
boolean firstOne = true;
for ( String definitionsConfig : _tilesDefinitionsConfigs )
{
if ( ! firstOne ) pathNames.append( ',' );
firstOne = false;
pathNames.append( definitionsConfig );
}
Thanks again,
Rich
Carlin Rogers wrote:
The patch file attached below contains the following changes
for beehive NetUI.
- Added support for Tiles:
- The PageFlowRequestProcessor is now a subclass of
TilesRequestProcessor (required condition for the
correct tiles initialization via the TilesPlugin).
- Added annotations for Jpf to indicate the location
of the tiles definitions XML files (either from the
webapp root or relative to the JPF directory) and
the specific tiles definition to forward to for a
given JPF action. Multiple definition files can be
listed in new controller annotation. I.E.
@Jpf.Controller(
tilesDefinitionsConfigs = {
"tiles-defs.xml",
"/WEB-INF/tiles-defs.xml"
}
)
...
@Jpf.Action(
forwards = {
@Jpf.Forward(
name = "continue",
tilesDefinition = "defaultLayout")
})
- The generated page flow struts configuration file will
include the TilesPlugin plug-in element.
- Added a new BVT for tiles.
- Also changed the coreWeb/WEB-INF/web.xml to include the
struts-tiles.tld tag lib.
- Modified the undeploy.netui.runtime target in
webappTemplate.xml so that we also remove the pageflow
generated validation files, jpf-validation-*.xml, in the
WEB-INF/.pageflow-struts-generated/ directory.
DRT/BVT: NetUI (WinXP)
BB: self (WinXP)
Thanks,
Carlin