O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tags that Define Script Variables

Now that you know the basics of custom tags, you can start developing more functional tags for use in your applications. The first feature you will study is that of creating scripting variables that can be used on the Web page.

A scripting variable can be added to the page context using the setAttribute() method of the instance variable called pageContext that points to the javax.servlet.jsp.PageContext object of the Web page. The setAttribute() method takes the following parameters:

  • The name of the scripting variable. This name is used to refer to the variable on the Web page.

  • The object reference to the variable to be added to the page.

  • The scope of the variable that can be one of the following constants defined ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required