You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by wo...@yahoo.co.jp on 2004/04/13 17:15:05 UTC

Adding my own attribute to a forward tag in the struts-config.xml

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


Re: Adding my own attribute to a forward tag in the struts-config.xml

Posted by Stjepan Brbot <st...@ht.hr>.
Yes, why not, DTD can locally be e.g. in your WEB-INF directory but point your URI in struts-config.xml (in DOCTYPE) to that location.

SB

<wo...@yahoo.co.jp> wrote in message news:20040414142354.7105.WOLFGANG127US@yahoo.co.jp...
> Hi gurus, 
> 
> I solved my problem.
> I put the modified struts-config_1_1.dtd back into the struts.jar, 
> then struts doesn't throw exceptions anymore. 
> 
> But is there a way to take the DTD file out of the struts.jar ???
> 
> 
> Thank you.


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


Re: Adding my own attribute to a forward tag in the struts-config.xml

Posted by wo...@yahoo.co.jp.
Hi gurus, 

I solved my problem.
I put the modified struts-config_1_1.dtd back into the struts.jar, 
then struts doesn't throw exceptions anymore. 

But is there a way to take the DTD file out of the struts.jar ???


Thank you.




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