spring - Struts 和 Spring 一起吗?

标签 spring struts service actionform

我对 Struts 和 Spring 都很陌生。我需要知道如何访问 Struts ActionForm 中的 Spring 服务。即使是指向正确方向的指针也将不胜感激。

最佳答案

从 struts 1 ActionForm 类中,您将需要:

WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext).getBean("yourService");

关于spring - Struts 和 Spring 一起吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/354171/

相关文章:

java - Spring STS javax/persistence/EntityManagerFactory 找不到

java - 如何为一个servlet映射多个url

java - <html :errors> struts tutorial or example

exception - 使用View-Controller-Service体系结构在Grails中运行时错误处理

c# - 确定解决方案配置 (Visual Studio)

android - Google FusedLocationApi API 调用 onConnectionSuspended 的时间太多,我无法获取 GPS 位置

java - 获取 HTTP 状态 400 - 必需的 MultipartFile 参数 'file' 在 spring 中不存在

java - 在 Spring MVC 应用程序的 Controller 中没有收到 ajax 请求?

Spring OSGi 状态

java - JSP IllegalArgumentException : com. sun.xml.messaging.saaj.soap.LocalString!= com.sun.xml.internal.messaging.saaj.soap.LocalStrings问题