Ankit Garg wrote:a) the default behavior is to look for struts.xml file at the root of the classes directory. Even I think in Struts 1, if you don't give any details in web.xml, it automatically looks for struts-config.xml. You can override this default behavior through the web.xml file.
In Struts1, if we look at the code for ActionServlet, then you can see that by default the value for "
config" = "/WEB-INF/struts-config.xml" , so thats the reason even if we dont specify the path for struts-config.xmlin web.xml, it takes that default value.. Assume if we change the name of struts xml file or if we change the path for it, then we
MUST definitely has to specify that config value in web.xml, otherwise it cannot see...
But Im not understandng exactly in case of Struts2.. How does it find "struts.xml" file and how does it look for execute and populate methods automatically..
I will be very much appreciated if anyone would give an exact answer for my doubt... waiting for..
Harishwar