Data transfer from jsp custom tags to jsp page's java variable Is it possible to assign to a JSP scriptlet variable a value generated by custom tag? Or is there some other way to transfer parameters from tag output to JSP page?

Alessandro A. Garbagnati

Yes, absolutely. The easiest way and, if you follow Sun's specs more reliable, is using the attribute space of the page:

pageContext.setAttribute(<name>, <object>, PageContext.PAGE_SCOPE);

Then you can get it back using:

pageContext.getAttribute(<name>, PageContext.PAGE_SCOPE);

Although there are many other solution, but most of them are normally less reliable and less generic.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.