A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Frameworks
»
Struts
Author
Issue configuring global results
Palak Shah
Greenhorn
Joined: Jan 21, 2005
Posts: 18
posted
Sep 10, 2010 04:50:56
0
I am trying to configure global results in
struts
but getting exception in logs when starting
tomcat
:
Caused by: org.xml.sax.SAXParseException: The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)".
My struts.xml is as follows:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <constant name="struts.devMode" value="false" /> <constant name="struts.action.extension" value="share" /> <constant name="struts.custom.i18n.resources" value="com.messages.messages"/> <constant name="struts.ui.theme" value="simple"/> <package name="default" namespace="/" extends="struts-default"> <result-types> <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" /> </result-types> <global-results> <result name="login" type="tiles">login.page</result> </global-results> <default-action-ref name="index" /> <action name="index"> <result type="redirectAction"> <param name="actionName">login</param> <param name="namespace">/</param> </result> </action> <action name="login" class="com.login.action.LoginAction"> <result type="tiles">login.page</result> </action>
Can some one please guide whats wrong with this code? Even <result name="login">login.jsp</result> does not work. I see the same exception.
Palak Shah,<br />SCJP (85%), SCWCD (84%), SCBCD (95%).
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
I like...
posted
Sep 10, 2010 05:47:16
0
The error message is pretty clear, isn't it? The order of the elements in the XML file must match the order as defined in the DTD--yours don't.
Darshan Shroff
Greenhorn
Joined: Nov 25, 2009
Posts: 12
I like...
posted
Mar 08, 2011 23:39:21
0
Was just wondering if you could provide global results as actions
<global-results> <result name="home">/index.jsp</result> <result name="xyz">/xyz.action</result> </global-results>
Regards,
Darshan Shroff
shroffdarshan@gmail.com
http://www.linkedin.com/in/darshanshroff
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Issue configuring global results
Similar Threads
struts2: howto correctly deligate actions on the struts.xml's include files
struts2 + interceptor
validation problem.
http 404 error in uploading the file
It is possible to exclude interceptor for given action?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter