Umm .. this is where it does get a bit tricky.

<%
/**
[EMAIL PROTECTED]
*       name="foo.layout"
*       path="/WEB-INF/jsp/layouts/fooLayout.jsp"
*
@struts.tiles-put
*       name="heading"  value="" type="string"
*
[EMAIL PROTECTED]
*       name="body" value="" type="page"
*/
%>
<tiles:useAttribute id="heading" name="heading" scope="page" />
<html:html>
<body>
        <h1>${heading}</h1>
        <tiles:insert attribute="body" />
</body>
</html:html>


<%
/**
[EMAIL PROTECTED]
* name="editOrder"
* extends="foo.layout" // other attributes controllerUrl , controllerClass and so on.
*
[EMAIL PROTECTED]
* name="heading" value="My Heading" type="string"
*
[EMAIL PROTECTED]
* name="body" type="page" //not sure if could have the value automatcially set to the current file.
*/
%>


<html:form action="/save.do">

and so on.
I guess it would render like this.
<definition name="editOrder" extends="foo.layout">
<put name="body" value="/WEB-INF/jsp/issues/editOrder.jsp" type="page" />




A big problem for me would be that the internationalization in tiles would be lost, in fact this is a show stopper for me. This is a big advantage of tiles over other templating systems, and for me one of the main justifications for continuing to use tiles.

The only solution i can thing of would have a lang attribute on the definition


@struts.tiles-definition lang="en" name="fooPage" path="myLayout.jsp"

@struts.tiles-put
        name="heading"
        value="Hello world!!"
        type="string

@struts.tiles-definition
        lang="it"
        name="fooPage"
        path="myLayout.jsp"

@struts.tiles-put
        name="heading"
        value="Caio mondo!!!"
        type="string"

would create a tiles-defs_EN.xml or the top would be default.

and a tiles-defs_IT.xml

Still kind of long, but then tiles are . I've been thinking about using JSP 2's custom stuff to think of an alternative mechanism. But if i were to stick with tiles, I guess having the tags and jsp in the same page would save redundant definitions floating around.

I've never played with customising xdoclet , if I don't hear anything from the OP i might look into it.

Mark


On 10 Jun 2004, at 10:52, Torgeir Veimo wrote:

On Wed, 2004-06-09 at 12:21 -0600, Matt Raible wrote:
I don't believe anyone has done what you're looking for - but I'm
willing to help.  Do you have any idea of what the syntax might look
like in the action class?

Not shure about the generic syntax.

The specific need we have is to define a definition for each jsp file,
with some additional parameters, to automatically have the jsp put into
a containing layout template, and to associate the jsp with a
highlighted menu item in that template.

Most of these defaults to some value.

Mark's suggestion would work, eg:

@struts.tiles-definition name="editOrder"
        path="/WEB-INF/jsp/issues/editOrder.jsp"
        extends="foo.layout"

would turn into

<definition extends="foo.layout" name="editOrder">
    <put name="body" value="/WEB-INF/jsp/issues/editOrder.jsp"></put>
</definition>

But I'd also like to add a generic parameter, which should be added to
the definition as:

    <put name="menu1" value="issues"></put>

Should this maybe be with an additional tag?


-- Torgeir Veimo <[EMAIL PROTECTED]>



-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite!  GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user




------------------------------------------------------- This SF.Net email is sponsored by: GNOME Foundation Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway http://2004/guadec.org _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to