Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

useBean with type without class  RSS feed

 
Mark Duvernell
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've read that you can do this, but I can't seem to come up with sample code that proves it to me. I'm trying to prove to myself that this works:


...From what I hear, it should work if "person" exists within the specified scope. I believe this code could be used to switch the type of person.

Shouldn't this work?


Unfortunately I get "org.apache.jasper.JasperException: /ch8/foo2.jsp(25,0) jsp.error.useBean.duplicate"

Any help you can provide would be appreciated.

Thanks.

-Mark
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mark Duvernell:
Shouldn't this work?


No. You can't reuse the same id.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From what I hear, it should work if "person" exists within the specified scope.


It will. But it is expected that the scoped variable already exists in the scope context prior to the activation of the page, for example, as the result of the servlet controller placing it there.
 
Mark Duvernell
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!