aspose file tools*
The moose likes Struts and the fly likes What Is Wrong With My web.xml File (Struts) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "What Is Wrong With My web.xml File (Struts)" Watch "What Is Wrong With My web.xml File (Struts)" New topic
Author

What Is Wrong With My web.xml File (Struts)

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
My Struts application worked well until I added security in the web.xml file. I got the error message shown below and I cannot spot any mistake with my eyes:

2003-10-08 23:33:25 Exception initializing TldLocationsCache: XML parsing error on file /WEB-INF/web.xml: (line 137, col 19): The content of element type "security-role" must match "(description?,role-name)".

and my web.xml file is:
Anselm Paulinus
Ranch Hand

Joined: Sep 05, 2003
Posts: 389
JiaPei Jen:
The error was pinpointed for you it states that
The content of element type "security-role" must match "(description?,role-name)".
What you have here does not match that; does it?
<security-role>
<description>Registered Members</description>
<role-name>administrator</role-name>
<role-name>advisor</role-name>
<role-name>editor</role-name>
<role-name>contributor</role-name>
</security-role> // line 137 is here
Try this and let me know if it works
<security-role>
<description>Registered Members</description>
<role-name>administrator</role-name>
</security-role>
<security-role>
<description>Registered Members</description>
<role-name>adviser</role-name>
</security-role>
<security-role>
<description>Registered Members</description>
<role-name>editor</role-name>
</security-role>
<security-role>
<description>Registered Members</description>
<role-name>contributor</role-name>
</security-role>
Anselm Paulinus.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What Is Wrong With My web.xml File (Struts)