You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vaadinsessions.jsp 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!DOCTYPE>
  2. <%@page import="com.vaadin.ui.UI"%>
  3. <%@page import="com.vaadin.server.VaadinSession"%>
  4. <HTML>
  5. <HEAD>
  6. <TITLE>JSP integration</TITLE>
  7. <style>
  8. table {
  9. background: #fff;
  10. }
  11. td {
  12. border: 1px solid black;
  13. padding: .5em;
  14. }
  15. </style>
  16. </HEAD>
  17. <BODY>
  18. <table>
  19. <tr>
  20. <th align="left" colspan=4>Available UIs:</th>
  21. </tr>
  22. <tr>
  23. <th>Service Name</th>
  24. <th>CSRF token</th>
  25. <th>UI id</th>
  26. <th>UI type</th>
  27. <th>Main content</th>
  28. </tr>
  29. <%
  30. HttpSession httpSession = request.getSession(false);
  31. for (VaadinSession vs : VaadinSession.getAllSessions(httpSession)) {
  32. try {
  33. vs.lock();
  34. for (UI ui : vs.getUIs()) {
  35. out.append("<tr class='uirow'>");
  36. out.append("<td>" + vs.getService().getServiceName()
  37. + "</td>");
  38. out.append("<td>" + vs.getCsrfToken() + "</td>");
  39. out.append("<td>" + ui.getUIId() + "</td>");
  40. out.append("<td>" + ui.getClass().getName() + "</td>");
  41. out.append("<td>" + ui.getContent().getClass().getName() + "</td>");
  42. out.append("</tr>");
  43. }
  44. } finally {
  45. vs.unlock();
  46. }
  47. }
  48. %>
  49. </table>
  50. </BODY>
  51. </HTML>