• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

spliting struts-config.xml error

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic