1 package com.opensymphony.module.sitemesh.parser.rules; 2 3 import com.opensymphony.module.sitemesh.HTMLPage; 4 import com.opensymphony.module.sitemesh.html.BasicRule; 5 import com.opensymphony.module.sitemesh.html.Tag; 6 7 public class MetaTagRule extends BasicRule { 8 9 private final HTMLPage page; 10 11 public MetaTagRule(HTMLPage page) { 12 super("meta"); 13 this.page = page; 14 } 15 16 public void process(Tag tag) { 17 if (tag.hasAttribute("name")) { 18 page.addProperty("meta." + tag.getAttributeValue("name"), tag.getAttributeValue("content")); 19 } else if (tag.hasAttribute("http-equiv")) { 20 page.addProperty("meta.http-equiv." + tag.getAttributeValue("http-equiv"), tag.getAttributeValue("content")); 21 } 22 tag.writeTo(context.currentBuffer()); 23 } 24 } 25 | Popular Tags |