I want to have a tag with dynamic attributes, such as simple html tags , for example .
<tags:superTag dynamicAttribute1="value" someOtherAttribute="valueOfSomeOther"/>
And in my tag implementation, I want to have something like this:
public class DynamicAttributesTag { private Map<String,String> dynamicAttributes; public Map<String, String> getDynamicAttributes() { return dynamicAttributes; } public void setDynamicAttributes(Map<String, String> dynamicAttributes) { this.dynamicAttributes = dynamicAttributes; } @Override protected int doTag() throws Exception { for (Map.Entry<String, String> dynamicAttribute : dynamicAttributes.entrySet()) {
I want to note that these dynamic attributes will be written by hand in jsp, and not just as a Map, for example ${someMap} . So is there a way to achieve this?
java jsp
Artem malinko
source share