The code inside in declaration part of JSP, is separated from service method of JSP. In declaration part, no implicit object directly use. You can pass object from JSP code to declaration code and use this objects in declaration part.
May this can through an error of
Syntax error on token foo, Identifier expected after this token
Or when you try to access static method of another class in declaration also through this error
Can you put some code and error in more detail to understand question