• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I call JavaBean set methods from jsp?

 
Aaron Parker
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried c:set commands that look like this, but I get this error:


org.apache.jasper.JasperException: /strutsNewRSSFeed.jsp(66,8) According to TLD or attribute directive in tag file, attribute var does not accept any expressions

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The message tells the tale. The var attibute cannot have a dynamic expression value.

There are two forms of <c:set>: one you use to set scoped vairables, one that you use to set a property of a bean that is a scoped variable.

The first format, sets a scoped variable:



The second format is used to set a property of a bean that is a scoped variable:



In the first format, the var attribute cannot be an expression
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic