A simple reflection method in one of its own JSP was used to display the property method constructor of a class, as follows:
void Reflectapi (Javax.servlet.jsp.JspWriter out,string className) throws exception{
Class Cls=class.forname (className);
String constructor= "";
String ifstring= "";
Class[] Interfaces=cls.getinterfaces ();
String Supperclass=cls.getsuperclass (). toString ();
Constructor[] C=cls.getdeclaredconstructors ();
Field[] F=cls.getdeclaredfields ();
Method[] M=cls.getdeclaredmethods ();
for (int i=0;i<interfaces.length;i++) {
Ifstring=ifstring+interfaces[i].getname () + ",";
}
Out.print ("<strong>" +modifier.tostring (Cls.getmodifiers ()) + </strong> "+cls+" <br><strong >extends</strong> "+supperclass+" <strong><br>implemets</strong> "+ifstring);
Out.print ("<br>{<br><EM>Constructor:</EM><br>");
for (int i=0;i<c.length;i++)
Out.print (" ") +c[i]+ "<br>");
Out.print ("<EM>Field:</EM><br>");
for (int i=0;i<f.length;i++)
Out.print (" ") +f[i]+ "<br>");
Out.print ("<EM>Function:</EM><br>");
for (int i=0;i<m.length;i++)
Out.print (" ") +m[i]+ "<br>");
Out.print ("<BR>}");
It's similar to JAVAP.