File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts 2's struts.xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 Watch "Struts 2 New topic
Author

Struts 2's struts.xml file

Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

Hi folks,

In Struts 2, is it required putting the struts.xml file under source directory (src)? How to put the file under WEB-INF directory?
What's the point of difference between two locations, source directory and WEB-INF?

Thanks.


PM Me If You Want to get Urgent Help on Java Programming
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

hi Nam,

In Struts, struts.xml file should reside on the classpath of the webapp (generally /WEB-INF/classes).
If you are using eclipse and putting struts.xml file in the src folder then at deployement it will
go into the web-inf/classes folder.

It is advisable to put the xml file in the web-inf/classes and its standard.Apart from
that if the file is in the classpath struts will find the config file.

this will give you some idea : Configuration file

Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

Thanks jatan, I got the idea
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2's struts.xml file
 
Similar Threads
Struts 2 doesn't see the Action mapping
There is no Action mapped for namespace / and action name . - [unknown location]
No configuration found for the specified action error in netbean
Struts can't work
How to use, struts 1-- struts-config.xml and struts 2 -- struts.xml together?