Struts2: Getting error with struts.xml

1.6k views Asked by At

I am using Struts2 When i am writting a program, in struts.xml file getting warning "the file cannot be validated as there was a connection problem " at the line:-" !DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd" "

<?xml version="1.0" encoding="UTF-8" ?> 
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "struts.apache.org/dtds/struts-2.0.dtd">; 
<struts> 
  <constant name="struts.enable.DynamicMethodInvocation" value="false" /> 
  <constant name="struts.devMode" value="true" /> 
  <package name="default" namespace="/" extends="struts-default"> 
  <action name="testAction" class="javaguys.tutorials.actions.TestAction"> 
     <result name="success">/Home.jsp</result> 
  </action> 
  </package> 
</struts>
1

There are 1 answers

1
Ashish On BEST ANSWER

Remove the ';' from the end of your DOCTYPE this should be at the root of your struts config.

<?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">