File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 9463

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
jQuery in Action, 3rd edition