avatar
一个关于GWT的问题# Java - 爪哇娇娃
d*k
1
我有一个关于GWT的问题。好像坛子里讨论的不多。在以前的一个帖子里,魔法胖子提
到“google will own your rear end”。这是个什么意思?
其实我的理想状态还是后端用jdbc或者别的persistance, 然后前端用GWT代替jsp,
这个可行吗?这个GWT前后端是怎么talk的?还需要一个spring mvc或者别的什么web
tier的东西吗?我的直觉是spring mvc 和GWT 整合应该是没戏了。谢谢了。
avatar
g*g
2
mf was talking about cloud. You certainly can use GWT as your front end,
and you can integrate with spring MVC if you want it that way.
It's probably simpler though, to integrate with a restful webservice.

【在 d**k 的大作中提到】
: 我有一个关于GWT的问题。好像坛子里讨论的不多。在以前的一个帖子里,魔法胖子提
: 到“google will own your rear end”。这是个什么意思?
: 其实我的理想状态还是后端用jdbc或者别的persistance, 然后前端用GWT代替jsp,
: 这个可行吗?这个GWT前后端是怎么talk的?还需要一个spring mvc或者别的什么web
: tier的东西吗?我的直觉是spring mvc 和GWT 整合应该是没戏了。谢谢了。

avatar
m*t
3

Never mind that. Just one of my poor attempts at being funny. :-)
You can still have gwt running with spring mvc, or any other http
service for that matter. Gwt supports sending standard http requests.
That's actually how I made my gwt login form communicate with spring
security's login processing service.

【在 d**k 的大作中提到】
: 我有一个关于GWT的问题。好像坛子里讨论的不多。在以前的一个帖子里,魔法胖子提
: 到“google will own your rear end”。这是个什么意思?
: 其实我的理想状态还是后端用jdbc或者别的persistance, 然后前端用GWT代替jsp,
: 这个可行吗?这个GWT前后端是怎么talk的?还需要一个spring mvc或者别的什么web
: tier的东西吗?我的直觉是spring mvc 和GWT 整合应该是没戏了。谢谢了。

avatar
d*k
4
谢过两位老大了。
avatar
t*h
5
可以啊
gwt前后端通过rpc和http通信
我现在的项目就是用gwt(rpc) + spring mvc + ibatis做的
我记得网上有个文章讲这个的 就是写一个service接受所有rpc 然后通过spring mvc转
发给不同的service来处理
好像还有一个开源的项目做了这个框架 不用自己写 google一下吧
avatar
d*k
6
那就是说mvc只负责router service, 不再用来forward view 乐?我还是搜搜吧。谢谢了

【在 t******h 的大作中提到】
: 可以啊
: gwt前后端通过rpc和http通信
: 我现在的项目就是用gwt(rpc) + spring mvc + ibatis做的
: 我记得网上有个文章讲这个的 就是写一个service接受所有rpc 然后通过spring mvc转
: 发给不同的service来处理
: 好像还有一个开源的项目做了这个框架 不用自己写 google一下吧

avatar
m*t
7

谢了
It still handles views, except in this case a view could
be some json or xml response.

【在 d**k 的大作中提到】
: 那就是说mvc只负责router service, 不再用来forward view 乐?我还是搜搜吧。谢谢了
avatar
d*k
8
我tnnd笨死了:死活没法create一个简单的app看看到底怎么回事儿。老大你能给个简
单的例子吗?我试试能不能试着go through一个sample. 谢谢了

【在 m******t 的大作中提到】
:
: 谢了
: It still handles views, except in this case a view could
: be some json or xml response.

avatar
k*p
9
RE: 我试试能不能试着go through一个sample. 谢谢了
http://courses.coreservlets.com/Course-Materials/gwt.html
Happy coding

【在 m******t 的大作中提到】
:
: 谢了
: It still handles views, except in this case a view could
: be some json or xml response.

avatar
m*t
10

I am not supposed to share the source code I have, but basically
it works like this:
1. Some GWT code submits a form to a url,
2. The url is mapped to a spring mvc handler that, well, handles
it just like any other form submission requests, prepares the model,
and forwards to a view,
3. The view renders a json response (as oppose to typical html),
4. Finally the GWT code gets the response, and parses the json.
So in the steps above, 1 and 4 are completely gwt, while 2 and 3
are spring mvc. They

【在 d**k 的大作中提到】
: 我tnnd笨死了:死活没法create一个简单的app看看到底怎么回事儿。老大你能给个简
: 单的例子吗?我试试能不能试着go through一个sample. 谢谢了

avatar
d*k
11
hey, Thanks a lot, man. I will take a look to see if I can find any clue
about spring+gwt.

【在 k******p 的大作中提到】
: RE: 我试试能不能试着go through一个sample. 谢谢了
: http://courses.coreservlets.com/Course-Materials/gwt.html
: Happy coding

avatar
d*k
12
胖子, thanks a lot for all your help. I guess I need to spend some more time
on this thing. There is one question just pop up to my head: if a GWT form
submit to a URL, and Spring, say controller, catch the post and doing its
data process and then forwards to a view which renders as JSON, than how
could that form or other GWT component catch this JSON?

【在 m******t 的大作中提到】
:
: I am not supposed to share the source code I have, but basically
: it works like this:
: 1. Some GWT code submits a form to a url,
: 2. The url is mapped to a spring mvc handler that, well, handles
: it just like any other form submission requests, prepares the model,
: and forwards to a view,
: 3. The view renders a json response (as oppose to typical html),
: 4. Finally the GWT code gets the response, and parses the json.
: So in the steps above, 1 and 4 are completely gwt, while 2 and 3

avatar
o*1
13
为什么要用 spring mvc? 直接 gwt async service 就可以吧,把 spring service
autowire 进 gwt service 里面。

【在 d**k 的大作中提到】
: hey, Thanks a lot, man. I will take a look to see if I can find any clue
: about spring+gwt.

avatar
d*k
14
倒不是一定要用spring mvc, 以前的project就是这个的,想着如果mvc跟gwt好整合的
话,可能会头update 旧的project会方便些

【在 o**1 的大作中提到】
: 为什么要用 spring mvc? 直接 gwt async service 就可以吧,把 spring service
: autowire 进 gwt service 里面。

avatar
m*t
15

time
form
In GWT, you always submit an http request along with a callback, which
will be called with the response. And that's where the json string can be
processed.

【在 d**k 的大作中提到】
: 胖子, thanks a lot for all your help. I guess I need to spend some more time
: on this thing. There is one question just pop up to my head: if a GWT form
: submit to a URL, and Spring, say controller, catch the post and doing its
: data process and then forwards to a view which renders as JSON, than how
: could that form or other GWT component catch this JSON?

avatar
d*k
16
that does make sense....thanks a lot, dude!

【在 m******t 的大作中提到】
:
: time
: form
: In GWT, you always submit an http request along with a callback, which
: will be called with the response. And that's where the json string can be
: processed.

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