This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Annotations vs XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Annotations vs XML" Watch "Annotations vs XML" New topic

Annotations vs XML

Priya Bindra
Ranch Hand

Joined: Sep 22, 2009
Posts: 51
I am just learning Struts2 and am wondering what is the industry practice? To use Annotations or XML config?
Ankit Garg

Joined: Aug 03, 2008
Posts: 9327

These types of questions have been asked before like here...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Priya Bindra
Ranch Hand

Joined: Sep 22, 2009
Posts: 51
The thread wasnt much insightful. I dont want to re-invent the wheel by trying all the available options in a framework. I am rather looking for industry standards, as created by experienced pros around in this forum!
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
@Priya Bindra

It does not seem like your question is specifically related to the Struts2 framework. If it is, then are you asking if using Struts2 annotations are preferred over specifiying configuration data in a struts-config.xml file?

Moreover, do Struts2 annotations even exist?
David Newton

Joined: Sep 29, 2008
Posts: 12617

There *is* no "industry standard"--it just depends on preferences and requirements.
I agree. Here's the link:
subject: Annotations vs XML