• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

contextScope attribute setting

 
Harshana Dias
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

We know we can set request scope attribute in a servlet and pass them in to a servlet like,

request.setAttribute("x", xyz);
RequestDispatcher v=request.getRequestDispatcher("abc.jsp");
v.forward(request, response);

Likewise how to set application scope attribute and call a jsp (dispatching) like above?

Thank You.
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Harshana. To set application scope attribute, use
 
Harshana Dias
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes. i was asked how to dispatch it for a jsp but i was stupid becuse we no need to dispatch those attributes for a jsp or any other in the web app since its application scope so its already available know for any part of the application.

any way thankx Chinmaya.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic