2010/3/9 Gallagher, Jim (UK Europe Middle East & Group Functions,
Technology Services) <[email protected]>:
> This behaviour was available in Struts-Tiles, has it been removed from Tiles 
> 2.0?

I think it was an unintended feature :-D

> The rules definition is, as you say, not designed to be rendered. It's 
> purpose is to hold a list of security roles  - these roles are processed 
> programmatically and this decides whether the user sees that menu item (or 
> entire menu), based on their assigned role.

Tiles has a very basic role-based security: most of JSP tags
(insertTemplate, insertAttribute, insertDefinition) have a "role"
attribute, where you can put comma-separated list of enabled roles
(the user must be under at least one role).
These roles can be defined in XML files too.
If you need something more complicated, I think that your entry point
might be the DefinitionsFactory:
http://tiles.apache.org/2.0/framework/tutorial/extension/points.html
However I think that you should move your rules outside of Tiles and
load them separately.

If you have more questions on how to implement a DefinitionsFactory,
feel free to ask here.

Antonio

P.S. I strongly suggest to migrate to, at least, Tiles 2.1.x: there
are new features (like wildcards, EL expressions) that can help
development a lot. Moreover, the API is cleaner.
  • ... Gallagher, Jim (UK Europe Middle East & Group Functions, Technology Services)
    • ... Antonio Petrelli
      • ... Gallagher, Jim (UK Europe Middle East & Group Functions, Technology Services)
        • ... Antonio Petrelli
          • ... Gallagher, Jim (UK Europe Middle East & Group Functions, Technology Services)
            • ... Antonio Petrelli
              • ... Gallagher, Jim (UK Europe Middle East & Group Functions, Technology Services)
                • ... Antonio Petrelli

Reply via email to