You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Wendy Smoak (JIRA)" <ji...@apache.org> on 2006/06/26 05:56:16 UTC

[jira] Created: (STR-2894) The type element should be optional

The <form-bean> type element should be optional
-----------------------------------------------

         Key: STR-2894
         URL: http://issues.apache.org/struts/browse/STR-2894
     Project: Struts Action 1
        Type: Bug

  Components: Core  
    Versions: Nightly Build    
    Reporter: Wendy Smoak
     Fix For: 1.3.5


According to the 1.3 DTD, the 'type' element of <form-bean> is optional.
   http://struts.apache.org/dtds/struts-config/1_3/

However, omitting it from the form bean definition in struts-config.xml results in an error.

        <form-bean
            name="inputForm" />

SEVERE: Servlet /my-webapp threw load() exception
javax.servlet.UnavailableException: Missing type value for inputForm form bean
	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
	at javax.servlet.GenericServlet.init(GenericServlet.java:211)



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (STR-2894) The type attribute should be optional

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/STR-2894?page=comments#action_38804 ] 
            
Paul Benedict commented on STR-2894:
------------------------------------

Thanks Wendy and Martin. So if both the "type" and "extends" attribute are absent, throw the error? That's a good business rule. 

> The <form-bean> type attribute should be optional
> -------------------------------------------------
>
>                 Key: STR-2894
>                 URL: http://issues.apache.org/struts/browse/STR-2894
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: Nightly Build
>            Reporter: Wendy Smoak
>             Fix For: 1.3.6
>
>         Attachments: my-webapp.zip
>
>
> According to the 1.3 DTD, the 'type' attribute of <form-bean> is optional.
>    http://struts.apache.org/dtds/struts-config/1_3/
> However, omitting it from the form bean definition in struts-config.xml results in an error.
>         <form-bean
>             name="inputForm" />
> SEVERE: Servlet /my-webapp threw load() exception
> javax.servlet.UnavailableException: Missing type value for inputForm form bean
> 	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
> 	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
> 	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
> 	at javax.servlet.GenericServlet.init(GenericServlet.java:211)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (STR-2894) The type attribute should be optional

Posted by "Martin Cooper (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/STR-2894?page=comments#action_38806 ] 
            
Martin Cooper commented on STR-2894:
------------------------------------

Not quite, Paul. I could define a "base" form bean that has neither, such that a later 'extends' form bean adds the 'type' attribute. The rule would have to be that every concrete form bean - those actually referenced / used - ultimately has a type attribute provided somewhere in its definition hierarchy.

> The <form-bean> type attribute should be optional
> -------------------------------------------------
>
>                 Key: STR-2894
>                 URL: http://issues.apache.org/struts/browse/STR-2894
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: Nightly Build
>            Reporter: Wendy Smoak
>             Fix For: 1.3.6
>
>         Attachments: my-webapp.zip
>
>
> According to the 1.3 DTD, the 'type' attribute of <form-bean> is optional.
>    http://struts.apache.org/dtds/struts-config/1_3/
> However, omitting it from the form bean definition in struts-config.xml results in an error.
>         <form-bean
>             name="inputForm" />
> SEVERE: Servlet /my-webapp threw load() exception
> javax.servlet.UnavailableException: Missing type value for inputForm form bean
> 	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
> 	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
> 	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
> 	at javax.servlet.GenericServlet.init(GenericServlet.java:211)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (STR-2894) The type attribute should be optional

Posted by "Martin Cooper (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/STR-2894?page=comments#action_38803 ] 
            
Martin Cooper commented on STR-2894:
------------------------------------

The type attribute on <form-bean> was made optional with Hubert's 'extends' changes. It's not entirely optional insofar as every actual form bean has to have the type attribute specified. However, it's optional insofar  you can omit it from any given level in the extension hierarchy, so long as it exists at least once in that hierarchy. So I believe this bug report is invalid, but someone please correct me if I'm wrong.

> The <form-bean> type attribute should be optional
> -------------------------------------------------
>
>                 Key: STR-2894
>                 URL: http://issues.apache.org/struts/browse/STR-2894
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: Nightly Build
>            Reporter: Wendy Smoak
>             Fix For: 1.3.6
>
>         Attachments: my-webapp.zip
>
>
> According to the 1.3 DTD, the 'type' attribute of <form-bean> is optional.
>    http://struts.apache.org/dtds/struts-config/1_3/
> However, omitting it from the form bean definition in struts-config.xml results in an error.
>         <form-bean
>             name="inputForm" />
> SEVERE: Servlet /my-webapp threw load() exception
> javax.servlet.UnavailableException: Missing type value for inputForm form bean
> 	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
> 	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
> 	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
> 	at javax.servlet.GenericServlet.init(GenericServlet.java:211)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (STR-2894) The type attribute should be optional

Posted by "Wendy Smoak (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/STR-2894?page=all ]

Wendy Smoak updated STR-2894:
-----------------------------

    Attachment: my-webapp.zip

Attached a sample Maven 2 project based on the struts-blank archetype which demonstrates the problem.

To reproduce:
 1. extract the zip file to a temporary location, 
 2. modify pom.xml <container>/<home> with the path to a local install of Tomcat 5x
 3. mvn package cargo:start
 4. CTRL-C to stop the container
 5. look at target/tomcat5x.out for the stack trace

> The <form-bean> type attribute should be optional
> -------------------------------------------------
>
>          Key: STR-2894
>          URL: http://issues.apache.org/struts/browse/STR-2894
>      Project: Struts Action 1
>         Type: Bug

>   Components: Core
>     Versions: Nightly Build
>     Reporter: Wendy Smoak
>      Fix For: 1.3.5
>  Attachments: my-webapp.zip
>
> According to the 1.3 DTD, the 'type' attribute of <form-bean> is optional.
>    http://struts.apache.org/dtds/struts-config/1_3/
> However, omitting it from the form bean definition in struts-config.xml results in an error.
>         <form-bean
>             name="inputForm" />
> SEVERE: Servlet /my-webapp threw load() exception
> javax.servlet.UnavailableException: Missing type value for inputForm form bean
> 	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
> 	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
> 	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
> 	at javax.servlet.GenericServlet.init(GenericServlet.java:211)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (STR-2894) The type attribute should be optional

Posted by "Wendy Smoak (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/STR-2894?page=comments#action_38038 ] 
            
Wendy Smoak commented on STR-2894:
----------------------------------

TODO:  Update the sample app.  It no longer builds.  It was done when the groupId was org.apache.struts.action, and those artifacts have been removed from the snapshot repo.

> The <form-bean> type attribute should be optional
> -------------------------------------------------
>
>                 Key: STR-2894
>                 URL: http://issues.apache.org/struts/browse/STR-2894
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: Nightly Build
>            Reporter: Wendy Smoak
>             Fix For: 1.3.6
>
>         Attachments: my-webapp.zip
>
>
> According to the 1.3 DTD, the 'type' attribute of <form-bean> is optional.
>    http://struts.apache.org/dtds/struts-config/1_3/
> However, omitting it from the form bean definition in struts-config.xml results in an error.
>         <form-bean
>             name="inputForm" />
> SEVERE: Servlet /my-webapp threw load() exception
> javax.servlet.UnavailableException: Missing type value for inputForm form bean
> 	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
> 	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
> 	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
> 	at javax.servlet.GenericServlet.init(GenericServlet.java:211)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (STR-2894) The type attribute should be optional

Posted by "Wendy Smoak (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/STR-2894?page=all ]

Wendy Smoak resolved STR-2894.
------------------------------

    Resolution: Not A Problem

Resolving as invalid.  Thanks to Martin for the explanation.

> The <form-bean> type attribute should be optional
> -------------------------------------------------
>
>                 Key: STR-2894
>                 URL: http://issues.apache.org/struts/browse/STR-2894
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: Nightly Build
>            Reporter: Wendy Smoak
>             Fix For: 1.3.6
>
>         Attachments: my-webapp.zip
>
>
> According to the 1.3 DTD, the 'type' attribute of <form-bean> is optional.
>    http://struts.apache.org/dtds/struts-config/1_3/
> However, omitting it from the form bean definition in struts-config.xml results in an error.
>         <form-bean
>             name="inputForm" />
> SEVERE: Servlet /my-webapp threw load() exception
> javax.servlet.UnavailableException: Missing type value for inputForm form bean
> 	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
> 	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
> 	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
> 	at javax.servlet.GenericServlet.init(GenericServlet.java:211)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (STR-2894) The type attribute should be optional

Posted by "Wendy Smoak (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/STR-2894?page=comments#action_38802 ] 
            
Wendy Smoak commented on STR-2894:
----------------------------------

It's been so long that I don't really remember.  

The main issue is that the documentation doesn't match the actual behavior.  The DTD says the type attribute is optional, but you get an error if you leave it out.

> The <form-bean> type attribute should be optional
> -------------------------------------------------
>
>                 Key: STR-2894
>                 URL: http://issues.apache.org/struts/browse/STR-2894
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: Nightly Build
>            Reporter: Wendy Smoak
>             Fix For: 1.3.6
>
>         Attachments: my-webapp.zip
>
>
> According to the 1.3 DTD, the 'type' attribute of <form-bean> is optional.
>    http://struts.apache.org/dtds/struts-config/1_3/
> However, omitting it from the form bean definition in struts-config.xml results in an error.
>         <form-bean
>             name="inputForm" />
> SEVERE: Servlet /my-webapp threw load() exception
> javax.servlet.UnavailableException: Missing type value for inputForm form bean
> 	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
> 	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
> 	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
> 	at javax.servlet.GenericServlet.init(GenericServlet.java:211)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (STR-2894) The type attribute should be optional

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/STR-2894?page=all ]

Ted Husted updated STR-2894:
----------------------------

    Fix Version: 1.x Next
                     (was: 1.3.5)

> The <form-bean> type attribute should be optional
> -------------------------------------------------
>
>          Key: STR-2894
>          URL: http://issues.apache.org/struts/browse/STR-2894
>      Project: Struts 1
>         Type: Bug

>   Components: Core
>     Versions: Nightly Build
>     Reporter: Wendy Smoak
>      Fix For: 1.x Next
>  Attachments: my-webapp.zip
>
> According to the 1.3 DTD, the 'type' attribute of <form-bean> is optional.
>    http://struts.apache.org/dtds/struts-config/1_3/
> However, omitting it from the form bean definition in struts-config.xml results in an error.
>         <form-bean
>             name="inputForm" />
> SEVERE: Servlet /my-webapp threw load() exception
> javax.servlet.UnavailableException: Missing type value for inputForm form bean
> 	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
> 	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
> 	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
> 	at javax.servlet.GenericServlet.init(GenericServlet.java:211)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (STR-2894) The type attribute should be optional

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/STR-2894?page=comments#action_38786 ] 
            
Paul Benedict commented on STR-2894:
------------------------------------

Wendy,

I see the offending line in the ActionServlet on line 927 (and again on 939):

            // Verify that required fields are all present for the form config
            if (formBean.getType() == null) {
                handleValueRequiredException("type", formBean.getName(),
                    "form bean");
            }

Are you asking to delete that line?

Since the type is optional. What is the type when it is not explicilty stated?

> The <form-bean> type attribute should be optional
> -------------------------------------------------
>
>                 Key: STR-2894
>                 URL: http://issues.apache.org/struts/browse/STR-2894
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: Nightly Build
>            Reporter: Wendy Smoak
>             Fix For: 1.3.6
>
>         Attachments: my-webapp.zip
>
>
> According to the 1.3 DTD, the 'type' attribute of <form-bean> is optional.
>    http://struts.apache.org/dtds/struts-config/1_3/
> However, omitting it from the form bean definition in struts-config.xml results in an error.
>         <form-bean
>             name="inputForm" />
> SEVERE: Servlet /my-webapp threw load() exception
> javax.servlet.UnavailableException: Missing type value for inputForm form bean
> 	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
> 	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
> 	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
> 	at javax.servlet.GenericServlet.init(GenericServlet.java:211)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (STR-2894) The type attribute should be optional

Posted by "Wendy Smoak (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/STR-2894?page=all ]

Wendy Smoak updated STR-2894:
-----------------------------

        Summary: The <form-bean> type attribute should be optional  (was: The <form-bean> type element should be optional)
    Description: 
According to the 1.3 DTD, the 'type' attribute of <form-bean> is optional.
   http://struts.apache.org/dtds/struts-config/1_3/

However, omitting it from the form bean definition in struts-config.xml results in an error.

        <form-bean
            name="inputForm" />

SEVERE: Servlet /my-webapp threw load() exception
javax.servlet.UnavailableException: Missing type value for inputForm form bean
	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
	at javax.servlet.GenericServlet.init(GenericServlet.java:211)



  was:
According to the 1.3 DTD, the 'type' element of <form-bean> is optional.
   http://struts.apache.org/dtds/struts-config/1_3/

However, omitting it from the form bean definition in struts-config.xml results in an error.

        <form-bean
            name="inputForm" />

SEVERE: Servlet /my-webapp threw load() exception
javax.servlet.UnavailableException: Missing type value for inputForm form bean
	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
	at javax.servlet.GenericServlet.init(GenericServlet.java:211)




s/element/attribute

> The <form-bean> type attribute should be optional
> -------------------------------------------------
>
>          Key: STR-2894
>          URL: http://issues.apache.org/struts/browse/STR-2894
>      Project: Struts Action 1
>         Type: Bug

>   Components: Core
>     Versions: Nightly Build
>     Reporter: Wendy Smoak
>      Fix For: 1.3.5

>
> According to the 1.3 DTD, the 'type' attribute of <form-bean> is optional.
>    http://struts.apache.org/dtds/struts-config/1_3/
> However, omitting it from the form bean definition in struts-config.xml results in an error.
>         <form-bean
>             name="inputForm" />
> SEVERE: Servlet /my-webapp threw load() exception
> javax.servlet.UnavailableException: Missing type value for inputForm form bean
> 	at org.apache.struts.action.ActionServlet.handleValueRequiredException(ActionServlet.java:830)
> 	at org.apache.struts.action.ActionServlet.initModuleFormBeans(ActionServlet.java:926)
> 	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:357)
> 	at javax.servlet.GenericServlet.init(GenericServlet.java:211)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira