我有一个 VPS。我的网站位于该 vps 上,我希望客户的网站也位于该 vps 上,这没问题。
我希望将我的 servlet 放在我的域下,并让客户的网站向这些 servlet 发出请求,这样我就可以避免数据重复。换句话说,我更愿意将 servlet 全部放在一个位置(在我的域上),而不是将这些 servlet 的副本放置在客户端的每个域下。
问题是 - 是否可以从另一个域(上下文)调用我的域(或上下文)上的 servlet?
如果是这样,这是如何完成的?
I have a VPS. My website is on that vps, and I would like to have my client's websites on there as well, which is no problem.
I want to have my servlets under my domain and have the client's websites make requests to those servlets so I can avoid duplication of data. In other words, I would prefer to have the servlets all in one location (on my domain) instead of placing copies of those servlets under each domain for a client.
The question is this - is it possible to call the servlets on my domain (or context) from another domain (context)?
If so, how is this done?
发布评论
评论(1)
那么您有一组 Servlet 托管多个域的功能/内容吗?您可以通过将所有域路由到同一 IP/主机/服务器,然后在运行时确定请求域来实现此目的。可以在这里看到这样的示例:
https://github.com/ocpsoft/rewrite/blob/master/showcase/multi-domain/src/main/java/com/ocpsoft/rewrite/showcase/domain/DomainRewriteConfiguration.java
这是使用URL/请求重写工具来确定域的名称,并相应地加载数据。
如果这不是您的问题,那么我想我不太确定您在问什么!
So you have one set of Servlets hosting functionality/content for a number of domains? You can do this by routing all of your domains to the same IP/host/server and then determine the requesting domain at runtime. An example of this can be seen here:
https://github.com/ocpsoft/rewrite/blob/master/showcase/multi-domain/src/main/java/com/ocpsoft/rewrite/showcase/domain/DomainRewriteConfiguration.java
This is using a URL/request rewriting tool to determine the name of a domain, and load data accordingly.
If this isn't your problem, then I guess I'm not really sure what you are asking!