使用面向Servlet的自定义框架,太多的servlet,这是一个问题 [英] Using a custom Servlet oriented framework, too many servlets, is this an issue

查看:241
本文介绍了使用面向Servlet的自定义框架,太多的servlet,这是一个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的应用程序中,我们通过Servlet构建不同的Web应用程序。我们的应用程序中有许多Servlet和过滤器。

In our application, we structure different web applications by Servlet. There are many, many Servlets and Filters in our applications.

我们已经使用了不同的框架,但不是这个特定的遗留Web应用程序。一个问题是一个应用程序/ servlet完全独立于另一个。

We already use different frameworks but not for this particular legacy web application. One issue is that one application/servlet is completely separate from another.

如果你要重新设计使用这个传统设计的应用程序,你将如何解决你的问题让你的应用程序被太多的servlet打破。

If you were to redesign your application that used this legacy design, how would you fix the issue where you have your application broken by too many servlets.

我正在考虑某种Servlet Manager,它会对一堆servlet进行分组,然后在适当的时候调用适当的servlet。

I was considering some kind of "Servlet Manager" that would group a bunch of servlets and then invoke the proper servlet when appropriate.

推荐答案

Spring可以将请求委托给现有的旧Servlet(使用 ServletWrappingController ServletForwardingController ),如果那是你想要的。

Spring has the facility to delegate requests to existing legacy Servlets (using ServletWrappingController or ServletForwardingController), if that is what you so desire.

因此,您可以将Spring DispatcherServlet 放在传统servlet的前面,充分利用Spring的请求路由设施。 Spring还可以为您提供更容易在servlet之间共享内容的工具,但是将共享组件放在servlet上下文中。

So you could have a Spring DispatcherServlet sitting at the front of your legacy servlets, making full use of Spring's request routing facilities. Spring could also give you the facility for more easily sharing stuff between the servlets, but putting shared components in the servlet context for you.

这篇关于使用面向Servlet的自定义框架,太多的servlet,这是一个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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