I assume you want to compare the access of scoped variables with scriptlets and EL? Some things I see here:
- <jsp:useBean...> looks for a bean named "person". Tomasz Szymanski pointed this out, if you want to use the same object as with the scriptlet,
you should write id="pObj". Your EL expression would then access it with ${pObj.name}.
- You use <jsp:useBean..> with the class attribute. This creates a new Person object in the request scope, which attributes will be null of course (since your Person object does not have a default constructor that sets another value). If you want to use an existing object, you should write type="com.beans.Person" instead of class="..".
- I don't think you need <jsp:getProperty..> here (might depend on which JSP/EL version you are using).
- Yet another thing: I *think* you can leave out the <jsp:useBean..> completely. The EL expression is smart enough to look into the different scopes by itself. However I usually do write <jsp:useBean..> (with type attributes) at the beginning of a jsp to document which beans the page expects. Note that <jsp:useBean..> will throw a nullpointer exception if the objects are not found in scope, so this is also a useful way to find mistakes quickly.