我正在使用GWT(和GWT-Plateform)和GAE,我希望我的应用程序具有Admin和Normal模式。 我阅读了这篇文章https://turbomanage.wordpress.com/2009/11/19/tips-on-organizing-gwt-modules/#comment-5064,我希望看到一个使用Admin和Normal模式应用程序的应用程序的完整项目结构。您是否知道此案例的任何示例代码(如果可能,使用GWT和GAE ......并且GWTP将是完美的)?
在链接中,M。Chandler说我可以有3个模块(admin,app,common)和2个入口点(admin和app)。管理员和应用程序继承常见。但我不知道更多的东西,如: - 我正在使用“Client Bundle”,因此可以将我的资源文件夹放在“common module”中。它会起作用吗?我是否只需要一个CSS用于2个模块(管理员和普通模式)? - 我的整个域模型是否需要在公共模块中?
欢迎任何有关如何使用GWT使用Admin模块构建代码的建议。 我当前的问题是我不知道如何使用Eclipse(我应该复制粘贴“app”包的“客户端”,“服务器”,“共享”文件夹并添加它们在一个名为“admin”的新包中,然后删除和修改一些文件?看起来很复杂......或者只是有一些最小的文件和配置吗?)
谢谢你,
答案 0 :(得分:2)
这很容易......
点击此链接:https://developers.google.com/appengine/docs/java/config/webxml#Security_and_Authentication
您需要两个入口点。
管理模式的所有内容都是路径/ admin /...
在web.xml中,您现在配置web.xml中的安全性约束:
<security-constraint>
<web-resource-collection>
<url-pattern>/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
对于用户注册和登录控制,您可以使用Google提供的USERS-Api: https://developers.google.com/appengine/docs/java/users/overview