Hey

This is really off-topic, as there is a JSP-INTEREST list. But anyway...

Wolf Siberski wrote:
> Could You please elaborate on how You would
> separate content and logic with JSP?
> Some short examples would be really helpful.
> What I really haven't figured out yet is how to
> do a good separation if there are repeated
> elements on the page. IMHO coding a for... or
> while... loop directly in the JSP page is rather ugly.

I'm glad you asked. :-)

Here's a full example copy&pasted straight from an example of
OrionServer JSP1.1 capabilities, so I know this works in practice.

-------------------
<%@ page session="false" %>
<%@ taglib uri="looptags.jar" prefix="test" %>

<html>
        <head>
                <title>Loop TagLibrary example</title>
        </head>

        <body>
                This example shows how to use a simple loop-tag with
dynamic attributes.<br>
                <br>

                <% int x = 0; %>

                <table border="2">
                        <test:loop count="10">
                                <tr>
                                        <test:loop
count="<%=Math.random() * 10f%>">
                                                <td><%=x++%></td>
                                        </test:loop>
                                </tr>
                        </test:loop>
                </table>
                End...
        </body>
</html>
-------------------

As you can see this is still somewhat "programmer"-ish. It can be
abstracted even more, but it shows that the potential is there. The tags
can be arbitrarily complex, so how much you define in meta-data and how
much you need to code in the JSP page is up to you.

That's what I was referring to in an earlier post: JSP1.1 is so
incredibly powerful that you can completely screw it up if you're not
careful. "Best practices" is crucial.

/Rickard

--
Rickard �berg

@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to