Check this, it can help you

http://struts.apache.org/2.1.8/docs/strutsxml-examples.html



Satheesh Kannan A B wrote on 2.9.2010 16:50:
Hi,

I think it's a existing and resolved issues in struts 2.1.8, since I have 
googled and searched here but am not able to resolve this.

Currently am configuring interceptors in my struts 2.1.8 application using 
websphere 6.0.1.
What I have coded is right I think so  and u all please verify it and suggest 
me the thing to resolve this.
In the below if I remove the interceptors and global exceptions mapping my 
application working fine.
Am using struts 2.1.8, jdk 6, websphere 6.0.1, xercesImpl-2.8.1

The exception am getting is   give below .........................
[9/2/10 18:41:56:113 IST] 0000002c SystemOut     O 2010-09-02 18:41:56,082 [WebContainer : 0] ERROR 
com.opensymphony.xwork2.util.DomHelper - 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*)".
 at (null:103:12)
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*)".
       at 
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 
Source)
       at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
       at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
       at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
       at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown 
Source)
       at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
       at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
       at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
 Source)
       at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
       at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
       at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:113)
etc..

and my code wat I have implemented given below ........

<?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.objectFactory" value="spring" />
       <constant name="struts.devMode" value="false" />
       <package name="KEW" extends="struts-default">



             <global-results>
             <result name="ldaperror">/search/ldaperror.jsp</result>
         </global-results>

              <interceptors>
                         <interceptor name="authenticationInterceptor" 
class="com.aegon.capitalexpiry.web.util.AuthenticationInterceptor"/>
                         <interceptor name="execAndWait" 
class="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"/>
                         <interceptor name="fileUpload" 
class="org.apache.struts2.interceptor.FileUploadInterceptor"/>
                         <interceptor name="i18n" 
class="com.opensymphony.xwork2.interceptor.I18nInterceptor"/>
                         <interceptor name="logger" 
class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>
                         <interceptor name="modelDriven" 
class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
                         <interceptor name="scope" 
class="org.apache.struts2.interceptor.ScopeInterceptor"/>
                         <interceptor name="params" 
class="com.opensymphony.xwork2.interceptor.ParametersInterceptor"/>
                         <interceptor name="prepare" 
class="com.opensymphony.xwork2.interceptor.PrepareInterceptor"/>
                         <interceptor name="static-params" 
class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
                         <interceptor name="servlet-config" 
class="com.opensymphony.xwork2.interceptor.ServletConfigInterceptor"/>
                         <interceptor name="sessionAutowiring" 
class="com.opensymphony.xwork2.interceptor.SessionContextAutowiringInterceptor"/>
                         <interceptor name="timer" 
class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>
                         <interceptor name="token" 
class="com.opensymphony.xwork2.interceptor.TokenInterceptor"/>
                         <interceptor name="token-session" 
class="com.opensymphony.xwork2.interceptor.TokenSessionStoreInterceptor" />
                         <interceptor name="validation" 
class="com.opensymphony.xwork2.interceptor.ValidationInterceptor " />
                         <interceptor name="workflow" 
class="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor"/>

                      <interceptor-stack name="defaultStack">
                               <interceptor-ref 
name="authenticationInterceptor"/>
                                     <interceptor-ref name="fileUpload"/>
                                     <interceptor-ref name="i18n"/>
                                     <interceptor-ref name="logger"/>
                                     <interceptor-ref name="modelDriven"/>
                                     <interceptor-ref name="params"/>
                                     <interceptor-ref name="prepare"/>
                                     <interceptor-ref name="servlet-config"/>
                                     <interceptor-ref name="sessionAutowiring"/>
                                     <interceptor-ref name="timer"/>
                                     <interceptor-ref name="token"/>
                                     <interceptor-ref name="token-session"/>
                                     <interceptor-ref name="validation"/>
                                     <interceptor-ref name="workflow"/>
                                     <interceptor-ref name="static-params"/>
                  </interceptor-stack>
          </interceptors>

             <default-interceptor-ref name="authenticationInterceptor"/>

<default-interceptor-ref name="defaultLoginStack" />

             <default-action-ref name="start" />

             <global-results>
                   <result name="sessionerror">/html/SessionError.html</result>
             </global-results>

             <result name="sessionerror">/html/SessionError.html</result>

             <global-exception-mappings>
             <exception-mapping exception="java.lang.Exception" 
result="sessionerror"/>
             </global-exception-mappings>

                   <action name="start" class="startAction">
                   <result name="success">index_kew.jsp</result>
                   </action>

       </package>
</struts>

Thanks  and Regards,

Satheesh Kannan A B


DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------

Reply via email to