{"id":22016,"date":"2014-02-28T01:00:14","date_gmt":"2014-02-27T23:00:14","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=22016"},"modified":"2014-02-27T22:41:56","modified_gmt":"2014-02-27T20:41:56","slug":"building-java-web-application-using-mybatis-with-spring","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html","title":{"rendered":"Building Java Web Application Using MyBatis With Spring"},"content":{"rendered":"<p>This post will show how to create a Student Enrollment Application using MYSQL DB with MyBatis framework in a Spring environment. This is a simple application that aims to collect the input details from the user during signup, save the details in the MYSQL DB and authenticate the same during login.<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<h2>1. Create Java Web Application Project using Maven Template<\/h2>\n<p>To begin with, in the IDE, create a Java Maven project with the template of maven-archetype-webapp (Filter the catalog based on the string \u201cwebapp\u201d) by providing appropriate values for GroupId and Artifact Id for the project. The sample web application directory structure is shown below with a standard deployment descriptor web.xml and Maven pom.xml<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/mybatislayout.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-22143\" alt=\"mybatislayout\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/mybatislayout.png\" width=\"296\" height=\"292\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/mybatislayout.png 296w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/mybatislayout-100x100.png 100w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/mybatislayout-42x42.png 42w\" sizes=\"(max-width: 296px) 100vw, 296px\" \/><\/a><\/p>\n<h2>2. Update pom.xml<\/h2>\n<p>To make the above Maven Java Web Application project support the MyBatis framework, add the following dependencies to the existing pom.xml:<\/p>\n<ul>\n<li>mybatis (for MyBatis support)<\/li>\n<li>mybatis-spring (for MyBatis-Spring integration support)<\/li>\n<li>jstl, spring-webmvc, servlet-api and spring-context-support (for Spring support)<\/li>\n<li>spring-test (may be optional, needed if Spring-test support is needed)<\/li>\n<li>mysql-connector-java (for MYSQL support)<\/li>\n<\/ul>\n<pre class=\" brush:xml\">&lt;dependency&gt;\r\n      &lt;groupId&gt;org.mybatis&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;mybatis&lt;\/artifactId&gt;\r\n      &lt;version&gt;3.1.1&lt;\/version&gt;\r\n    &lt;\/dependency&gt;\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.mybatis&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;mybatis-spring&lt;\/artifactId&gt;\r\n      &lt;version&gt;1.1.1&lt;\/version&gt;\r\n    &lt;\/dependency&gt;\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-context-support&lt;\/artifactId&gt;\r\n      &lt;version&gt;3.1.1.RELEASE&lt;\/version&gt;\r\n    &lt;\/dependency&gt;\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-test&lt;\/artifactId&gt;\r\n      &lt;version&gt;3.1.1.RELEASE&lt;\/version&gt;\r\n      &lt;scope&gt;test&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;mysql&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;mysql-connector-java&lt;\/artifactId&gt;\r\n      &lt;version&gt;5.1.21&lt;\/version&gt;\r\n    &lt;\/dependency&gt;\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;javax.servlet&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;jstl&lt;\/artifactId&gt;\r\n      &lt;version&gt;1.2&lt;\/version&gt;\r\n    &lt;\/dependency&gt;\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-webmvc&lt;\/artifactId&gt;\r\n      &lt;version&gt;3.2.4.RELEASE&lt;\/version&gt;\r\n    &lt;\/dependency&gt;\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;javax.servlet&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;servlet-api&lt;\/artifactId&gt;\r\n      &lt;version&gt;2.5&lt;\/version&gt;\r\n    &lt;\/dependency&gt;<\/pre>\n<h2>3. Modify web.xml<\/h2>\n<p>Modify the contents of the web.xml to include the following:<\/p>\n<ul>\n<li>A servlet and specify the location of the configuration file for the same. In this sample, a configuration file named springConfig.xml is created under WEB-INF\/config folder in the project layout.<\/li>\n<li>A servlet-mapping to map the servlet created in the above step that should be invoked when the client specifies the url matching the url pattern.<\/li>\n<\/ul>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;web-app version=\"2.5\"\r\nxmlns=\"http:\/\/java.sun.com\/xml\/ns\/javaee\"\r\nxmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\nxsi:schemaLocation=\"http:\/\/java.sun.com\/xml\/ns\/javaee http:\/\/java.sun.com\/xml\/ns\/javaee\/web-app_2_5.xsd\"&gt;\r\n\r\n&lt;servlet&gt;\r\n  &lt;servlet-name&gt;myBatisServlet&lt;\/servlet-name&gt;\r\n  &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;\/servlet-class&gt;\r\n  &lt;init-param&gt;\r\n      &lt;param-name&gt;contextConfigLocation&lt;\/param-name&gt;\r\n      &lt;param-value&gt;\/WEB-INF\/config\/springConfig.xml&lt;\/param-value&gt;\r\n  &lt;\/init-param&gt;\r\n&lt;\/servlet&gt;\r\n\r\n&lt;servlet-mapping&gt;\r\n  &lt;servlet-name&gt;myBatisServlet&lt;\/servlet-name&gt;\r\n  &lt;url-pattern&gt;*.html&lt;\/url-pattern&gt;\r\n&lt;\/servlet-mapping&gt;\r\n\r\n  &lt;display-name&gt;Archetype Created Web Application&lt;\/display-name&gt;\r\n&lt;\/web-app&gt;<\/pre>\n<h2>4. Create the Spring Configuration File<\/h2>\n<p>Create a Spring Bean Configuration file under the folder WEB-INF\/config. If STS(Spring Tool Suite) is the IDE, go ahead and enable the context, mvc and tx namespaces. The springConfig.xml will be as shown below<\/p>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;beans xmlns=\"http:\/\/www.springframework.org\/schema\/beans\"\r\n  xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n  xmlns:context=\"http:\/\/www.springframework.org\/schema\/context\"\r\n  xmlns:mvc=\"http:\/\/www.springframework.org\/schema\/mvc\"\r\n  xmlns:tx=\"http:\/\/www.springframework.org\/schema\/tx\"\r\n  xsi:schemaLocation=\"http:\/\/www.springframework.org\/schema\/mvc http:\/\/www.springframework.org\/schema\/mvc\/spring-mvc-3.2.xsd\r\n      http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd\r\n      http:\/\/www.springframework.org\/schema\/tx http:\/\/www.springframework.org\/schema\/tx\/spring-tx-3.1.xsd\r\n      http:\/\/www.springframework.org\/schema\/context http:\/\/www.springframework.org\/schema\/context\/spring-context-3.1.xsd\"&gt;\r\n\r\n&lt;\/beans&gt;<\/pre>\n<p>After enabling the required namespaces, include the following (in between the &lt;beans&gt; and &lt;\/beans&gt; tags) to indicate that the application is annotation driven and base package for the context component scan.<\/p>\n<pre class=\" brush:xml\">&lt;mvc:annotation-driven \/&gt;\r\n\r\n&lt;context:component-scan base-package=\"com.github.elizabetht\" \/&gt;<\/pre>\n<p>Include the bean InternalResourceViewResolver of Spring to locate the jsp files<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:xml\">&lt;bean class=\"org.springframework.web.servlet.view.InternalResourceViewResolver\"&gt;\r\n  &lt;property name=\"prefix\" value=\"\/WEB-INF\/jsp\/\" \/&gt;\r\n  &lt;property name=\"suffix\" value=\".jsp\" \/&gt;\r\n&lt;\/bean&gt;<\/pre>\n<p>Include the bean for data source, where the properties of the MYSQL DB like url, username and password can be specified. Replace &lt;include connection url&gt; with the actual connection url for connecting to the MYSQL DB. Likewise, replace &lt;include username&gt; and &lt;include password&gt; with the actual username and password values.<\/p>\n<pre class=\" brush:xml\">&lt;bean id=\"dataSource\" class=\"org.springframework.jdbc.datasource.DriverManagerDataSource\"&gt;\r\n  &lt;property name=\"driverClassName\" value=\"com.mysql.jdbc.Driver\" \/&gt;\r\n  &lt;property name=\"url\" value=\"jdbc:mysql\/\/&lt;include connection url&gt;:3306\/studentEnrollment?autoReconnect=true&amp;createDatabaseIfNotExist=true&amp;\" \/&gt;\r\n  &lt;property name=\"username\" value=\"&lt;include username&gt;\" \/&gt;\r\n  &lt;property name=\"password\" value=\"&lt;include password&gt;\" \/&gt;\r\n&lt;\/bean&gt;<\/pre>\n<p>Include the bean for transaction manager for scoping\/controlling the transactions, that takes the data source defined above as reference (dependent)<\/p>\n<pre class=\" brush:xml\">&lt;tx:annotation-driven transaction-manager=\"transactionManager\" \/&gt;\r\n&lt;bean id=\"transactionManager\" class=\"org.springframework.jdbc.datasource.DataSourceTransactionManager\"&gt;\r\n  &lt;property name=\"dataSource\" ref=\"dataSource\" \/&gt;\r\n&lt;\/bean&gt;<\/pre>\n<p>Coming to the MyBatis specific configurations, include the bean for sqlSessionFactory which is the central configuration in a MyBatis application. This bean takes in three properties \u2013 dataSource (already configured above)\u00a0 \u2013 typeAliasesPackage (location where the model classes of this application resides)\u00a0 \u2013 mapperLocations (location where the mapper xml files for the model resides \u2013 this is not needed here as annotation based configurations are used instead)<\/p>\n<p>More details of this can be read at <a href=\"http:\/\/mybatis.github.io\/mybatis-3\/\">http:\/\/mybatis.github.io\/mybatis-3\/<\/a><\/p>\n<pre class=\" brush:xml\">&lt;bean id=\"sqlSessionFactory\" class=\"org.mybatis.spring.SqlSessionFactoryBean\"&gt;\r\n  &lt;property name=\"dataSource\" ref=\"dataSource\" \/&gt;\r\n  &lt;property name=\"typeAliasesPackage\" value=\"com.github.elizabetht.model\"\/&gt;\r\n  &lt;property name=\"mapperLocations\" value=\"classpath*:com\/github\/elizabetht\/mappers\/*.xml\" \/&gt;\r\n&lt;\/bean&gt;<\/pre>\n<p>Include the bean for sqlSession<\/p>\n<pre class=\" brush:xml\">&lt;bean id=\"sqlSession\" class=\"org.mybatis.spring.SqlSessionTemplate\"&gt;\r\n  &lt;constructor-arg index=\"0\" ref=\"sqlSessionFactory\" \/&gt;\r\n&lt;\/bean&gt;<\/pre>\n<p>Next and finally, include the bean for MapperScannerConfigurer<\/p>\n<pre class=\" brush:xml\">&lt;bean class=\"org.mybatis.spring.mapper.MapperScannerConfigurer\"&gt;\r\n  &lt;property name=\"basePackage\" value=\"com.github.elizabetht.mappers\" \/&gt;\r\n&lt;\/bean&gt;<\/pre>\n<h2>5. Create JSP Files for Student Signup\/Login<\/h2>\n<p>Create a folder named \u201cjsp\u201d under WEB-INF (This is where the jsp files will be created as indicated in the springConfig.xml for the InternalResourceViewResolver bean).<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/signup.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-22144\" alt=\"signup\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/signup.png\" width=\"578\" height=\"359\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/signup.png 766w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/signup-300x186.png 300w\" sizes=\"(max-width: 578px) 100vw, 578px\" \/><\/a><\/p>\n<p>Create a file signup.jsp to include a form to get the input details like UserName, Password, FirstName, LastName, DateOfBirth and EmailAddress of the student. A snapshot of the signup page is as follows:<\/p>\n<p>Next, create a file login.jsp to include a form with UserName and Password. A snapshot of the login page is as follows:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/login.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-22146\" alt=\"login\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/login.png\" width=\"578\" height=\"215\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/login.png 785w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/login-300x111.png 300w\" sizes=\"(max-width: 578px) 100vw, 578px\" \/><\/a><\/p>\n<p>Also create success.jsp to indicate the login success and failure.jsp to indicate login failure (These are just pages used to display the contents \u2013 no processing logic involved).<\/p>\n<p>This application uses twitter bootstrap <a href=\"http:\/\/getbootstrap.com\/\">http:\/\/getbootstrap.com\/<\/a> and <a href=\"http:\/\/bootswatch.com\/united\/\">http:\/\/bootswatch.com\/united\/<\/a> as style sheets. It also uses a datepicker stylesheet as well to pop up a calendar for the DateOfBirth field in the Student Signup page (<a href=\"http:\/\/www.eyecon.ro\/bootstrap-datepicker\/\">http:\/\/www.eyecon.ro\/bootstrap-datepicker\/<\/a>).<\/p>\n<p>A reference link to the files under webapp folder of this application can be found at <a href=\"https:\/\/github.com\/elizabetht\/StudentEnrollmentWithMyBatis\/tree\/master\/src\/main\/webapp\">https:\/\/github.com\/elizabetht\/StudentEnrollmentWithMyBatis\/tree\/master\/src\/main\/webapp<\/a><\/p>\n<h2>6. Create packages for Controller, Model, Service and Mappers<\/h2>\n<p>Create packages each for the Spring Controller, Model and Service classes under the src\/main\/java folder. Also create a package for the MyBatis Mapper class under the same src\/main\/java folder.<\/p>\n<p>A sample snapshot of the project after the package creation is as shown below:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/mybatis-package.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-22148\" alt=\"mybatis-package\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/mybatis-package.png\" width=\"382\" height=\"166\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/mybatis-package.png 382w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/02\/mybatis-package-300x130.png 300w\" sizes=\"(max-width: 382px) 100vw, 382px\" \/><\/a><\/p>\n<h2>7. Create classes for Model Tier<\/h2>\n<p>Create a POJO class named Student.java inside the package com.github.elizabetht.model to include the details of the Student model entity during signup. Create another POJO class named StudentLogin.java inside the same package com.github.elizabetht.model to include the Student Login details.<\/p>\n<p>A reference link to the files for the Model classes can be found at <a href=\"https:\/\/github.com\/elizabetht\/StudentEnrollmentWithMyBatis\/tree\/master\/src\/main\/java\/com\/github\/elizabetht\/model\">https:\/\/github.com\/elizabetht\/StudentEnrollmentWithMyBatis\/tree\/master\/src\/main\/java\/com\/github\/elizabetht\/model<\/a><\/p>\n<h2>8. Create classes for MyBatis Mapper<\/h2>\n<p>A Mapper in MyBatis framework is similar to the Repository tier in a Spring environment. Crude SQL queries takes its place here. Create an interface class named StudentMapper.java inside the package com.github.elizabetht.mapper to support the database operations.<\/p>\n<p>There are two interface methods needed for the application\u2019s purpose.<\/p>\n<ul>\n<li>To Insert the Student Signup details into the Database<\/li>\n<li>To Verify the Student Login details from the Database<\/li>\n<\/ul>\n<pre class=\" brush:sql\">public interface StudentMapper {\r\n  @Insert(\"INSERT INTO student(userName, password, firstName,\"\r\n          + \"lastName, dateOfBirth, emailAddress) VALUES\"\r\n          + \"(#{userName},#{password}, #{firstName}, #{lastName},\"\r\n          + \"#{dateOfBirth}, #{emailAddress})\")\r\n  @Options(useGeneratedKeys=true, keyProperty=\"id\", flushCache=true, keyColumn=\"id\")\r\n  public void insertStudent(Student student);\r\n\r\n  @Select(\"SELECT USERNAME as userName, PASSWORD as password, \"\r\n          + \"FIRSTNAME as firstName, LASTNAME as lastName, \"\r\n          + \"DATEOFBIRTH as dateOfBirth, EMAILADDRESS as emailAddress \"\r\n          + \"FROM student WHERE userName = #{userName}\")\r\n  public Student getStudentByUserName(String userName);\r\n\r\n}<\/pre>\n<h2>9. Create classes for Service Tier<\/h2>\n<p>Create an interface class named StudentService.java inside the package com.github.elizabetht.service to support the service tier operations.<\/p>\n<pre class=\" brush:java\">public interface StudentService {\r\n  void insertStudent(Student student);\r\n  boolean getStudentByLogin(String userName, String password);\r\n  boolean getStudentByUserName(String userName);\r\n}<\/pre>\n<p>Create a service tier implementation class (a POJO indeed) named StudentServiceImpl.java inside the package com.github.elizabetht.service. This is where the application logic goes \u2013 either to save the student details into the database or to verify the student (already saved) details from the database.<\/p>\n<pre class=\" brush:java\">@Service(\"studentService\")\r\npublic class StudentServiceImpl implements StudentService {\r\n\r\n  @Autowired\r\n  private StudentMapper studentMapper;\r\n\r\n  @Transactional\r\n  public void insertStudent(Student student) {        \r\n      studentMapper.insertStudent(student);\r\n  }\r\n\r\n  public boolean getStudentByLogin(String userName, String password) {        \r\n      Student student = studentMapper.getStudentByUserName(userName);\r\n\r\n      if(student != null &amp;&amp; student.getPassword().equals(password)) {\r\n          return true;\r\n      }\r\n\r\n      return false;\r\n  }\r\n\r\n  public boolean getStudentByUserName(String userName) {\r\n      Student student = studentMapper.getStudentByUserName(userName);\r\n\r\n      if(student != null) {\r\n          return true;\r\n      }\r\n\r\n      return false;\r\n  }\r\n\r\n}<\/pre>\n<blockquote>\n<p>When using MyBatis with Spring, a mapper can be directly injected into the service tier. This is probably the strongest point of the Spring integration of MyBatis. This is the only tool that I am aware that lets to build the application with no imports to it.<\/p>\n<p><strong>@EduardoMacarron<\/strong> <cite><a href=\"https:\/\/twitter.com\/EduardoMacarron\">twitter.com\/EduardoMacarron\/\u2026<\/a><\/cite><\/p>\n<\/blockquote>\n<h2>10. Create class for Controller Tier<\/h2>\n<p>Create a Controller tier POJO class named StudentController.java inside the package com.github.elizabetht.controller. This is where the routing logic of the application goes \u2013 whether a signup or login action is called.<\/p>\n<pre class=\" brush:java\">@Controller\r\n@SessionAttributes(\"student\")\r\npublic class StudentController {\r\n\r\n  @Autowired\r\n  private StudentService studentService;\r\n\r\n  @RequestMapping(value=\"\/signup\", method=RequestMethod.GET)\r\n  public String signup(Model model) {\r\n      Student student = new Student();\r\n      model.addAttribute(\"student\", student);\r\n      return \"signup\";\r\n  }\r\n\r\n  @RequestMapping(value=\"\/signup\", method=RequestMethod.POST)\r\n  public String signup(@ModelAttribute(\"student\") Student student, Model model) {\r\n      if(studentService.getStudentByUserName(student.getUserName())) {\r\n          model.addAttribute(\"message\", \"User Name exists. Try another user name\");\r\n          return \"signup\";\r\n      } else {\r\n          studentService.insertStudent(student);\r\n          model.addAttribute(\"message\", \"Saved student details\");\r\n          return \"redirect:login.html\";\r\n      }\r\n  }\r\n\r\n  @RequestMapping(value=\"\/login\", method=RequestMethod.GET)\r\n  public String login(Model model) {\r\n      StudentLogin studentLogin = new StudentLogin();\r\n      model.addAttribute(\"studentLogin\", studentLogin);\r\n      return \"login\";\r\n  }\r\n\r\n  @RequestMapping(value=\"\/login\", method=RequestMethod.POST)\r\n  public String login(@ModelAttribute(\"studentLogin\") StudentLogin studentLogin) {\r\n      boolean found = studentService.getStudentByLogin(studentLogin.getUserName(), studentLogin.getPassword());\r\n      if (found) {                \r\n          return \"success\";\r\n      } else {                \r\n          return \"failure\";\r\n      }\r\n  }\r\n}<\/pre>\n<h2>11. Create the DB Schema in a MYSQL DB<\/h2>\n<p>Connect to the MySQL DB which is to be used for this application and create a new DB Schema named studentEnrollment using the MySQL Workbench. This is necessary as the DB Schema name of studentEnrollment is specified in the dataSource bean in springConfig.xml<\/p>\n<p>Once the studentEnrollment DB Schema is created, create a table named student inside the DB Schema using the CREATE TABLE statement as follows:<\/p>\n<pre class=\" brush:sql\">CREATE TABLE `student` (\r\n  `id` bigint(20) NOT NULL AUTO_INCREMENT,\r\n  `dateOfBirth` datetime NOT NULL,\r\n  `emailAddress` varchar(255) NOT NULL,\r\n  `firstName` varchar(255) NOT NULL,\r\n  `lastName` varchar(255) NOT NULL,\r\n  `password` varchar(8) NOT NULL,\r\n  `userName` varchar(20) NOT NULL,\r\n  PRIMARY KEY (`id`)\r\n) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=latin1;<\/pre>\n<h2>12. Deploying the Application on Tomcat Server<\/h2>\n<p>Once the above steps are complete and the project is successfully built, the Java web application is ready to deployed on the Tomcat Server 7.<\/p>\n<p>The Java web application can be deployed locally by right clicking on the project and choosing the \u201cRun As-&gt;Run on Server\u201d option.<\/p>\n<p>The same can be deployed remotely on any native server that supports Tomcat by copying the WAR file (Right click on the project and choose Export as WAR File option) to \/var\/lib\/tomcat7 folder (or appropriate tomcat directory) and restarting the tomcat server.<\/p>\n<p>This application is available for a demo here: <a href=\"http:\/\/ec2-23-20-137-135.compute-1.amazonaws.com:8080\/StudentEnrollmentWithMyBatis\/\">http:\/\/ec2-23-20-137-135.compute-1.amazonaws.com:8080\/StudentEnrollmentWithMyBatis\/<\/a><\/p>\n<h2>13. Clone or Download code<\/h2>\n<p>If using git, clone a copy of this project here: <a href=\"https:\/\/github.com\/elizabetht\/StudentEnrollmentWithMyBatis.git\">https:\/\/github.com\/elizabetht\/StudentEnrollmentWithMyBatis.git<\/a><\/p>\n<p>In case of not using git, download the project as ZIP or tar.gz file here: <a href=\"https:\/\/github.com\/elizabetht\/StudentEnrollmentWithMyBatis\/releases\/tag\/1.7\">https:\/\/github.com\/elizabetht\/StudentEnrollmentWithMyBatis\/releases\/tag\/1.7<\/a><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:\/\/elizabetht.github.io\/blog\/2013\/11\/21\/student-enrollment-using-mybatis-with-spring\/\">Building Java Web Application Using MyBatis With Spring<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Elizabeth Thomas at the <a href=\"http:\/\/elizabetht.github.io\/\">My Experiments with Technology<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This post will show how to create a Student Enrollment Application using MYSQL DB with MyBatis framework in a Spring environment. This is a simple application that aims to collect the input details from the user during signup, save the details in the MYSQL DB and authenticate the same during login. &nbsp; &nbsp; 1. Create &hellip;<\/p>\n","protected":false},"author":537,"featured_media":189,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[338,30],"class_list":["post-22016","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-mybatis","tag-spring"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Building Java Web Application Using MyBatis With Spring<\/title>\n<meta name=\"description\" content=\"This post will show how to create a Student Enrollment Application using MYSQL DB with MyBatis framework in a Spring environment. This is a simple\" \/>\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\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building Java Web Application Using MyBatis With Spring\" \/>\n<meta property=\"og:description\" content=\"This post will show how to create a Student Enrollment Application using MYSQL DB with MyBatis framework in a Spring environment. This is a simple\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.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=\"2014-02-27T23:00:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mybatis-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=\"Elizabeth Thomas\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/email2eliza\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Elizabeth Thomas\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.html\"},\"author\":{\"name\":\"Elizabeth Thomas\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/dd68cf7f75b48b4c5e599eb63bd47873\"},\"headline\":\"Building Java Web Application Using MyBatis With Spring\",\"datePublished\":\"2014-02-27T23:00:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.html\"},\"wordCount\":1321,\"commentCount\":12,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/mybatis-logo.jpg\",\"keywords\":[\"MyBatis\",\"Spring\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.html\",\"name\":\"Building Java Web Application Using MyBatis With Spring\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/mybatis-logo.jpg\",\"datePublished\":\"2014-02-27T23:00:14+00:00\",\"description\":\"This post will show how to create a Student Enrollment Application using MYSQL DB with MyBatis framework in a Spring environment. This is a simple\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/mybatis-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/mybatis-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/building-java-web-application-using-mybatis-with-spring.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\":\"Building Java Web Application Using MyBatis With Spring\"}]},{\"@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\\\/dd68cf7f75b48b4c5e599eb63bd47873\",\"name\":\"Elizabeth Thomas\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/510d05b346afd1fa3f163410a88e365f3299ecc78dbbd86a7cc236d896b2a852?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/510d05b346afd1fa3f163410a88e365f3299ecc78dbbd86a7cc236d896b2a852?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/510d05b346afd1fa3f163410a88e365f3299ecc78dbbd86a7cc236d896b2a852?s=96&d=mm&r=g\",\"caption\":\"Elizabeth Thomas\"},\"description\":\"Elizabeth Thomas is an enthusiastic Java developer, an avid learner, a technology enthusiast and a beginner runner.\",\"sameAs\":[\"http:\\\/\\\/blog.meygam.com\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/email2eliza\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/elizabeth-thomas\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Building Java Web Application Using MyBatis With Spring","description":"This post will show how to create a Student Enrollment Application using MYSQL DB with MyBatis framework in a Spring environment. This is a simple","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\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html","og_locale":"en_US","og_type":"article","og_title":"Building Java Web Application Using MyBatis With Spring","og_description":"This post will show how to create a Student Enrollment Application using MYSQL DB with MyBatis framework in a Spring environment. This is a simple","og_url":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2014-02-27T23:00:14+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mybatis-logo.jpg","type":"image\/jpeg"}],"author":"Elizabeth Thomas","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/email2eliza","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Elizabeth Thomas","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html"},"author":{"name":"Elizabeth Thomas","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/dd68cf7f75b48b4c5e599eb63bd47873"},"headline":"Building Java Web Application Using MyBatis With Spring","datePublished":"2014-02-27T23:00:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html"},"wordCount":1321,"commentCount":12,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mybatis-logo.jpg","keywords":["MyBatis","Spring"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html","url":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html","name":"Building Java Web Application Using MyBatis With Spring","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mybatis-logo.jpg","datePublished":"2014-02-27T23:00:14+00:00","description":"This post will show how to create a Student Enrollment Application using MYSQL DB with MyBatis framework in a Spring environment. This is a simple","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mybatis-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mybatis-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/building-java-web-application-using-mybatis-with-spring.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":"Building Java Web Application Using MyBatis With Spring"}]},{"@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\/dd68cf7f75b48b4c5e599eb63bd47873","name":"Elizabeth Thomas","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/510d05b346afd1fa3f163410a88e365f3299ecc78dbbd86a7cc236d896b2a852?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/510d05b346afd1fa3f163410a88e365f3299ecc78dbbd86a7cc236d896b2a852?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/510d05b346afd1fa3f163410a88e365f3299ecc78dbbd86a7cc236d896b2a852?s=96&d=mm&r=g","caption":"Elizabeth Thomas"},"description":"Elizabeth Thomas is an enthusiastic Java developer, an avid learner, a technology enthusiast and a beginner runner.","sameAs":["http:\/\/blog.meygam.com\/","https:\/\/x.com\/https:\/\/twitter.com\/email2eliza"],"url":"https:\/\/www.javacodegeeks.com\/author\/elizabeth-thomas"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/22016","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\/537"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=22016"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/22016\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/189"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=22016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=22016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=22016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}