struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wolfgang12...@yahoo.co.jp
Subject Adding my own attribute to a forward tag in the struts-config.xml
Date Tue, 13 Apr 2004 15:15:05 GMT
Hi gurus.

I added my own attribute to forward tags and modified some 
struts source codes.
The forward tag is like below ( the attribute "user" is my own
attribute)
<action ...>
   <forward name="success" path="/test.jsp" user="ROOT" />
</action>

when I start tomcat, it works fine as I expect with the modified struts 
source code.
But in the log(log4j) file, I get the following ERRORs. 
org.xml.sax.SAXParseException: Attribute "user" must be declared for element type "forward".
Although the modified struts works as I expect, I want the log go away.

I thought the reason why the error was caused is that the struts-config file and DTD(struts-config_1_1.dtd)
 don't match.
so I extracted struts-config_1_1.dtd from the struts.jar and modified it to allow user attribute

in a forward tag and saved under WEB-INF directory. and I changed struts-config's DOCTYPE
to the 
following 
<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
          "WEB-INF/struts-config_1_1.dtd">

but still getting the same errors. 

I don't know why but I think that the struts-config_1_1.dtd might not be read or found by
struts.

Where should I save the new struts-config_1_1.dtd ? Should I put the new dtd file back to
the 
struts.jar file ?? I even tried to save the DTD file under WEB-INF/classes/org/apache/struts/resources

directory because the DTD was found under the directory in the struts.jar file.


Thanks.

wolfgang




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


Mime
View raw message