vaadin

how to put data in session variable and get the data in different page in vaadin?

房东的猫 提交于 2019-11-27 02:53:16
问题 I think I should use the application scope session to deal with that. But I do not have any experience about that. I tried different ways I got from the internet like: HttpServletRequest request; HttpSession sess = request.getSession(); sess.setAttribute("name", name); later in other page HttpServletRequest request; String=(String)request.getAttribute(name); //or HttpSession sess = request.getSession(); // sess.getAttribute(name); all do not work. I think there may something special for

Infinite loop in java.util.HashMap

孤街浪徒 提交于 2019-11-26 23:29:08
问题 I have some Vaadin code blocking very often here, and I have no idea what the problem can be: Thread 7892: (state = IN_JAVA) - java.util.HashMap.getEntry(java.lang.Object) @bci=61, line=349 (Compiled frame; information may be imprecise) - java.util.HashMap.containsKey(java.lang.Object) @bci=2, line=335 (Compiled frame) - java.util.HashSet.contains(java.lang.Object) @bci=5, line=184 (Compiled frame) - com.vaadin.ui.Table.unregisterPropertiesAndComponents(java.util.HashSet, java.util.HashSet)

Generate an HTML page, and open in a new window, from a Vaadin 8 app

╄→гoц情女王★ 提交于 2019-11-26 23:24:22
问题 From my Vaadin 8 web app, I want the user to be able to open a report in another window, by clicking a button. The contents are to be generated by the Vaadin app using plain HTML5 rather than using Vaadin widgets. The Vaadin 8 manual has a page Handling Browser Windows. Its shows the use of a BrowserWindowOpener object to open a new window. But that window contains a Vaadin UI subclass, whereas I want to generate my own HTML content. Bonus points for passing information such as a database

How to access `ServletContext` from within a Vaadin 7 app?

坚强是说给别人听的谎言 提交于 2019-11-26 21:19:30
问题 How do I access the current ServletContext from within my Vaadin 7 app? I want to use the ServletContext object’s setAttribute, getAttribute, removeAttribute, and getAttributeNames methods to manage some global state for my Vaadin app. Also, if using those methods for that purpose is inappropriate for Vaadin apps, please explain. 回答1: tl;dr For both Vaadin 7, 8 and 10: VaadinServlet.getCurrent().getServletContext() VaadinServlet The VaadinServlet class inherits a getServletContext method. To

Displaying Same Data Aross Multiple Clients Using Push in Vaadin 7 app

被刻印的时光 ゝ 提交于 2019-11-26 17:46:38
问题 I want to share the same set of data to multiple clients. I need to use Push to automatically update their view on screen. I have read the Question and Answer, Minimal example of Push in Vaadin 7 app (“@Push”). Now I need a more robust realistic example. For one thing, I know having a never-ending Thread is not a good idea in a Servlet environment. And I don't want each user having their own Thread, each hitting the database on their own. Seems more logical to have one thread alone checking

Minimal example of Push in Vaadin 7 app (“@Push”)

风格不统一 提交于 2019-11-26 11:14:22
问题 I want to see the most minimal example of using the new Push technology in Vaadin 7, such as the new @Push annotation. I am having problems getting server-push to work in my app. I would like to try a simple example app before trying to fix my own app. 回答1: Simplification Of Example In The Book Of Vaadin The Book Of Vaadin includes a chapter on Push, including an example using Vaadin Charts. Below is my code. While based on that Vaadin Charts example mentioned above, I simplified it by