Struts - passing arbitrary properties to mapping


Web tier: servlets, JSP, Web frameworks: Struts - passing arbitrary properties to mapping

  1. Having problems with email today, so struts mailing list not an option...

    Anyway, does anyone know of a technique for passing <set-property> elements to the ActionMapping object as a Map, rather than as introspected bean-properties?

    I have a requirement to be able to configure arbitrary properties for some mappings, which are not known at compile time. Because of this, they can't be bean properties, I need them as a Map.

    Any suggestions much appreciated.
  2. why don't you just try and post the key/value pairs through the request and convert it to a hashMap in your Action class. From here you can use org.apache.struts.util.BeanUtils.populate(java.lang.Object bean, java.util.Map properties). Remove the <jsp:setProperty...> tag from the JSP. Good luck!
  3. You misunderstand - I want to pass the properties to the mapping, not the action. These are not request parameters, they're configuration parameters.