You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by jiangshachina <ji...@gmail.com> on 2007/04/29 04:27:36 UTC

+ , conflict?

Hi guys,
I'm new to Struts.
I'm using Struts 1.3.8 + JBoss 4.0.5.GA + JDK 1.5.0 + Windows XP.

I have a struts-config file as show as below,
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
          "http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>
	<global-exceptions>
		<exception key="login.failure" type="exception.LoginException"
			path="/failure.jsp">
		</exception>
	</global-exceptions>

	<form-beans>
		<form-bean name="userForm" type="form.UserForm" />
	</form-beans>
</struts-config>
When I started the JBoss, an org.xml.sax.SAXParseException was thrown, the
exception said: 
The content of element type "struts-config" must match 
"(display-name?,description?,form-beans?,global-exceptions?,global-forwards?,
action-mappings?,controller?,message-resources*,plug-in*)".
If I deleted element global-exceptions or form-beans from the struts-config
file, that would works well.
It seems that the two elements conflict with each other!?
I'm puzzled by the matter?

a cup of Java, cheers!
Sha Jiang

-- 
View this message in context: http://www.nabble.com/%3Cglobal-exceptions%3E-%2B-%3Cform-beans%3E%2C-conflict--tf3664252.html#a10238483
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: + , conflict?

Posted by Laurie Harper <la...@holoweb.net>.
jiangshachina wrote:
> Hi guys,
> I'm new to Struts.
> I'm using Struts 1.3.8 + JBoss 4.0.5.GA + JDK 1.5.0 + Windows XP.
> 
> I have a struts-config file as show as below,
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE struts-config PUBLIC
>           "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
>           "http://struts.apache.org/dtds/struts-config_1_3.dtd">
> <struts-config>
> 	<global-exceptions>
> 		<exception key="login.failure" type="exception.LoginException"
> 			path="/failure.jsp">
> 		</exception>
> 	</global-exceptions>
> 
> 	<form-beans>
> 		<form-bean name="userForm" type="form.UserForm" />
> 	</form-beans>
> </struts-config>
> When I started the JBoss, an org.xml.sax.SAXParseException was thrown, the
> exception said: 
> The content of element type "struts-config" must match 
> "(display-name?,description?,form-beans?,global-exceptions?,global-forwards?,
> action-mappings?,controller?,message-resources*,plug-in*)".
> If I deleted element global-exceptions or form-beans from the struts-config
> file, that would works well.
> It seems that the two elements conflict with each other!?
> I'm puzzled by the matter?

They don't conflict, but order matters. The global-exceptions element 
needs to come after the form-beans element.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: + , conflict?

Posted by Paul Benedict <pb...@apache.org>.
The DTD specifies the order of tags. Your error message is telling you what
order they should appear in.

On 4/28/07, jiangshachina <ji...@gmail.com> wrote:
>
>
> Hello,
> I think I get the reason -- sequence.
> <form-beans> must be prior to <global-exceptions>, like <servlet> and
> <servlet-mapping>.
>
> a cup of Java, cheers!
> Sha Jiang
>
>
> jiangshachina wrote:
> >
> > Hi guys,
> > I'm new to Struts.
> > I'm using Struts 1.3.8 + JBoss 4.0.5.GA + JDK 1.5.0 + Windows XP.
> >
> > I have a struts-config file as show as below,
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <!DOCTYPE struts-config PUBLIC
> >           "-//Apache Software Foundation//DTD Struts Configuration
> > 1.3//EN"
> >           "http://struts.apache.org/dtds/struts-config_1_3.dtd">
> > <struts-config>
> >       <global-exceptions>
> >               <exception key="login.failure" type="
> exception.LoginException"
> >                       path="/failure.jsp">
> >               </exception>
> >       </global-exceptions>
> >
> >       <form-beans>
> >               <form-bean name="userForm" type="form.UserForm" />
> >       </form-beans>
> > </struts-config>
> > When I started the JBoss, an org.xml.sax.SAXParseException was thrown,
> the
> > exception said:
> > The content of element type "struts-config" must match
> >
> "(display-name?,description?,form-beans?,global-exceptions?,global-forwards?,
> > action-mappings?,controller?,message-resources*,plug-in*)".
> > If I deleted element global-exceptions or form-beans from the
> > struts-config file, that would works well.
> > It seems that the two elements conflict with each other!?
> > I'm puzzled by the matter?
> >
> > a cup of Java, cheers!
> > Sha Jiang
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/%3Cglobal-exceptions%3E-%2B-%3Cform-beans%3E%2C-conflict--tf3664252.html#a10238633
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: + , conflict?

Posted by jiangshachina <ji...@gmail.com>.
Hello,
I think I get the reason -- sequence.
<form-beans> must be prior to <global-exceptions>, like <servlet> and
<servlet-mapping>.

a cup of Java, cheers!
Sha Jiang


jiangshachina wrote:
> 
> Hi guys,
> I'm new to Struts.
> I'm using Struts 1.3.8 + JBoss 4.0.5.GA + JDK 1.5.0 + Windows XP.
> 
> I have a struts-config file as show as below,
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE struts-config PUBLIC
>           "-//Apache Software Foundation//DTD Struts Configuration
> 1.3//EN"
>           "http://struts.apache.org/dtds/struts-config_1_3.dtd">
> <struts-config>
> 	<global-exceptions>
> 		<exception key="login.failure" type="exception.LoginException"
> 			path="/failure.jsp">
> 		</exception>
> 	</global-exceptions>
> 
> 	<form-beans>
> 		<form-bean name="userForm" type="form.UserForm" />
> 	</form-beans>
> </struts-config>
> When I started the JBoss, an org.xml.sax.SAXParseException was thrown, the
> exception said: 
> The content of element type "struts-config" must match 
> "(display-name?,description?,form-beans?,global-exceptions?,global-forwards?,
> action-mappings?,controller?,message-resources*,plug-in*)".
> If I deleted element global-exceptions or form-beans from the
> struts-config file, that would works well.
> It seems that the two elements conflict with each other!?
> I'm puzzled by the matter?
> 
> a cup of Java, cheers!
> Sha Jiang
> 
> 

-- 
View this message in context: http://www.nabble.com/%3Cglobal-exceptions%3E-%2B-%3Cform-beans%3E%2C-conflict--tf3664252.html#a10238633
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org