java - Cross-Domain POST in JBoss AS 7.1.1 -


i have web application in cloud server. 1 of controllers of web application externalizes urls accessed through mobile app (using javascript; i´m using titanium develop android , ios). can access methods without problem , obtain desire, when call post methods send information processed, bad server - http error. protect urls use basic authentication configured in application , in jboss (standalone.xml file). when access post methods form (using jquery ajax) inside web application, that´s ok, think cross-domain problem.

is there configuration done in jboss web application can receive post calls other domains (of course, providing correct username/password pair).

thanks in advance!

generally these cross-domain issues have browser, not server. browser limit ability use ajax updates domain of page on. there workarounds such jsonp, don't know if can work post.

we decided use 3rd party proxy library http proxy servlet. proxy servlet allows post though locally accessible domain simple web.xml addition. doing this, never have mess jsonp either, straight json works fine.

we using forward several different paths several different servers (you can have more 1 forwarder using method in same web app). our web.xml series of servlet mappings (one each external restful service pointing base paths):

   <servlet>       <servlet-name>myoneproxy</servlet-name>       <servlet-class>org.mitre.dsmiley.httpproxy.proxyservlet</servlet-class>       <init-param>          <param-name>targeturi</param-name>          <param-value>http://external-web-app.com/basepath</param-value>       </init-param>       <init-param>          <param-name>log</param-name>          <param-value>true</param-value>       </init-param>    </servlet>    <servlet-mapping>       <servlet-name>myoneproxy</servlet-name>       <url-pattern>/internalbasepath/*</url-pattern>    </servlet-mapping> 

Comments