Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Looping through vector object without calling a servlet

 
Suma K Gowda
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
My servlet code
request.setAttribute("myVector",vSimpleVector); // I'm setting a vector object to the request object
rd = ctx.getRequestDispatcher("/sample.jsp"); // and dispatching it to a jsp page...
in the jsp page I'm looping through the vector...
but I want to display some fixed records at a time..and when user clicks next I want to loop through the vector again...without actually calling the servlet again....... is there a way to get this working..........
Regards
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think about it - what is a JSP? Well basically its a scripting/markup language which is used to generate Servlets that contain the actual functionality of the JSP page. So there is no way of getting JSP functionality without calling a Servlet. You could write out the contents of the Vector to hidden fields in your HTML page, and use JavaScript for whatever client side functionality you need.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"push j",
We're pleased to have you here with us in the JSP forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Thanks!
bear
Forum Bartender
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!