aspose file tools*
The moose likes Struts and the fly likes spliting struts-config.xml error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "spliting struts-config.xml error" Watch "spliting struts-config.xml error" New topic
Author

spliting struts-config.xml error

Bruno Frascino
Ranch Hand

Joined: Jul 22, 2003
Posts: 55
Hi everybody,

I'm trying to separate my struts-config.xml in more files, but I got an error:

19:32:54,546 ERROR [ActionServlet] Parsing error processing resource path /WEB-INF/struts-config.xml,
/WEB-INF/struts-estatistica.xml
java.lang.NullPointerException
at org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:857)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)


Here is my web.xml code where I define my other .xml(struts-estatistica.xml):



Here is my struts-estatistica.xml:


Anybody can help me?! What Am I forgetting to do?
Does have anything to be done at the original struts-config.xml??

Thanks in advance!


--BJCK--
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
You cannot define two different configuration files for a single module. If you want to define more than one configuration file, you must also define more than one module. My suggestion would be to define a separate module named "estatistica". The entries in your web.xml file would look like this:


Then, if you wanted to call an action defined in struts-estatistica.xml, you would have to prepend "/estatistica" to the action call, for example:

www.myserver.com/myApp/estatistica/cadastramento/ListarEstatisticas.do


Merrill
Consultant, Sima Solutions
Bruno Frascino
Ranch Hand

Joined: Jul 22, 2003
Posts: 55
Thanks Merrill,

Now it is working... but I'm confused, cause I've got an example of web.xml like this:



and it's working properly... but when I tried to do it, I failed.
That's ok, for now, most important thing is make this application work, but when get spare time I'll check this issue again.

Thanks mate!!
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I stand corrected. Upon reviewing the documentation, it is supposed to be possible to specify more than one config file for a single module.

I don't know why it's not working in your particulat case, though.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: spliting struts-config.xml error