Struts1 标签可以用在 Struts1 的 Velocity 模板中吗?
Can Struts1 tags be used in Velocity templates in Struts1?
不幸的是,我需要在旧的 Struts1 应用程序中注入新功能。当前视图正在使用 Velocity 模板,但我没有看到任何 struts 标签在使用中。我也知道在 Struts2 中,可以在 Freemarker and/or Velocity 模板中使用 Struts 标签。
例如,在 Struts2 应用程序中,可以在 Velocity 模板中执行以下操作(而不是使用 JSP 标记库):
#sform ("action=updatePerson")
#stextfield ("label=First name" "name=firstName")
#ssubmit ("value=Update")
#end
Struts1 中是否存在此类集成?有没有办法在 Velocity 模板中使用 Struts1 标签,或者这是否需要对速度集成到 Struts1 中的方式进行一些重大改革?
在 Velocity 模板中没有 直接 使用 Struts 1 标签,但提供了允许并行功能的附加工具,例如来自 http://velocity.apache.org/tools/devel/struts.html:
VelocityStruts includes both the GenericTools and VelocityView and adds tools for use in Struts 1.x applications. These tools match the functions of the key Struts taglibs and provide access to Struts resources, messages, tiles, validation functions and more.
这至少会让你到达那里的一部分。
不幸的是,我需要在旧的 Struts1 应用程序中注入新功能。当前视图正在使用 Velocity 模板,但我没有看到任何 struts 标签在使用中。我也知道在 Struts2 中,可以在 Freemarker and/or Velocity 模板中使用 Struts 标签。
例如,在 Struts2 应用程序中,可以在 Velocity 模板中执行以下操作(而不是使用 JSP 标记库):
#sform ("action=updatePerson")
#stextfield ("label=First name" "name=firstName")
#ssubmit ("value=Update")
#end
Struts1 中是否存在此类集成?有没有办法在 Velocity 模板中使用 Struts1 标签,或者这是否需要对速度集成到 Struts1 中的方式进行一些重大改革?
在 Velocity 模板中没有 直接 使用 Struts 1 标签,但提供了允许并行功能的附加工具,例如来自 http://velocity.apache.org/tools/devel/struts.html:
VelocityStruts includes both the GenericTools and VelocityView and adds tools for use in Struts 1.x applications. These tools match the functions of the key Struts taglibs and provide access to Struts resources, messages, tiles, validation functions and more.
这至少会让你到达那里的一部分。