Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Clifford Chapman   on Sep 30 In Java Category.

  
Question Answered By: Jared Adams   on Sep 30

The JSP set property tag will perform the set on
sets that have single parameters. The JSP
compiler uses something called "introspection" to look at
the Java bean  and find all the set<variable
name> methods. It then looks at the "request" object to
see if a variable with the same name  has been set in
the request object. If you have a parameter in
your previous page or you set it in the servlet that
is named like this: setParameter("teacher",
"Mrs. Grouch"); (I actually had a teacher named
that... she was really nice). You would have a
method in the Bean like
this. bean.setTeacher(String param); Notice that the first
character in
the parameter is not capitalized and the first
character of Teacher in the set method  is
capitalized. You can actually see the code generated by the tag if
you look up the java generated by the JSP
compile.... Also, check out the java.reflection.* API's... They
allow you to do alot of "dynamic" programming...
Hope this helps. Stephen
McConnell http://www.crosslogic.com

Share: 

 
 
Didn't find what you were looking for? Find more on jsp, db AND beans Or get search suggestion and latest updates.


Tagged: