File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

requestScope VS request object

 
Satyajeet Kadam
Ranch Hand
Posts: 224
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q1)I want to know the difference between requestScope VS request object?
Q2)Page 384 Head first Don't confuse the Map Scope objects to the objects with attributes are bound? please explain this with example?
Q3) what difference between Implict objects in El vs Jsp implicit object



Jsp implcit object Servlet
for example)

appplication.setAttribute()==> ServletContext.setAttribute() in servlets
 
James Mark
Ranch Hand
Posts: 115
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the request Scope ....

the idea is getting the attribute bound to the HttpServletRequest object.
the equivalent in jsp implicit object is request
instead of using the getAttribute(String) on the request object...

just use the requestScope EL implicit object.....but how?
Either use . or [] operator upon requestScope to get the Object(or even its property) bound to the HttpServletRequest object.
remember request is used in the jsp pages to refer the HttpServletRequest object....

Keep Cool dont get carried away!!!

 
James Mark
Ranch Hand
Posts: 115
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as an Example.....
<html>
<%
String [] noises = {"Lion","Tiger","Cat"};
request.setAttribute("noises",noises);
%>
${requestScope.noises[0]}
${requestScope.noises["0"]}
${requestScope.noises['0']}
${noises[0]}
${noises["0"]}
${noises['0']}
</html>

if you are not specifying any scopes... the search will be performed in different Scopes in page,request,session,application Order...
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please have a look at this thread which has a discussion on "Implicit Variables Vs Implicit Objects".

It might give you some hints.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic