Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

jsp get param from servlet

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
2 questions
1.i want refresh my jsp page when servlet will full loaded
how i can track it ?
2. this jsp get some parameter from servlet
in servlet i use
RequestDispatcher dispatcher=getServletContext().getRequestDispatcher("/MyJSP.jsp?param1="+value);
dispatcher.forward(req,res);
how i can get it in JSP ?
thanks
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not totally understand the first question, but I can answer the second.
Before you forward via the RequestDispatcher, you can put object in the Request object.
Request.setAttribute(key, value) puts an object in the request. In your JSP, you can get the object out using the <jsp:useBean ...> tag as well as the JSTL <req:attribute...> tag or any other JSP tag written for this purpose.
Check out the book Java Server Pages, 2nd Edition by Hans Bergsten from O'Reilly, it is very good.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic