Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question ID : 995377945515

 
Raj Paul
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following statements correctly store an object associated with a name at a plac where all the servlets/jsps of the same webapp participating in a session can use it?
1)request.setAttribute(name,value)
2)response.setAttribute(name,value)
3)request.getSession().setAttribute(name,value)
4)servlet.getServletContext().setAttribute(name,value)
5)request.setParameter(name,value)
i answered 3 but jwebplus answered 3,4
In 4, what does the servlet mean.
Please clear this.
 
Nazmul Huda Sarkar
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it would be servletConfig...if so then it is right.
I found so many mistakes in JWeb+ old version. You should check your JWeb+ version..
 
no more user
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,
remember that application scope is wider than session scope.
3) getSession().setAttribute(name,value)
servlets/jsps of the same webapp participating in a session can use it..
4) getServletContext().setAttribute(name,value)
not only who participating in session can use it

servlet in 4 is .. HttpServlet
----------------
regards,
alex
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic