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

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="" scope="request"/>


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

Joined: Jan 10, 2002
Posts: 63858

Please continue this discussion in the original post.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Syntax useBean
It's not a secret anymore!