Is Wicket a suitable Web java framework for Single Page Applications? [closed]

房东的猫 提交于 2019-12-23 18:30:56

问题


Or there are best options (frameworks) for this kind of application, SPA?

I'm interested in use only Scala or Java frameworks for backend development.

And the mainly important points for choose a backend web framework for me are:

  • good documentation, resources and many examples
  • maturity and large adoption by the community and with considerable real use cases.
  • a easy and short learn curve.
  • a simple and extensive architecture that make easy use or add features like authentication, authorization and others common needed in a web app.

回答1:


Yes, you can build a SPA with Wicket, and its component architecture actually makes it very simple.

Basically, what would be a page in an usual application, you turn into a Panel, and make the single page switch panels with Ajax instead of navigating between pages. You can use multiple panels for multiple sections of the page, etc. All this is very simple and natural with the framework. The event architecture, added since 5.x, makes it even simpler to use inter-section communication.

The one thing you lose, though, is bookmark-ability of pages.

Since it's a single page, the URL in the browser's address bar won't ever change, and if the user creates a bookmark, it will always hit the initial page, not the page shown when the bookmark was made.

Client-side (javascript-based) frameworks (like GWT) usually implement this by using dynamic anchors (the string in the URL after #) to encode the current state, so that the app can reconstruct it if needed, but being a server-centric framework, Wicket can't do it (at least, not without much custom code). Possible, doable, but will require some thought and work.

Many times this isn't a required feature (or may even be an undesirable behaviour). If that is the case, Wicket can really help you.

About using action-based frameworks (Struts, Spring MVC, Play, etc.), they are more appropriate if you want a client-heavy architecture. But you'll inevitably code most of your application in Javascript, or using some Java-to-javascript-compiler (GWT), and use the framework just to make the queries, I mean, implement the services (XML, JSON, or some variant).



来源:https://stackoverflow.com/questions/14921785/is-wicket-a-suitable-web-java-framework-for-single-page-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!