learn java
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

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic

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?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62294

Please continue this discussion in the original post.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Have you tried LearnNowOnline? http://www.learnnowonline.com/
subject: Syntax useBean