Yes, you can use the ServletFacet's methods or call getConfig() from the same facet to retrieve a WebAppDescriptor instance.
Here is a command example that adds security constraints to a web.xml: core/AddSecurityConstraintCommand.java at master · forge/core · GitHub
Let me know if you need anything else.
Thank you very much for the reply George.
I'll try it right away.
May I ask one more thing ? is there any Forge Helper class which gives me the physical path where the WebContent is so that I can modify XML files manually ? this would be helpful in case I want to modify also non-standard XML project files (jboss-deployment-structure.xml) or even my application XML files.
Thanks a lot!
Yes, the same ServletFacet has a getConfigFile() method that returns a FileResource (you can call getContents/setContents there) or if you need the java.io.File you can call the getUnderlyingResourceObject() in the FileResource object.