You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Nick Chalko <Ni...@planetU.com> on 2001/05/02 23:05:56 UTC

BUG: cvs commit: jakarta-struts/src/share/org/apache/struts/tagli b/html FormTag.java

Running Struts from 5/1/01 cvs I get the following error from the form tag.
I am using IBM VAJ 3.5.3 with the Web Sphere Test environment set to JSP
level 1.1
 
<!--StartFragment-->java.lang.IllegalArgumentException: cant remove
Attributes from request scope
java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
java.lang.RuntimeException(java.lang.String)
java.lang.IllegalArgumentException(java.lang.String)
void
org.apache.jasper.runtime.PageContextImpl.removeAttribute(java.lang.String,
int)
int org.apache.struts.taglib.html.FormTag.doEndTag()
 
I am not sure why the doEndTag needs to remove the object but jasper doesn't
let it. 



-----Original Message-----
From: craigmcc@apache.org [mailto:craigmcc@apache.org]
Sent: Saturday, April 28, 2001 8:12 PM
To: jakarta-struts-cvs@apache.org
Subject: cvs commit:
jakarta-struts/src/share/org/apache/struts/taglib/html FormTag.java


craigmcc    01/04/28 20:11:40

  Modified:    src/share/org/apache/struts/taglib/html FormTag.java
  Log:
  Migrate the attributes created by the <html:form> tag (the form tag
  instance itself, and a reference to the form bean itself) from page scope
  to request scope.  Among other things, this change enables the use of a
  separate JSP page (accessed by <jsp:include> or the template tag library)
  to contain the input fields, nested inside an <html:form> tag instance.
  
  PR: Bugzilla #932
  Submitted by:	Lajos Incze <in...@mail.matav.hu>
  
  Revision  Changes    Path
  1.11      +12 -8
jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java
  
  Index: FormTag.java
  ===================================================================
  RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.jav
a,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FormTag.java	2001/04/19 22:58:40	1.10
  +++ FormTag.java	2001/04/29 03:11:39	1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.jav
a,v 1.10 2001/04/19 22:58:40 craigmcc Exp $
  - * $Revision: 1.10 $
  - * $Date: 2001/04/19 22:58:40 $
  + * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.jav
a,v 1.11 2001/04/29 03:11:39 craigmcc Exp $
  + * $Revision: 1.11 $
  + * $Date: 2001/04/29 03:11:39 $
    *
    * ====================================================================
    *
  @@ -87,7 +87,7 @@
    * properties correspond to the various fields of the form.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.10 $ $Date: 2001/04/19 22:58:40 $
  + * @version $Revision: 1.11 $ $Date: 2001/04/29 03:11:39 $
    */
   
   public class FormTag extends TagSupport {
  @@ -512,7 +512,8 @@
           ResponseUtils.write(pageContext, results.toString());
   
   	// Store this tag itself as a page attribute
  -	pageContext.setAttribute(Constants.FORM_KEY, this);
  +	pageContext.setAttribute(Constants.FORM_KEY, this,
  +                                 PageContext.REQUEST_SCOPE);
           
   	// Locate or create the bean associated with our form
   	int scope = PageContext.SESSION_SCOPE;
  @@ -535,7 +536,8 @@
   	    }
   	    pageContext.setAttribute(name, bean, scope);
   	}
  -	pageContext.setAttribute(Constants.BEAN_KEY, bean);
  +	pageContext.setAttribute(Constants.BEAN_KEY, bean,
  +                                 PageContext.REQUEST_SCOPE);
   
   	// Continue processing this page
   	return (EVAL_BODY_INCLUDE);
  @@ -551,8 +553,10 @@
       public int doEndTag() throws JspException {
   
   	// Remove the page scope attributes we created
  -	pageContext.removeAttribute(Constants.BEAN_KEY);
  -	pageContext.removeAttribute(Constants.FORM_KEY);
  +	pageContext.removeAttribute(Constants.BEAN_KEY,
  +                                    PageContext.REQUEST_SCOPE);
  +	pageContext.removeAttribute(Constants.FORM_KEY,
  +                                    PageContext.REQUEST_SCOPE);
   
   	// Render a tag representing the end of our current form
   	StringBuffer results = new StringBuffer("</form>");