tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Using Reflection in Tags? Good?
Date Tue, 02 Oct 2001 16:28:57 GMT

On Tue, 2 Oct 2001, Hunter Hillegas wrote:

> Date: Tue, 02 Oct 2001 07:45:17 -0700
> From: Hunter Hillegas <>
> Reply-To:
> To: Tomcat User List <>
> Subject: Using Reflection in Tags? Good?
> I have the Manning book, "JSP Tag Libraries" which I've been using to help
> develop some of my first tags.
> For their iterator tags that work with beans, they use a lot of reflection.
> I've not used reflection much in projects before this but I seem to remember
> from my education that reflection is a very expensive process...
> Anyone that has worked with tags have any insight as to how this design
> could negatively impact performance on the Web app?

With modern JVMs, the cost of reflection is nearing zero.  Compared to
network and database latency, you'll usually never see the small amount of
extra compute time required for reflection.  And you'll really like all
the freedom and flexibility it gives you.

For an interesting use of reflection, check out how the Struts Framework
uses it to populate JavaBeans properties of ActionForm beans:

Struts uses a small class library called "BeanUtils" underneath, which is
also available to you separately through the Jakarta Commons project:

> Hunter


View raw message