• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with calling useBean tag in a loop  RSS feed

 
yerra reddy gatla
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My requirement is to call <jsp:useBean> tag in a loop to set the bean properties multiple times and to insert them into the Db inbean class. but only once it is happening. only once <jsp:useBean> tag getting called and that record only inserting many time as for the loop condition..

code snippet is


for(int i=0;i<s.length;i++)
{
String technologies=s[i];
System.out.println("technology value"+technologies);
%>
<jsp:useBean id="login" class="bean.LoginBean">
<jsp:setProperty name="login" property="name" param="name" />
<jsp:setProperty name="login" property="email" param="email" />
<jsp:setProperty name="login" property="companyname" param="companyname" />
<jsp:setProperty name="login" property="website" param="website" />
<jsp:setProperty name="login" property="technologies" param="technologies" />
</jsp:useBean>
<%
login.Insert();
}
%>


please give me a solution for this problem,

it's very urgent.............
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you doing it with a mix of Java and JSP?. If you're going to put scriplets on the page -- something I advise against -- you might as well just do the whole thing in Java and avoid the headaches that come with mixing and matching different technologies.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, please read this with regard to delcaring your posts as "urgent".

I usually ignore such posts but answered yours before I saw that.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!