{"id":10966,"date":"2013-04-09T13:00:49","date_gmt":"2013-04-09T10:00:49","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=10966"},"modified":"2013-04-08T12:51:09","modified_gmt":"2013-04-08T09:51:09","slug":"spring-mvc-session-tutorial","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html","title":{"rendered":"Spring MVC Session Tutorial"},"content":{"rendered":"<p>Session management is one of essential parts for each web application. Since Spring MVC is a powerfull framework for a web development, it has own tools and API for the interaction with sessions. Today I intend to show you basic ways of session processing within Spring MVC application. That\u2019s mean a processing of forms, adding objects into a session, displaying of objects from the session on JSP. I will try my best, so let\u2019s start.<\/p>\n<p>This <b>Spring MVC Session tutorial<\/b> will be based on one of the previous posts on my blog, related to the <a title=\"Spring MVC form processing\" href=\"http:\/\/fruzenshtein.com\/spring-mvc-form-handling\/\" target=\"_blank\">form handling<\/a>. I\u2019m going to extend the application by adding a session logic to the existing student-form, create a new one page with a form and a single text field on it. The text from the field will be processed by a some controller<br \/>\n&nbsp;<br \/>\nand added to the session. In order to check the session functionality I will display the session objects on the pages using JSTL. The src from the tutorial you can download in the end of tutorial.<\/p>\n<h2>Form with the single text field<\/h2>\n<p>Firstly I need to create a view and the controller. I will start from the view creation and after that I\u2019ll demonstrate the corresponding controller with the session logic.<\/p>\n<pre class=\" brush:java\">...\r\n&lt;h2&gt;Adding of a String into the session&lt;\/h2&gt;\r\n\r\n&lt;form action=\"remember.html\" method=\"post\"&gt;\r\n&lt;table&gt;\r\n&lt;tbody&gt;&lt;tr&gt;\r\n&lt;td&gt;To remember:&lt;\/td&gt;\r\n&lt;td&gt;&lt;input name=\"thoughtParam\" type=\"text\"&gt;&lt;\/td&gt;\r\n&lt;\/tr&gt;\r\n&lt;tr&gt;\r\n&lt;td&gt;&lt;input type=\"submit\"&gt;&lt;\/td&gt;\r\n&lt;td&gt;&lt;\/td&gt;\r\n&lt;\/tr&gt;\r\n&lt;\/tbody&gt;&lt;\/table&gt;\r\n&lt;\/form&gt;\r\n&lt;a href=\"${pageContext.request.contextPath}\/\"&gt;Main page&lt;\/a&gt; \r\n...<\/pre>\n<p>Now I need to develop the controller to handle the form. There will be two methods for the requests handling: the first on is responsible for navigation to the page, the second one is related to session activity.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\" brush:java\">@Controller\r\n@SessionAttributes(\"thought\")\r\npublic class SingleFieldController {\r\n\r\n\t@RequestMapping(value=\"\/single-field\")\r\n\tpublic ModelAndView singleFieldPage() {\r\n\t\treturn new ModelAndView(\"single-field-page\");\r\n\t}\r\n\t\r\n\t@RequestMapping(value=\"\/remember\")\t\r\n\tpublic ModelAndView rememberThought(@RequestParam String thoughtParam) {\r\n\t\tModelAndView modelAndView = new ModelAndView();\r\n\t\tmodelAndView.addObject(\"thought\", thoughtParam);\r\n\t\tmodelAndView.setViewName(\"single-field-page\");\r\n\t\treturn modelAndView;\r\n\t}\r\n\t\r\n}<\/pre>\n<p>This is a simple Spring MVC controller with the one extra @SessionAttributes annotation. It indicates that in the controller\u2019s methods can be assigned some values to arguments of the annotation. In this example I declared just one session attribute with the name \u201c<em>thought<\/em>\u201c. That\u2019s mean I can put some object into <em>modelAndView<\/em> using addObject() method, and it will be added to the session if the name of the object will be the same as the name of argument in @SessionAttributes. The last thinng what I should to do is to add a link to the new page on the index.jsp:<\/p>\n<pre class=\" brush:java\">...\r\n\t&lt;h1&gt;Home page&lt;\/h1&gt;\r\n\t&lt;p&gt;This is Home page.&lt;\/p&gt;\r\n\t&lt;p&gt;Don't forget: ${thought}&lt;\/p&gt;\r\n\t&lt;p&gt;\r\n\t\t&lt;a href=\"person-form.html\"&gt;Person page&lt;\/a&gt; &lt;br&gt;\r\n\t\t&lt;a href=\"single-field.html\"&gt;Single field page&lt;\/a&gt;\r\n\t&lt;\/p&gt;\r\n...<\/pre>\n<p>In order, to check that session works properly, you need to add following code in the existing views (single-field-page.jsp, \u2026):<\/p>\n<pre class=\" brush:java\">&lt;p&gt;Don't forget: ${thought}&lt;\/p&gt;<\/pre>\n<p>On the screenshots below you can see the result of the code work:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" alt=\"Spring MVC session processing\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/04\/Spring-MVC-session-processing.jpg\" width=\"379\" height=\"196\" \/><\/p>\n<p>And the results:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" alt=\"Spring MVC session result JSTL\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/04\/Spring-MVC-session-result-JSTL.jpg\" width=\"374\" height=\"198\" \/><\/p>\n<p>And<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" alt=\"Spring MVC session result JSTL 1\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/04\/Spring-MVC-session-result-JSTL-1.jpg\" width=\"273\" height=\"172\" \/><\/p>\n<h2>Adding of a custom object into the session<\/h2>\n<p>In this section I\u2019m going to show you how to add a custom object into the session, and how to display object\u2019s properties on JSP. The role of custom object will play <em>Person<\/em> object. Firstly I\u2019ll modify the existing person controller:<\/p>\n<pre class=\" brush:java\">@Controller\r\n@SessionAttributes(\"personObj\")\r\npublic class PersonController {\r\n\r\n\t@RequestMapping(value=\"\/person-form\")\r\n\tpublic ModelAndView personPage() {\r\n\t\treturn new ModelAndView(\"person-page\", \"person-entity\", new Person());\r\n\t}\r\n\t\r\n\t@RequestMapping(value=\"\/process-person\")\r\n\tpublic ModelAndView processPerson(@ModelAttribute Person person) {\r\n\t\tModelAndView modelAndView = new ModelAndView();\r\n\t\tmodelAndView.setViewName(\"person-result-page\");\r\n\t\t\r\n\t\tmodelAndView.addObject(\"pers\", person);\r\n\t\tmodelAndView.addObject(\"personObj\", person);\r\n\t\t\r\n\t\treturn modelAndView;\r\n\t}\r\n\t\r\n}<\/pre>\n<p>Comparing with latest version I added two new strings:<\/p>\n<pre class=\" brush:java\">...\r\n@SessionAttributes(\"personObj\")\r\n...\r\nmodelAndView.addObject(\"personObj\", person);\r\n...<\/pre>\n<p>The result of the code execution is following:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" alt=\"Spring MVC session object\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/04\/Spring-MVC-session-object.jpg\" width=\"209\" height=\"265\" \/><\/p>\n<p>And<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" alt=\"Spring MVC session object result\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/04\/Spring-MVC-session-object-result.jpg\" width=\"224\" height=\"219\" \/><\/p>\n<p>This is the end of Spring MVC session tutorial. And as I promised earlier, I give a <a href=\"https:\/\/www.dropbox.com\/s\/mb49ric1re56w8z\/SpringMVCSession.rar\" target=\"_blank\">link<\/a> to the sources of project. Everything I mentioned in the post is just a part of things, which you should know about the sessions, later I\u2019ll write a post about different important features.<br \/>\n&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/fruzenshtein.com\/spring-mvc-session\/\">Spring MVC: Session<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Alexey Zvolinskiy at the <a href=\"http:\/\/fruzenshtein.com\/\">Fruzenshtein&#8217;s notes<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Session management is one of essential parts for each web application. Since Spring MVC is a powerfull framework for a web development, it has own tools and API for the interaction with sessions. Today I intend to show you basic ways of session processing within Spring MVC application. That\u2019s mean a processing of forms, adding &hellip;<\/p>\n","protected":false},"author":374,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[30,150],"class_list":["post-10966","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-spring","tag-spring-mvc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spring MVC Session Tutorial<\/title>\n<meta name=\"description\" content=\"Session management is one of essential parts for each web application. Since Spring MVC is a powerfull framework for a web development, it has own tools\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring MVC Session Tutorial\" \/>\n<meta property=\"og:description\" content=\"Session management is one of essential parts for each web application. Since Spring MVC is a powerfull framework for a web development, it has own tools\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-04-09T10:00:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Alexey Zvolinskiy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alexey Zvolinskiy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html\"},\"author\":{\"name\":\"Alexey Zvolinskiy\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/ac87395bf8afb0ae3515feb6a0f36d02\"},\"headline\":\"Spring MVC Session Tutorial\",\"datePublished\":\"2013-04-09T10:00:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html\"},\"wordCount\":536,\"commentCount\":12,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"Spring\",\"Spring MVC\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html\",\"name\":\"Spring MVC Session Tutorial\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2013-04-09T10:00:49+00:00\",\"description\":\"Session management is one of essential parts for each web application. Since Spring MVC is a powerfull framework for a web development, it has own tools\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/04\\\/spring-mvc-session-tutorial.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Spring MVC Session Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/ac87395bf8afb0ae3515feb6a0f36d02\",\"name\":\"Alexey Zvolinskiy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g\",\"caption\":\"Alexey Zvolinskiy\"},\"description\":\"Alexey is a test developer with solid experience in automation of web-applications using Java, TestNG and Selenium. He is so much into QA that even after work he provides training courses for junior QA engineers.\",\"sameAs\":[\"http:\\\/\\\/fruzenshtein.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/alexey-zvolinskiy\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring MVC Session Tutorial","description":"Session management is one of essential parts for each web application. Since Spring MVC is a powerfull framework for a web development, it has own tools","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html","og_locale":"en_US","og_type":"article","og_title":"Spring MVC Session Tutorial","og_description":"Session management is one of essential parts for each web application. Since Spring MVC is a powerfull framework for a web development, it has own tools","og_url":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-04-09T10:00:49+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Alexey Zvolinskiy","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Alexey Zvolinskiy","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html"},"author":{"name":"Alexey Zvolinskiy","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/ac87395bf8afb0ae3515feb6a0f36d02"},"headline":"Spring MVC Session Tutorial","datePublished":"2013-04-09T10:00:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html"},"wordCount":536,"commentCount":12,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["Spring","Spring MVC"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html","url":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html","name":"Spring MVC Session Tutorial","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2013-04-09T10:00:49+00:00","description":"Session management is one of essential parts for each web application. Since Spring MVC is a powerfull framework for a web development, it has own tools","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/04\/spring-mvc-session-tutorial.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Spring MVC Session Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/ac87395bf8afb0ae3515feb6a0f36d02","name":"Alexey Zvolinskiy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g","caption":"Alexey Zvolinskiy"},"description":"Alexey is a test developer with solid experience in automation of web-applications using Java, TestNG and Selenium. He is so much into QA that even after work he provides training courses for junior QA engineers.","sameAs":["http:\/\/fruzenshtein.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/alexey-zvolinskiy"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/10966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/374"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=10966"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/10966\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=10966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=10966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=10966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}