aniston
asked on
Easy Question - Which one of these is invalid?!?
In a JSP, which of these would be invalid?
1. String value = request.getAttribute("valu e");
2. request.setAttribute("valu e", value);
3. String value = request.getParameter("valu e");
4. Object value = request.getAttribute("valu e");
I think it is 4 since the object type of "value" will probably be a type that is not of "Object" type...But then isn't a type like "String" an "Object" so then 4 would be valid...Ok, now i am not sure again. Can someone tell me which is the invalid one and why?
Thanks
1. String value = request.getAttribute("valu
2. request.setAttribute("valu
3. String value = request.getParameter("valu
4. Object value = request.getAttribute("valu
I think it is 4 since the object type of "value" will probably be a type that is not of "Object" type...But then isn't a type like "String" an "Object" so then 4 would be valid...Ok, now i am not sure again. Can someone tell me which is the invalid one and why?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.