Webwork framework

zhaozj2021-02-16  150

This weekend Webwork Velocity JSP JSTL's integration is finally small.

Webwork is lightweight than Structs, which is to use servletdispatcher to control different Action. The truth is similar to Structs, but learning is fast, configuration is simple, just configure xwork.xml. Other configuration files are not available.

The reason for Velocity and JSTL is that they support expression language (EL), very convenient, simple, flexible. And Velocity also supports macros, and the written VM has unlimited flexibility.

In fact, Velocity, JSP is the View in the MVC, JSTL is a tag, but it supports expression language, this is the reason I want to use because it can get dynamic objects.

Webwork's action and velocity exchange data is over ONGL VALUE Stack: in action, actionContext.getContext (). Put ("List", list); in VM, # set ($ list = $ stack.FindValue "(" # list ") #foreach ($ card in $ list) $ card.code #end

In Action: servletivityContext.getServletContext (). SetAttribute ("Card", CARD); in JSP:

转载请注明原文地址:https://www.9cbs.com/read-7970.html

New Post(0)