1

I'm studying Java EE and reading a chapter that talks about Javabeans, and jsp:setproperty.

The example is:

<jsp:useBean id="user1" class="User" />
<jsp:setProperty id="user1" property="name" value="Johnnie" />

Why should I even bother doing this? and not using the following code in my jsp:

<%
User user1 = new User();
user1.setName('johnnie');
%>
Matthew Flaschen
  • 268,153
  • 48
  • 509
  • 534
Urbanleg
  • 5,802
  • 16
  • 70
  • 137

0 Answers0