I completely agree with you D.J. Hagberg. In my situation I defined the
following code below (I am using weblogic 4.51):
<jsp:useBean id="user" scope="session" class="com.logo.Mybean" />
...
<td bgcolor="<jsp:getProperty name="user" property="companyColor" />"
colspan="3">
...
And I got the following error message: "user is not defined as bean"
I then used the escape character in the code like this:
...
<td bgcolor="<jsp:getProperty name=\"user\" property=\"companyColor\" />"
colspan="3">
...
I then see 'colspan="3">' appearing on the web page.
But when I use the code below it works fine:
<td bgcolor="<%= user.getCompanyColor() %> colspan="3">
My conclusion is that <jsp:getProperty ... /> messes up your HTML Code. Be
very careful when you use it.
-----Original Message-----
From: D. J. Hagberg [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 05, 1999 5:35 PM
To: [EMAIL PROTECTED]
Subject: Value of <jsp:getProperty.../> vs <%= ... %> ?
A quick question for those of you in the know...
Are there rules or guidelines for when one should use:
<jsp:getProperty name="beanname" property="propname" />
versus when one should use:
<%= beanname.getPropname() %>
Personally, I think the latter is *much* cleaner inside a tag like the
following as you avoid the ugly sets of nested quotes (that mess up most
html validators).
<INPUT TYPE="..." NAME="X" VALUE="<%= beanname.getPropname() %>">
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html