Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using [jsp:getProperty] without useBean?  RSS feed

Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assume Dog has a property breed, can we get the property by this:
Dog dog=new Dog();

<jsp:getProperty name="d" property="breed"/>

In other words, without going through <jsp:useBean>.

In tomcat, this does print out "spaniel". However, in JSP spec 5.3

consequence of the previous paragraph is that objects that are stored
in, say, the session by a front component are not automatically
visible to jsp:getProperty actions in that page unless a jsp:useBean, or
some other action, makes them visible.

Can anyone explain the rule relating useBean and getProperty.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!