Redian新闻
>
纯ajax网站和sevlet优劣是啥
avatar
纯ajax网站和sevlet优劣是啥# Java - 爪哇娇娃
z*n
1
如果客户端完全用html+javascript。所有request都是call服务器端的web service。
这样的设计有啥问题。 和通用servlet框架,像springmvc, strut2, jsf,比有啥优劣?
现在有没有这样的网站采取这种架构?
avatar
c*e
2
ajax call的不一定是web services。ajax只是把从server-side得到的数据,inject到
client-side的某一個tag里面。
ajax可以就更新一個网页自身,然后数据也update了。jsp里面本身可以用javabean,
java code来做动态网页。比如一个网页上的读者的留言,更新就是用ajax.

劣?

【在 z****n 的大作中提到】
: 如果客户端完全用html+javascript。所有request都是call服务器端的web service。
: 这样的设计有啥问题。 和通用servlet框架,像springmvc, strut2, jsf,比有啥优劣?
: 现在有没有这样的网站采取这种架构?

avatar
c*e
3
struts沒有servlet灵活。ajax只是动态更新网页的某一個部分,而且用戶感觉不到网
页刷新。

劣?

【在 z****n 的大作中提到】
: 如果客户端完全用html+javascript。所有request都是call服务器端的web service。
: 这样的设计有啥问题。 和通用servlet框架,像springmvc, strut2, jsf,比有啥优劣?
: 现在有没有这样的网站采取这种架构?

avatar
z*n
4
你没看懂我帖子。我说的是静态html+javascript,完全不用jsp

【在 c*********e 的大作中提到】
: ajax call的不一定是web services。ajax只是把从server-side得到的数据,inject到
: client-side的某一個tag里面。
: ajax可以就更新一個网页自身,然后数据也update了。jsp里面本身可以用javabean,
: java code来做动态网页。比如一个网页上的读者的留言,更新就是用ajax.
:
: 劣?

avatar
s*e
5
Yes. you should be fine by either way.
But before you choose between them, you might want to ask yourself some
questions:
1. do you need to keep states on the server side? For example http session..
. Web service by nature is stateless. You can make it stateful, but that
will imply the extra works on both client and server sides. On the other
hand, servlet/jsp automatically support states via http session.
2. Do you need to do the whole page navigation a lot? Ajax was introduced to
update a html page partially while keeping the other parts of the page to
be responsive. It might not be as easy to update the whole page as some
server side technologies. But if you use some RIA ui frameworks such as flex
, jquery ui, and ext-js, it might not be a big issue to you.
3. do you need authentication and authorization? actually this is still
somehow related to if you need states.
avatar
z*n
6
谢谢回复,这个说到点子上了。

..
to

【在 s******e 的大作中提到】
: Yes. you should be fine by either way.
: But before you choose between them, you might want to ask yourself some
: questions:
: 1. do you need to keep states on the server side? For example http session..
: . Web service by nature is stateless. You can make it stateful, but that
: will imply the extra works on both client and server sides. On the other
: hand, servlet/jsp automatically support states via http session.
: 2. Do you need to do the whole page navigation a lot? Ajax was introduced to
: update a html page partially while keeping the other parts of the page to
: be responsive. It might not be as easy to update the whole page as some

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。