--- "Garcia, Cristina" <[EMAIL PROTECTED]> wrote:

>  trying to avoid the Java code inside the JSP page, I thought about writting
> getter methods in a Bean so that it returns a String containing HTML code
> together with values I had to calculate. What do you think about the idea?

But the strength with JSP is the *separation* of HTML from code. You're
right...avoiding the inclusion of Java code in your page is a desirable thing.
But putting the HTML into the Java code is the pendulum swinging in the other
direction, and is equally bad. What you *want* is to have processing happen in
Java, and presentation happen in the HTML. This enables an HTML person to do
the design, and a Java person to do the programming. Efficient separation of
duties.

The way you can do this is with JSP taglibs. You can create a tag that takes
arguments/parameters and returns a value. You can even use this value within
another tag, for compound functionality.

If you haven't already, consider buying the Manning book "Web Design with
JavaServer Pages," from www.taglib.com. Then, read (I think) chapters 13 and
14. They do a really good job of showing you how to create custom tag
libraries.

-David Castro
 [EMAIL PROTECTED]

__________________________________________________
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to