THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
The best option is to remove the Struts REST plugin when not used. Alternatively you can only upgrade the plugin by dropping in all the required JARs (plugin plus all dependencies). Another options is to limit th plugin to server normal pages and JSONs only:
Disable handling XML pages and requests to such pages
Code Block xml xml <constant name="struts.action.extension" value="xhtml,,json" />
Override
getContentType
inXStreamHandler
Code Block language java public class MyXStreamHandler extends XStreamHandler { public String getContentType() { return "not-exiting-content-type-@;/&%$#@"; } }
Register the handler by overriding the one provided by the framework in your
struts.xml
Code Block xml xml <bean type="org.apache.struts2.rest.handler.ContentTypeHandler" name="myXStreamHandmer" class="com.company.MyXStreamHandler"/> <constant name="struts.rest.handlerOverride.xml" value="myXStreamHandler"/>