This question is so vague as to be meaningless. And what does it have to so with custom tags?
But, using one possible interpretation of the question, yes you can create and reference local variables in
Java scriptlets within a JSP. Any such scriplets become part the service method of the JSP-generated
servlet.
bear