Nope.. The reason is very simple, we always use <jsp:setProperty> standard action tag to set the property values of certain JavaBean. So without specifying JavaBean's name, it wouldn't be possible to set the desired values of JavaBean's properties and that's why name and property attributes are mandatory in <jsp:setProperty> tag. The same is applicable for <jsp:getProperty> standard action tag. Before using these two tags, we need to declare and instantiate the JavaBean class by using <jsp:useBean .../> tag in our jsp's. e.g. <jsp:useBean id="myBean" type="classtype" class="xxx.ClassName" scope="session" />. id attribute of <jsp:useBean.../> is the object-name which we use in name attribute of <jsp:setProperty> & <jsp:getProperty> tags to specify the JavaBean name.
Hope this helps!!!
-------------------- SCJP 1.4 | SCWCD 1.4 | SCBCD 1.3 | SCEA Part I - In Progress
Actually, the truth is that you can use <jsp:setProperty> and <jsp:getProperty> without a previous <jsp:useBean>. All <jsp:setProperty> and <jsp:getProperty> do is to use PageContext.findAttribute()�so if an attribute of the right name exists�set up, perhaps, in a previous servlet�these standard actions will fi nd it. However, it�s good practice to include <jsp:useBean> before these actions in the same JSP page. After all, it won�t replace beans of the same name that you have set up by other means, and it will create beans of the right name that don�t exist already. Furthermore, if your <jsp:setProperty> and <jsp:getProperty> standard actions try to access an attribute that doesn�t exist, they are liable to die a horrible death with HTTP 500 errors returned to the requester.
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
This is what section JSP.5.3 of the specification says:
The value of the name attribute in jsp:setProperty and jsp:getProperty will refer to an object that is obtained from the pageContext object through its findAttribute method. The object named by the name must have been �introduced� to the JSP processor using either the jsp:useBean action or a custom action with an associated VariableInfo entry for this name. If the object was not introduced in this manner, the container implementation is recommended (but not required) to raise a translation error, since the page implementation is in violation of the specification.
Note � A consequence of the previous paragraph is that objects that are stored in, say, the session by a front component are not automatically visible to jsp:setProperty and jsp:getProperty actions in that page unless a jsp:useBean action, or some other action, makes them visible.
I have tested it in tomcat and a transaltion error is thrown.