• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Looping through vector object without calling a servlet

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67754
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
"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
reply
    Bookmark Topic Watch Topic
  • New Topic