是否可以在worklight适配器实现中访问HTTPRequest? [英] Is it possible to access to the HTTPRequest in the worklight adapter implementation?

查看:90
本文介绍了是否可以在worklight适配器实现中访问HTTPRequest?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过某种方式在适配器代码内访问httprequest?

Is is possible somehow to access the httprequest inside the code of the adater?

问这个问题的根本原因有点棘手...

The root reason for asking this is a bit tricky...

我需要知道worklight服务器的IP,以便稍后在应用程序中将其用于其他用途.

I need to know the ip of the worklight server to use it later in the app for other uses.

在该应用程序中,我找不到任何可以提供帮助的API.

From the app I have not found any API that could help.

从Worklight中检测Worklight Server主机名/IP地址客户代码 在服务器中,可以使用WL.Server.configuration ["local.IPAddress"]获取ip,但这是静态的,现在没有"local.IPAddress".无论如何,这都是静态的.

Detect Worklight Server Hostname/IP Address from Worklight Client code In the server it was possible using the WL.Server.configuration["local.IPAddress"] to get the ip but that was static and now there is no "local.IPAddress". Any way this is static.

可以使用J2SE API来访问网络接口,但是由于存在多个接口,因此不是最佳选择.

Using J2SE API is possible to access to the network interfaces but as there can be more than one it is not the best option.

我正在考虑使用httprequest getLocalAddres方法返回被调用的ip.

I was thinking about using the httprequest getLocalAddres method that return the ip being invoked.

谢谢

推荐答案

如果您谈论的是从客户端到WL服务器的httprequest-是的,这是可能的.您有WL.Server.getClientRequest()API

If you're talking about httprequest from client to WL server - yes, it is possible. you have WL.Server.getClientRequest() API

如果您正在谈论从WL服务器到后端的httprequest-不,这是不可能的.适配器用于抽象直接使用HTTP客户端内部组件的需求.

If you're talking about httprequest from WL server to backend - no, this is not possible. Adapter is used to abstract the need for direct usage of HTTP client internals.

这篇关于是否可以在worklight适配器实现中访问HTTPRequest?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆