简体   繁体   中英

How to communicate webapp and web service running on tomcat

I have a web application and web service(apache cxf) sharing same database and running on their own servlets.And i have foo class with a field 'startdate'.I am tracing closest start date and schedule quart's simple trigger to start at this date.But data also come from web service and i am cannot trace closest date.I can duplicate logic to web service and trace closest date separately but this lead resource leak.İs there a way inform webapp from web service.

Http-get with parameter to web app.

String queryString = "param1=" +
  URLEncoder.encode(param1Value, "UTF-8");
queryString += "&param2=" +
   URLEncoder.encode(param2Value, "UTF-8");

// Make connection

URL url = new URL("http://www.localhost.8080/");
URLConnection urlConnection = url.openConnection();
urlConnection.setDoOutput(true);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM