1

I am beginner in gwtp and I want to build an application that displays a list of products, and by clicking I displays the details of the selected product... My question is how to refresh the page to allow page product Detail to refresh while respecting security measures, obviously I do not want to pass the id of the product in the request. I thought about storing the id in the session but I do not know if it will impact the application's performance given the high response times of RPC.

Any help or clarification on this would be appreciated.

4

2 回答 2

0

您可以考虑使用 GWT 的Cookie Support。如果实施得当,您将始终确切地知道他们最后在做什么,并且让他们回到那里变得容易。Cookie 显然是客户端的,所以它总是比 RPC 快。

于 2012-02-14T18:33:13.280 回答
0

我有一些建议,但请注意,我对 GWTP 也很陌生......

安全

通信应通过 SSL/HTTPS 进行。我使用 servlet 容器 ( web.xml )将它放在我的整个应用程序中,以便它与我的应用程序的非 GWT 部分无缝集成。

我认为在 url 中添加 'id' 没有问题。您始终可以使用PlaceManager.revealPlace(PlaceRequest, boolean)阻止它显示在地址栏中。

组合视图

我有一个视图,左侧是实体列表,右侧是编辑表单。该列表始​​终显示并由父演示者明确放置在“插槽”中:

public class Users extends Presenter<Users.View, Users.Proxy> {
@ContentSlot
public static final GwtEvent.Type<RevealContentHandler<?>> LIST_SLOT = new GwtEvent.Type<RevealContentHandler<?>>();
@ContentSlot
public static final GwtEvent.Type<RevealContentHandler<?>> FORM_SLOT = new GwtEvent.Type<RevealContentHandler<?>>();
@Inject
private UserList userList;

@Inject
public Users(EventBus eventBus, View view, Proxy proxy) {
    super(eventBus, view, proxy, Configuration.SLOT);
}

@Override
protected void onReveal() {
    super.onReveal();
    setInSlot(LIST_SLOT, userList);
}
...

我的应用程序有一个“空表单”演示者,当未选择任何列表项时默认显示该演示者。这可以防止列表和父演示者成为“地点”(需要令牌)。只有演示者层次结构中的叶演示者应该是一个“地方”。

于 2013-06-17T00:54:02.820 回答