Line 4 need not throw an error under one condition . If the custom tags used in lines 2 or 3 had introduced a scripting variable by the name "x" , then line 4 will work fine. Custom Tags can introduce scripting variables using the <tei-class> and the variableInfo entry .
As per the spec
"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 "