On Thursday, Jan 2, 2003, at 12:44 US/Pacific, Rob Rohan wrote: > I've been playing with JSP (tomcat) and the bean feature is rad. > Creating > the accessor and mutator and then simply having the form go straight > to the > bean - it's awesome
By way of explanation for folks who might not immediately follow Rob's comments: If you have a Java class with a data attribute called "thing" and setter/getters called void setThing(Type newThing) / Type getThing() then you can access them in JSP as if it were a direct attribute rather than methods: obj.thing = 42; // actually calls obj.setThing(42) x = obj.thing; // actually calls obj.getThing() I don't remember the exact syntax or the tags but it allows you to encapsulate your data effectively without clients having to worry about method calls, e.g., setAge(x) could check the age is > 0 so that obj.age = -1 is trapped. > I have 2 questions. First, are bean functions available in cfmx (non > enterprise or does one have to upgrade - I am a bit confused would > pages A quick test shows that CFMX does not seem to support the same thing: // Thing.java: public class Thing { private String value; public void setIt(String x) { value = x; } public String getIt() { return value; } } <!--- thing.cfm ---> <cfset obj = createObject("java","Thing")> <cfset obj.it = "Hi!"> That causes an error. <cfset obj.setIt("Hi!")> works. > work like .cfm -> cfmx -> tomcat -> apache/iis -> brower?). Second, > did you CFMX is a J2EE application (with some supporting native machinery) that compiles .cfm pages to .java files and then compiles those (using jikesw or javac) into .class files which are then loaded (by CFMX) and executed (by the J2EE app server). CFMX is invoked as a Servlet (CfmServlet). Does that answer your question? > guys base cfmx/jrun off tomcat or is that just coincidence (directory > structure, jikes, etc)? I have no idea - JRun predates my experience with Macromedia by a few years! Sean A Corfield -- Director, Architecture Web Technology Group -- Macromedia, Inc. tel: (415) 252-2287 -- cell: (415) 717-8473 aim: seancorfield -- http://www.macromedia.com An Architect's View -- http://www.corfield.org/blog/ Introducing Macromedia Contribute. Web publishing for everyone. Learn more at http://www.macromedia.com/contribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.