Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes requestScope VS request object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "requestScope VS request object" Watch "requestScope VS request object" New topic
Author

requestScope VS request object

Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 215
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

Joined: Jul 05, 2007
Posts: 115
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!!!



SCJP1.4(96%) SCWCD1.4(92%)
James Mark
Ranch Hand

Joined: Jul 05, 2007
Posts: 115
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

Joined: Apr 20, 2006
Posts: 3344

Please have a look at this thread which has a discussion on "Implicit Variables Vs Implicit Objects".

It might give you some hints.


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: requestScope VS request object
 
Similar Threads
Doubt in jsp and el implicit objects
Properties vs. Attributes
doublt in pg 384- Request scope is not request object?
[SCWCD] Difference between ${request} and ${requestScope}
EL implicit objects vs. JSP scripting objects