• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with calling useBean tag in a loop

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.............
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic