Link to home
Start Free TrialLog in
Avatar of aniston
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("value");
2. request.setAttribute("value", value);
3. String value = request.getParameter("value");
4. Object value = request.getAttribute("value");

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
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial