You can easily change the font attributes like bold and italic of a JTree‘s tree node (parent or leaf node) by overriding the DefaultTreeCellRenderer class getTreeCellRendererComponent() method. Then you can set the JTree’s setRenderer() method to this renderer object.

The code above sets the tree node’s font attributes (in this case bold and italic) if it is selected. If you want all tree nodes to have these same font attributes, you can remove the if condition statement.

In Java this piece of code, request.getSession().getAttribute(“my_var”) can be accessed using JSTL with the sessionScope keyword. To access my_var, call sessionScope.myvar.

Remember to use sessionScope because if your Java code looks like this: request.getAttribute(“my_var”) will not work. See sample JSTL code below.

Removing session attributes using Java code goes like this

To do the same thing in JSTL, do this

Related Posts Plugin for WordPress, Blogger...