简体   繁体   English

在Apache HTTP Server中调用Java程序

[英]invoke a Java program in Apache HTTP Server

Is there any way to invoke a Java program for a particular URL in Apache HTTP Server? 有什么方法可以为Apache HTTP Server中的特定URL调用Java程序吗? Thanks. 谢谢。

The architecture is like this: Browser > Apache > WebLogic Application Server. 架构如下:浏览器> Apache> WebLogic应用服务器。 My requirement is to invoke a Java code in Apache before request goes to WebLogic Application Server. 我的要求是在请求到达WebLogic Application Server之前在Apache中调用Java代码。

You probably want to stick with the Java EE Filter solution. 您可能想要坚持使用Java EE筛选器解决方案。 But if, for some reason, you can't do that and absolutely must do this at the Apache layer, Apache does offer filters. 但是,如果由于某种原因您不能执行此操作,而绝对必须在Apache层执行此操作,则Apache会提供过滤器。 See here: http://httpd.apache.org/docs/2.2/mod/mod_ext_filter.html 参见此处: http : //httpd.apache.org/docs/2.2/mod/mod_ext_filter.html

If you need to change some values before a Servlet is invoked, your best option is to implement a Java EE Filter , and deploy it at your web app. 如果需要在调用Servlet之前更改某些值,最好的选择是实现Java EE Filter并将其部署在Web应用程序中。

There, you can do all the pre-processing you need before invoking your servlet/JSP/WS. 在那里,您可以在调用Servlet / JSP / WS之前进行所需的所有预处理。

Reference: The Essentials of Filters 参考: 过滤器要点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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