title: SAP HCP Java proxy servlet to mask a variable
body: <h2>Introduction</h2>
  
  <p>I have a SAP HANA Cloud Platform account. I have also deployed a Java application to the account and created a test servlet, which returns dummy data.</p>
  
  <p>On the other side i have a SAP UI5 application which i develop on the WebIDE. I created also two destinations:</p>
  
  <ul>
  <li>Destination "virtualTEST" is connected to a SAP Backend System (HANA Cloud Connector)</li>
  <li>Destination "javaTEST" is connected to my Java servlet application</li>
  </ul>
  
  <p>The neo-app.json is well configured and can obtain data from the test servlet (the dummy data) and data from the SAP Backend System (<strong>OData Gateway</strong>).</p>
  
  <h2>The problem</h2>
  
  <p>Now i want to pass variables to the SAP Backend System (virtualTEST) destination, which should <em>not be visible in the frontend</em> to avoid javascript manipulation.</p>
  
  <h2>My first thought</h2>
  
  <p>My first thought was that i create a new servlet which acts as proxy. In the SAPUI5 i call the servlet from javaTEST destination and pass the "hidden variables" like <code>/testServlet?targetUrl=https://webide-xxx.hana.ondemand.com/sap/opu/odata/TEST_SRV/TEST?$filter=Var eq '{{MYVAR}}'</code> and the Java application replaces {{MYVAR}} with my real variable. Then the target will be loaded (this is also a destination url to my SAPUI5 application). This does not work, i do not know why, but i think the proxy can not obtain data from the destination of an application.</p>
  
  <p>Also, i think this is not the best solution. How can this be solved? Any ideas or best practices? Can destinations be used in Java application? :)</p>