Hi,
I follow the instruction to create a helloword xs project in Microsoft azure hana platform, the project uses form authentication, after creating and activating the xs project, when sending request to retrieveData.xsjs as below
The Chrome browser will first show the logon page, after inputting the user name and password, then instead showing the html content based on retrieveData.xsjs's xsjs code, the chrome browser just downloads the file of retrieveData.xsjs to local.
The whole project is attached for your reference.
The content of .sxaccess is:
{
"exposed" : true,
"authentication" :
{
"method": "Form"
},
"cache_control" : "must-revalidate",
"cors" :
{
"enabled" : false
},
"enable_etags" : false,
"force_ssl" : false,
"prevent_xsrf" : true
}
The content of retrieveData.js is:
$.response.contentType = "tex/html";
var output = "hello world! <br><br>";
var conn = $.db.getConnection();
var pstmt = conn.prepareStatement("select * from DUMMY");
var rs = pstmt.executeQuery();
if (!rs.next()){
$.response.setBody("Failed to retrieve data");
$.response.status = $.net.http.INTERNEL_SERVER_ERROR;
}
else{
output = output +" this is the response from my sql: " + rs.getString(1);
}
rs.close();
pstmt.close();
conn.close();
$.response.setBody(output);
Thanks for any help for the issue
Jonathan