-
1. Re: Developing a simple Add-on
gastaldi Nov 6, 2016 2:48 PM (in response to mylos78)Hi Mylos,
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.
Best Regards,
George Gastaldi
-
2. Re: Developing a simple Add-on
mylos78 Nov 7, 2016 6:06 AM (in response to gastaldi)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!
-
3. Re: Developing a simple Add-on
gastaldi Nov 7, 2016 7:35 AM (in response to mylos78)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.
-
4. Re: Developing a simple Add-on
mylos78 Nov 7, 2016 9:16 AM (in response to gastaldi)awesome, thanks!