/*
 * Copyright (C) 2005-2007 Les Hazlewood
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
 * Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; if not, write to the
 *
 * Free Software Foundation, Inc.
 * 59 Temple Place, Suite 330
 * Boston, MA 02111-1307
 * USA
 *
 * Or, you may view it online at
 * http://www.opensource.org/licenses/lgpl-license.php
 */
package org.jsecurity.web.tags;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jsecurity.context.SecurityContext;
import org.jsecurity.context.support.ThreadLocalSecurityContext;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

/**
 * @since 0.1
 * @author Les Hazlewood
 */
public abstract class SecureTag extends TagSupport {

    protected transient final Log log = LogFactory.getLog( getClass() );

    public SecureTag(){}

    protected SecurityContext getSecurityContext() {
        return ThreadLocalSecurityContext.current();
    }

    protected void verifyAttributes() throws JspException {
    }

    public int doStartTag() throws JspException {

        verifyAttributes();

        return onDoStartTag();
    }

    public abstract int onDoStartTag() throws JspException;
}

@@ -1363,24 +1363,105 @@
 Class() );%0A%0A
+    private SecurityContext securityContext = new ThreadLocalSecurityContext();%0A%0A
     public S
@@ -1473,16 +1473,16 @@
 Tag()%7B%7D%0A
-
 %0A    pro
@@ -1542,28 +1542,22 @@
  return 
-ThreadLocalS
+this.s
 ecurityC
@@ -1566,18 +1566,8 @@
 text
-.current()
 ;%0A  

Fix for security JSP tags.