View | Details | Raw Unified | Return to bug 55309
Collapse All | Expand All

(-)java/org/apache/jasper/compiler/TagPluginManager.java (-13 / +19 lines)
Lines 45-51 Link Here
45
    private boolean initialized = false;
45
    private boolean initialized = false;
46
    private HashMap<String, TagPlugin> tagPlugins = null;
46
    private HashMap<String, TagPlugin> tagPlugins = null;
47
    private ServletContext ctxt;
47
    private ServletContext ctxt;
48
    private PageInfo pageInfo;
49
48
50
    public TagPluginManager(ServletContext ctxt) {
49
    public TagPluginManager(ServletContext ctxt) {
51
        this.ctxt = ctxt;
50
        this.ctxt = ctxt;
Lines 59-77 Link Here
59
            return;
58
            return;
60
        }
59
        }
61
60
62
        this.pageInfo = pageInfo;
61
        page.visit(new NodeVisitor(this, pageInfo));
63
64
        page.visit(new Node.Visitor() {
65
            @Override
66
            public void visit(Node.CustomTag n)
67
                    throws JasperException {
68
                invokePlugin(n);
69
                visitBody(n);
70
            }
71
        });
72
73
    }
62
    }
74
 
63
 
64
    private static class NodeVisitor extends Node.Visitor {
65
    	private TagPluginManager manager;
66
    	private PageInfo pageInfo;
67
    	
68
    	public NodeVisitor(TagPluginManager manager, PageInfo pageInfo) {
69
    		this.manager = manager;
70
    		this.pageInfo = pageInfo;
71
    	}
72
    	
73
        @Override
74
        public void visit(Node.CustomTag n)
75
                throws JasperException {
76
        	manager.invokePlugin(n, pageInfo);
77
            visitBody(n);
78
        }
79
    };
80
    
75
    private void init(ErrorDispatcher err) throws JasperException {
81
    private void init(ErrorDispatcher err) throws JasperException {
76
        if (initialized)
82
        if (initialized)
77
            return;
83
            return;
Lines 180-186 Link Here
180
     *
186
     *
181
     * The given custom tag node will be manipulated by the plugin.
187
     * The given custom tag node will be manipulated by the plugin.
182
     */
188
     */
183
    private void invokePlugin(Node.CustomTag n) {
189
    private void invokePlugin(Node.CustomTag n, PageInfo pageInfo) {
184
        TagPlugin tagPlugin = tagPlugins.get(n.getTagHandlerClass().getName());
190
        TagPlugin tagPlugin = tagPlugins.get(n.getTagHandlerClass().getName());
185
        if (tagPlugin == null) {
191
        if (tagPlugin == null) {
186
            return;
192
            return;

Return to bug 55309