Forums Register Login

requestScope VS request object

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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!!!

+Pie Number of slices to send: Send
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...
1
+Pie Number of slices to send: Send
Please have a look at this thread which has a discussion on "Implicit Variables Vs Implicit Objects".

It might give you some hints.
We find this kind of rampant individuality very disturbing. But not this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2804 times.
Similar Threads
Properties vs. Attributes
EL implicit objects vs. JSP scripting objects
doublt in pg 384- Request scope is not request object?
[SCWCD] Difference between ${request} and ${requestScope}
Doubt in jsp and el implicit objects
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:36:03.