java - HTML+JS替换struts2中的JSP充当view层
ringa_lee
ringa_lee 2017-04-18 09:26:13
0
1
409

JSP内嵌HTML和JS,只作为转发
structs2里配置action
js直接调用action获取数据填充html

和传统的利用jsp当view层

这种方式可以实现前后分离,类似RPC的调用,会有什么利弊?

ringa_lee
ringa_lee

ringa_lee

reply all(1)
左手右手慢动作

First of all, in terms of optimization, the static page transfers the pressure of server rendering templates to the client, which naturally reduces the pressure on service fees. In terms of expansion, data and pages are decoupled, and data interfaces can be reused. App, ria, webh5, frame-level themes, and a set of interfaces are all available. In the future, it can be expanded to dual servers, data services, and page services are separated. In terms of development, the front and rear responsibilities are separated, focusing on differences, and parallel development does not affect each other.
The disadvantage is that optimizing the transfer increases the pressure on the browser (this pressure counts as a P). In terms of expansion, if the data interface does not follow the RESTful specification, some interface h5 cannot be called at all. Development increases personnel, increases learning costs, and pushes new reforms to offend people

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!