As I side I really don't like Map backed ActionForms (I used to love them:) for the same reason that I don't like DynaForms (basically a Map form). The potential for problems later setting the properties is what bothers me. There isn't any compile time safety. Nothing would prevent you in your Action from doing...


form.setValue("empNamme","John Doe") when in reality you wanted...

form.setValue("empName", "John Doe")

Even if you use constants for your keys it still can make a mess of things. I really like regular ActionForms now with your typical bean properties.

Also you get the advantage of nice IDE automcomplete stuff using a regular Java bean:)

form.setEm...(autocompletes.. to setEmpName( ) )

Not that an IDE would be my reason for not using Map backed forms - it's the lack of compile time checks that I don't like.

Michael McGrady wrote:

I am using the following in an action form:



 public void setMap(Map map) {
   this.map = map;
 }

 public Map getMap() {
   return map;
 }

 public void setValue(Object key, Object value) {
   map.put(key,value);
 }

 public Object getValue(Object key) {
   return map.get(key);
 }


Yet, when I put setValue("test","TEST") into the session, I get the following exception from the attempted use of <html:bean name="formName" property="value(test)"/>:


  "No getter method for property value(test) of bean formName"

This is quite a surprise. Anyone know what is going wrong here? Sometimes the simplest things go wrong?

Michael


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to