Where do we need to put the struts configuration files in a web application? And, what is the differences between struts.xml and struts-config.xml? For Struts 2 applications, which one we should use?
Thanks.
As indicated in Vinodh's link, struts.xml is the default name of the configuration file in Struts2. struts-config.xml is a Struts1 configuration file, and should not be used in Struts2.
Your struts.xml file should be at the root of your class path so that once your web app is built, it will be located in WEB-INF/classes. You can accomplish this by placing it in your source folder. If you use the Maven 2 Standard Directory Layout, then you would place it in src/main/resources.
Related
Can anyone please post a link of tutorial for setting JNDI configurations without xml files for MySQL???I don't want configurations in xml files. But instead I want to use in Java files?
I have a domain name as addon on. It is called www.myapp.cöm and because it ais an addon domain it is located at çtp://myrealdomain.cöm/myapp/
How I'll put those ZF2 files? I don't want to put all of them under çtp://myrealdomain.cöm/ folder.
you had to place all you application public files in the myapp folder and can place all other files (modules) on different location and link it with the exact path in configuration file declaration for modules).
for ZEND library if your server configuration allow variable in .htaccess you can set ZF2=path to zend library and you can place the lib files any ware accessible in your host
Hi I had posted an answer for setting up zf2 application in shared hosting, hope this may help follow the link below
ZF2 in shared hosting environment
Quiet new to Sitecore hence this basic question to start with...
I've got a MVC Sitecore project up and running. However, I would like to include some simple configuration values on AppSetting of web.config file. From what I read it's not good practice to mess with Sitecore config file.
Could any one please suggest the best practice to add key value on appsettings?
Should it go under app_config?
If yes, then which folder and what naming convention should I use?
And how does Sitecore reads this file on runtime?
In my current project I've removed all app settings from the web.config and included them like so:
<appSettings configSource=".\App_Config\AppSettings.config" />
I then use SlowCheetah (Which can be downloaded here) to change the settings in the AppSettings.config file if I have environment specific settings.
All changes to the sitecore section of the web.config I add through the include files. You can read more on include files in this post by John West
As a trainee I have been working on a project, a java web application. Till now i have used javascript and jquery for validations but now I also know struts 1.x and struts 2 and want to apply that instead of javascript... So I have to copy all the files from my struts app. into my project folder in net beans ... I mean all the specific file like the one's in web-inf i have to copy them exactly ?
Or there's another way of doing it in net beans like merge projects or something ?
I need to know...where we have to place the struts.xml file...Is there any possibilities of changing the location of struts.xml file
By default, it is looked for in the classpath's root level.
Place yours directly under WEB-INF/classes (or to a place where someone/something grabs it and puts it there, typically the root of a source folder, such as src/main/resources if you are using Maven).
Another option would be to have it packaged at the root level of a JAR in your WEB-INF/lib. A struts.xml in WEB-INF/classes gets precedence though. I have yet to come across an example where this option would make sense though.
If you have a simple dynamic web project, I recommend putting it under the src folder. This is because it simply works. You can create a classes folder underneath the WEB-INF folder and move it there as well.