my dog learned polymorphism*
The moose likes JSP and the fly likes Syntax useBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

Syntax useBean

naro pad
Ranch Hand

Joined: May 07, 2008
Posts: 58

I want to make loop which it will creates beans but I don't know how the syntax is. I want to pass the 'i' to the id of the bean but I have syntax error

<% for(int i=0;i<=8;i++){%>
<jsp:useBean id=<%="book" +i%> class="beans.book" scope="request"/>

<%}%>

Can anyone provide me the right syntax?
Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

Please continue this discussion in the original post.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Consider Paul's rocket mass heater.
 
subject: Syntax useBean
 
Similar Threads
correct Ajax script syntax for second DropDown
Mapped Properties using C tag library problem
Use Bean more than one time
newbie: jquery's clone method
class property of a javabean