This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

spliting struts-config.xml error

 
Bruno Frascino
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bruno Frascino
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic