{"id":301,"date":"2010-07-06T02:24:00","date_gmt":"2010-07-06T02:24:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/aspect-oriented-programming-with-spring-aspectj-and-maven.html"},"modified":"2012-10-21T19:17:21","modified_gmt":"2012-10-21T19:17:21","slug":"aspect-oriented-programming-with-spring","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html","title":{"rendered":"Aspect Oriented Programming with Spring AspectJ and Maven"},"content":{"rendered":"<p><a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> framework comes with <a href=\"http:\/\/aopalliance.sourceforge.net\/\">AOP<\/a> support. In fact, as stated in <a href=\"http:\/\/static.springsource.org\/spring\/docs\/2.5.x\/reference\/aop.html\">Spring reference documentation<\/a>, <\/p>\n<p>\u201c<i>One of the key components of Spring is the AOP framework. While the Spring IoC container does not depend on AOP, meaning you do not need to use AOP if you don&#8217;t want to, AOP complements Spring IoC to provide a very capable middleware solution. AOP is used in the Spring Framework to&#8230;<\/i><\/p>\n<ul>\n<li><i>&#8230; provide declarative enterprise services, especially as a replacement for EJB declarative services. The most important such service is declarative transaction management.<\/i><i>&nbsp;<\/i><\/li>\n<li><i>&#8230; allow users to implement custom aspects, complementing their use of OOP with AOP.<\/i>\u201d<\/li>\n<\/ul>\n<p>Nevertheless <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> <a href=\"http:\/\/aopalliance.sourceforge.net\/\">AOP<\/a> framework comes with certain limitations in comparison to a complete <a href=\"http:\/\/aopalliance.sourceforge.net\/\">AOP<\/a> implementation, such as <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a>. The most common problems people encounter while working with <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> <a href=\"http:\/\/aopalliance.sourceforge.net\/\">AOP<\/a> framework derive from the fact that <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> <a href=\"http:\/\/aopalliance.sourceforge.net\/\">AOP<\/a> is \u201cproxy \u2013 based\u201d. In other words when a bean is used as a dependency and its method(s) should be advised by particular aspect(s) the IoC container injects an \u201caspect \u2013 aware\u201d bean proxy instead of the bean itself. Method invocations are performed against the proxy bean instance, transparently to the user, in order for aspect logic to be executed before and\/or after delegating the call to the actual \u201cproxy\u2013ed\u201d bean.<\/p>\n<p>Furthermore <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> <a href=\"http:\/\/aopalliance.sourceforge.net\/\">AOP<\/a> framework uses either JDK dynamic proxies or <a href=\"http:\/\/cglib.sourceforge.net\/\">CGLIB<\/a> to create the proxy for a given target object. The first one can create proxies only for the interfaces whilst the second is able to proxy concrete classes but with certain limitations. In particular, as stated in <a href=\"http:\/\/static.springframework.org\/spring\/docs\/2.5.x\/reference\/aop.html#aop-proxying\">Spring reference documentation<\/a>,<\/p>\n<p>\u201c<i>If the target object to be proxied implements at least one interface then a JDK dynamic proxy will be used. All of the interfaces implemented by the target type will be proxied. If the target object does not implement any interfaces then a CGLIB proxy will be created.<\/i>\u201d<\/p>\n<p>To summarize, when working with <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> <a href=\"http:\/\/aopalliance.sourceforge.net\/\">AOP<\/a> framework you should have two important things in mind :<\/p>\n<ol>\n<li>If your \u201cproxy\u2013ed\u201d bean implements at least one interface, the proxy bean can ONLY be casted to that interface(s). If you try to cast it to the \u201cproxy\u2013ed\u201d bean class, then you should expect a ClassCastException to be thrown at runtime. Nevertheless <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> <a href=\"http:\/\/aopalliance.sourceforge.net\/\">AOP<\/a> framework provides the option to force <a href=\"http:\/\/cglib.sourceforge.net\/\">CGLIB<\/a> proxying but with the aforementioned limitations (please refer to the relevant chapter of <a href=\"http:\/\/static.springframework.org\/spring\/docs\/2.5.x\/reference\/aop.html#aop-proxying\">Spring reference documentation<\/a>)<\/li>\n<li>Aspects do not apply to intra\u2013operation  calls. Meaning that there is no way for the proxy to intercept the calling of a method originated from another method of the same \u201cproxy\u2013ed\u201d bean<\/li>\n<\/ol>\n<p>Our recommendation of overcoming the above issues is to use <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> weaving. In other words to inject aspect logic directly to the target class and remove the necessity to have all methods being proxied. There are three ways to inject instructions implied by <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> aspects :<\/p>\n<ol>\n<li>compile time weaving \u2013 compile either target source or aspect classes via the <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> compiler<\/li>\n<li>post compile weaving \u2013 inject aspect instructions to already compiled classes<\/li>\n<li>load time weaving \u2013 inject aspect instructions to the byte code during class loading<\/li>\n<\/ol>\n<p>It&#8217;s possible to use any of the approaches mentioned above. In this tutorial we will present how to use <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> compile time weaving with <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> and <a href=\"http:\/\/maven.apache.org\/\">Maven<\/a>. We are going to implement a minimal \u201cgreeting\u201d <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> service and a relevant \u201cgreeting\u201d <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> aspect. <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> service method calls will be intercepted by the <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> aspect. The <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> aspect will enrich <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> service \u201cgreeting\u201d message with its own \u201cgreeting\u201d message. The  \u201cgreeting\u201d message of the <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> aspect will be injected from the <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> container, just to show how you can inject <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> dependences to <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> aspects.<\/p>\n<p><a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> users who have already implemented aspects for their bean services can switch to <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> transparently, meaning that no special code needs to be written since <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> <a href=\"http:\/\/aopalliance.sourceforge.net\/\">AOP<\/a> framework uses a subset of <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> pointcut expression language, and @AspectJ <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> aspects are fully eligible for <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> weaving.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Our preferred development environment is <a href=\"http:\/\/www.eclipse.org\/\">Eclipse<\/a>, so as a prerequisite you must have <a href=\"http:\/\/www.eclipse.org\/\">Eclipse<\/a> with <a href=\"http:\/\/maven.apache.org\/\">Maven<\/a> support installed. The installation of <a href=\"http:\/\/maven.apache.org\/\">Maven<\/a> plugin for <a href=\"http:\/\/www.eclipse.org\/\">Eclipse<\/a> is out of the scope of this tutorial and will not be discussed. Nevertheless you will need the following components :<\/p>\n<ol>\n<li>Eclipse from <a href=\"http:\/\/www.eclipse.org\/downloads\/\">here<\/a><\/li>\n<li>Maven Plugin for Eclipse from <a href=\"http:\/\/m2eclipse.sonatype.org\/\">here<\/a><\/li>\n<\/ol>\n<p>We will be using Eclipse Galileo, \u201em2eclipse\u201c Maven Integration for Eclipse Plugin version 0.10.0, Spring version 3.0.1, aspectjrt version 1.6.7 and aspectj-maven-plugin version 1.3 for this tutorial.<\/p>\n<p>Lets begin,<\/p>\n<ol>\n<li>Create a new Maven project, go to File ? Project ? Maven ? Maven Project<\/li>\n<li>In the \u201eSelect project name and location\u201c page of the wizard, make sure that \u201eCreate a simple project (skip archetype selection)\u201c option is unchecked, hit \u201eNext\u201c to continue with default values<\/li>\n<li>In the \u201eSelect an Archetype\u201c page of the wizard, select \u201eNexus Indexer\u201c at the \u201eCatalog\u201c drop down list and after the archetypes selection area is refreshed, select the \u201ewebapp-jee5\u201c archetype from \u201eorg.codehaus.mojo.archetypes\u201c to use. You can use the \u201efilter\u201c text box to narrow search results. Hit \u201eNext\u201c to continue<\/li>\n<li>In the \u201eEnter an artifact id\u201c page of the wizard, you can define the name and main package of your project. We will set the \u201eGroup Id\u201c variable to \u201ecom.javacodegeeks\u201c and the \u201eArtifact Id\u201c variable to \u201easpectjspring\u201c. The aforementioned selections compose the main project package as \u201ecom.javacodegeeks.aspectjspring \u201c and the project name as \u201easpectjspring\u201c. Hit \u201eFinish\u201c to exit the wizard and to create your project<\/li>\n<\/ol>\n<p>Let&#8217;s recap a few things about the <a href=\"http:\/\/maven.apache.org\/\">Maven<\/a> Web project structure<\/p>\n<ol>\n<li>\/src\/main\/java folder contains source files for the dynamic content of the application<\/li>\n<li>\/src\/test\/java folder contains all source files for unit tests<\/li>\n<li>\/src\/main\/webapp folder contains essential files for creating a valid web application, e.g. \u201eweb.xml\u201c<\/li>\n<li>\/target folder contains the compiled and packaged deliverables<\/li>\n<li>The \u201epom.xml\u201c is the project object model (POM) file. The single file that contains all project related configuration.<\/li>\n<\/ol>\n<p>In order to properly use <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> at runtime, we must provide all necessary libraries to the web application. Open the graphical editor of your \u201epom.xml\u201c and perform the following changes :<\/p>\n<ol>\n<li>Locate the \u201eProperties\u201c section at the \u201eOverview\u201c page of the POM editor and perform the following changes :<\/li>\n<ul>\n<li>Create a new property with name <strong>org.springframework.version<\/strong> and value <strong>3.0.1.RELEASE<\/strong><\/li>\n<\/ul>\n<ol><\/ol>\n<ul>\n<li>Create a new property with name <strong>maven.compiler.source<\/strong> and value according to the version of your Java runtime environment, we will use <strong>1.6<\/strong><\/li>\n<\/ul>\n<ol><\/ol>\n<ul>\n<li>Create a new property with name <strong>maven.compiler.target<\/strong> and value according to the version of your Java runtime environment, we will use <strong>1.6<\/strong><\/li>\n<\/ul>\n<ol><\/ol>\n<li>Navigate to the \u201eDependencies\u201c page of the POM editor and create the following dependencies (you should fill the \u201eGroupId\u201c, \u201eArtifact Id\u201c and \u201eVersion\u201c fields of the \u201eDependency Details\u201c section at that page) :<\/li>\n<ul>\n<li>Group Id : <strong>org.springframework<\/strong> Artifact Id : <strong>spring-web<\/strong> Version : <strong>${org.springframework.version}<\/strong><\/li>\n<\/ul>\n<ol><\/ol>\n<ul>\n<li>Group Id : <strong>org.aspectj<\/strong> Artifact Id : <strong>aspectjrt<\/strong> Version : <strong>1.6.7<\/strong><\/li>\n<\/ul>\n<ol><\/ol>\n<li>Navigate to the \u201cPlugins\u201d page of the POM editor and create the following plugin (you should fill the \u201eGroupId\u201c, \u201eArtifact Id\u201c and \u201eVersion\u201c fields of the \u201ePlugin Details\u201c section at that page) :<\/li>\n<ul>\n<li>Group Id : <strong>org.codehaus.mojo<\/strong> Artifact Id : <strong>aspectj-maven-plugin<\/strong> Version : <strong>1.3<\/strong><\/li>\n<\/ul>\n<ol><\/ol>\n<li>At the \u201cPlugins\u201d page of the POM editor, select the newly created plugin (from the \u201cPlugins\u201d section), and bind it to the compile execution goal. To do so, locate the \u201cExecution\u201d section and create a new execution. At the \u201cExecution Details\u201d section create a new goal and name it \u201c<strong>compile<\/strong>\u201d<\/li>\n<li>The newly created plugin needs one final configuration change. We must define what version of Java runtime environment we are using in order for the <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> compiler to properly weave aspect classes. We need to edit the \u201cpom.xml\u201d file to perform the change. Select the \u201cpom.xml\u201d page of the POM editor, locate the newly created plugin and alter it as follows :<\/li>\n<pre class=\"brush: xml\">&lt;plugin&gt;\r\n &lt;groupId&gt;org.codehaus.mojo&lt;\/groupId&gt;\r\n &lt;artifactId&gt;aspectj-maven-plugin&lt;\/artifactId&gt;\r\n &lt;version&gt;1.3&lt;\/version&gt;\r\n &lt;configuration&gt;\r\n  &lt;source&gt;${maven.compiler.source}&lt;\/source&gt;\r\n  &lt;target&gt;${maven.compiler.target}&lt;\/target&gt;\r\n &lt;\/configuration&gt;\r\n &lt;executions&gt;\r\n  &lt;execution&gt;\r\n   &lt;goals&gt;\r\n    &lt;goal&gt;compile&lt;\/goal&gt;\r\n   &lt;\/goals&gt;\r\n  &lt;\/execution&gt;\r\n &lt;\/executions&gt;\r\n&lt;\/plugin&gt;<\/pre>\n<li> Finally change the \u201cmaven-compiler-plugin\u201d as shown below : <\/li>\n<pre class=\"brush: xml\">&lt;plugin&gt;\r\n &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\r\n &lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt;\r\n &lt;version&gt;2.0.2&lt;\/version&gt;\r\n &lt;configuration&gt;\r\n  &lt;source&gt;${maven.compiler.source}&lt;\/source&gt;\r\n  &lt;target&gt;${maven.compiler.target}&lt;\/target&gt;\r\n &lt;\/configuration&gt;\r\n&lt;\/plugin&gt;\r\n<\/pre>\n<\/ol>\n<p>As you can see <a href=\"http:\/\/maven.apache.org\/\">Maven<\/a> manages library dependencies declaratively. A local repository is created (by default under {user_home}\/.m2 folder) and all required libraries are downloaded and placed there from public repositories. Furthermore intra \u2013 library dependencies are automatically resolved and manipulated.<\/p>\n<p>The next step is to provide hooks for the web application so as to load the <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> context upon startup.<\/p>\n<p>Locate the \u201eweb.xml\u201c file under \/src\/main\/webapp\/WEB-INF and add the following :<\/p>\n<p>For loading the <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> context upon startup,<\/p>\n<pre class=\"brush: xml\">&lt;listener&gt;\r\n &lt;listener-class&gt;\r\n  org.springframework.web.context.ContextLoaderListener\r\n &lt;\/listener-class&gt;\r\n&lt;\/listener&gt;\r\n<\/pre>\n<p>Now lets create the applicationContext.xml file that will drive <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> container. Create the file under \/src\/main\/webapp\/WEB-INF directory. An example \u201eapplicationContext.xml\u201c is presented below<\/p>\n<pre class=\"brush: xml\">&lt;beans xmlns=\"http:\/\/www.springframework.org\/schema\/beans\"\r\n xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xmlns:p=\"http:\/\/www.springframework.org\/schema\/p\"\r\n xmlns:aop=\"http:\/\/www.springframework.org\/schema\/aop\" xmlns:context=\"http:\/\/www.springframework.org\/schema\/context\"\r\n xmlns:jee=\"http:\/\/www.springframework.org\/schema\/jee\" xmlns:tx=\"http:\/\/www.springframework.org\/schema\/tx\"\r\n xmlns:task=\"http:\/\/www.springframework.org\/schema\/task\"\r\n xsi:schemaLocation=\"\r\n   http:\/\/www.springframework.org\/schema\/aop http:\/\/www.springframework.org\/schema\/aop\/spring-aop-3.0.xsd\r\n   http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans-3.0.xsd\r\n   http:\/\/www.springframework.org\/schema\/context http:\/\/www.springframework.org\/schema\/context\/spring-context-3.0.xsd\r\n   http:\/\/www.springframework.org\/schema\/jee http:\/\/www.springframework.org\/schema\/jee\/spring-jee-3.0.xsd\r\n   http:\/\/www.springframework.org\/schema\/tx http:\/\/www.springframework.org\/schema\/tx\/spring-tx-3.0.xsd\r\n   http:\/\/www.springframework.org\/schema\/task http:\/\/www.springframework.org\/schema\/task\/spring-task-3.0.xsd\"&gt;\r\n\r\n &lt;context:component-scan base-package=\"com.javacodegeeks.aspectjspring\" \/&gt;\r\n \r\n &lt;bean class=\"com.javacodegeeks.aspectjspring.aspects.GreetingAspect\" factory-method=\"aspectOf\"&gt;\r\n     &lt;property name=\"message\" value=\"Hello from Greeting Aspect\"\/&gt;\r\n &lt;\/bean&gt;\r\n\r\n&lt;\/beans&gt;\r\n<\/pre>\n<p>Things to notice here :<\/p>\n<ol>\n<li>Change the base-package attribute of the context:component-scan element to whatever is the base package of your project so as to be scanned for <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> components<\/li>\n<li>We have to define our aspects in \u201capplicationContext.xml\u201d only if we want to inject dependences to them<\/li>\n<li><a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> denotes the term of  \u201caspect association\u201d. It defines how to manage aspect state. The following state associations are supported:<\/li>\n<ul>\n<li>Per JVM \u2013 one shared aspect instance is constructed and used (default)<\/li>\n<li>Per object \u2013 aspect has its own state per every advised object<\/li>\n<li>Per control flow \u2013 aspect has its own state per particular control flow<br \/>\nAll <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> aspect classes have \u201chasAspect()\u201d and \u201caspectOf()\u201d static methods. These methods are implicitly generated by <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> compiler\/load time weaver. So, for the default aspect state there is a single aspect instance that can be retrieved using the \u201caspectOf()\u201d method<\/li>\n<\/ul>\n<\/ol>\n<p>Lets create now the \u201cgreeting\u201d <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> service and the relevant \u201cgreeting\u201d <a href=\"http:\/\/www.eclipse.org\/aspectj\/\">AspectJ<\/a> aspect. Create a sub \u2013 package named \u201cservices\u201d under your main package and place the \u201cGreetingService\u201d class there. An example \u201cgreeting\u201d service is shown below :<\/p>\n<pre class=\"brush: java\">package com.javacodegeeks.aspectjspring.services;\r\n\r\nimport org.springframework.stereotype.Service;\r\n\r\n@Service(\"greetingService\")\r\npublic class GreetingService {\r\n\r\n public String sayHello() {\r\n  return \"Hello from Greeting Service\";\r\n }\r\n \r\n}\r\n<\/pre>\n<p>Create a sub \u2013 package named \u201caspects\u201d under your main package and place the \u201cGreetingAspect\u201d class there. An example \u201cgreeting\u201d aspect is shown below :<\/p>\n<pre class=\"brush: java\">package com.javacodegeeks.aspectjspring.aspects;\r\n\r\nimport org.aspectj.lang.ProceedingJoinPoint;\r\nimport org.aspectj.lang.annotation.Around;\r\nimport org.aspectj.lang.annotation.Aspect;\r\n\r\n@Aspect\r\npublic class GreetingAspect {\r\n\r\n private String message;\r\n\r\n public void setMessage(String message) {\r\n  this.message = message;\r\n }\r\n\r\n @Around(\"execution(* com.javacodegeeks.aspectjspring.services.GreetingService.*(..))\")\r\n public Object advice(ProceedingJoinPoint pjp) throws Throwable {\r\n  String serviceGreeting = (String) pjp.proceed();\r\n  return message + \" and \" + serviceGreeting;\r\n }\r\n \r\n}\r\n<\/pre>\n<p>Finally locate the main Web page of your project, \u201cindex.jsp\u201d, under \/src\/main\/webapp folder and alter it as follows :<\/p>\n<pre class=\"brush: xml\">&lt;%@ page language=\"java\" import=\"org.springframework.web.context.WebApplicationContext, org.springframework.web.context.support.WebApplicationContextUtils, com.javacodegeeks.aspectjspring.services.GreetingService\"%&gt;\r\n&lt;%@page contentType=\"text\/html\" pageEncoding=\"UTF-8\"%&gt;\r\n&lt;!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\"\r\n   \"http:\/\/www.w3.org\/TR\/html4\/loose.dtd\"&gt;\r\n\r\n&lt;% \r\nWebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(getServletContext());\r\nGreetingService greetingService = (GreetingService) webApplicationContext.getBean(\"greetingService\");\r\n%&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n        &lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\"&gt;\r\n        &lt;title&gt;JSP Page&lt;\/title&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;h1&gt;Test service invoked and greets you by saying : &lt;%=greetingService.sayHello()%&gt;&lt;\/h1&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>Things to notice here :<\/p>\n<ol>\n<li>Upon page load, we retrieve the <a href=\"http:\/\/www.springsource.org\/\">Spring<\/a> Web application context, and lookup our \u201cgreeting\u201d service. All we have to do is to invoke the \u201csayHello()\u201d method to see the combined greeting message from our aspect and the service<\/li>\n<\/ol>\n<p>To build the application right click on your project ? Run As ? Maven package<\/p>\n<p>To deploy the web application just copy the \u201e.war\u201c file from the \u201etarget\u201c directory to <a href=\"http:\/\/tomcat.apache.org\/\">Apache \u2013 Tomcat<\/a> \u201cwebapps\u201d folder<\/p>\n<p>To lunch the application point your browser to the following address<\/p>\n<p>http:\/\/localhost:8080\/{application_name}\/<\/p>\n<p>If all went well you should see your main web page displaying  the following :<\/p>\n<p>\u201cTest service invoked and greets you by saying : Hello from Greeting Aspect and Hello from Greeting Service\u201d<\/p>\n<p>You can download the project from <a href=\"http:\/\/dl.dropbox.com\/u\/7215751\/JavaCodeGeeks\/AspectJSpringTutorial\/AspectJSpringProject.zip\">here<\/a><\/p>\n<p>Hope you liked it<\/p>\n<p>Justin<\/p>\n<p><strong><i>Related Articles :<\/i><\/strong><\/p>\n<ul>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/05\/gwt-2-spring-3-jpa-2-hibernate-35.html\">GWT 2 Spring 3 JPA 2 Hibernate 3.5 Tutorial<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/06\/gwt-spring-and-hibernate-enter-world-of.html\">GWT Spring and Hibernate enter the world of Data Grids<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/06\/spring-3-restful-web-services.html\">Spring 3 RESTful Web Services<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/07\/gwt-2-spring-3-jpa-2-hibernate-35.html\">GWT 2 Spring 3 JPA 2 Hibernate 3.5 Tutorial \u2013 Eclipse and Maven 2 showcase<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/11\/jaxws-with-spring-and-maven-tutorial.html\">JAX\u2013WS with Spring and Maven Tutorial<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Spring framework comes with AOP support. In fact, as stated in Spring reference documentation, \u201cOne of the key components of Spring is the AOP framework. While the Spring IoC container does not depend on AOP, meaning you do not need to use AOP if you don&#8217;t want to, AOP complements Spring IoC to provide a &hellip;<\/p>\n","protected":false},"author":4,"featured_media":88,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[68,32,74,73,29,30],"class_list":["post-301","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-maven","tag-apache-tomcat","tag-aspect-oriented-programming","tag-aspectj","tag-eclipse","tag-spring"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Aspect Oriented Programming with Spring AspectJ and Maven - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Spring framework comes with AOP support. In fact, as stated in Spring reference documentation, \u201cOne of the key components of Spring is the AOP framework.\" \/>\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\/2010\/07\/aspect-oriented-programming-with-spring.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Aspect Oriented Programming with Spring AspectJ and Maven - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Spring framework comes with AOP support. In fact, as stated in Spring reference documentation, \u201cOne of the key components of Spring is the AOP framework.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-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=\"2010-07-06T02:24:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-21T19:17:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/aspectj-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=\"Byron Kiourtzoglou\" \/>\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=\"Byron Kiourtzoglou\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-with-spring.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-with-spring.html\"},\"author\":{\"name\":\"Byron Kiourtzoglou\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/9c0c8d27141b068173953202dd9aebeb\"},\"headline\":\"Aspect Oriented Programming with Spring AspectJ and Maven\",\"datePublished\":\"2010-07-06T02:24:00+00:00\",\"dateModified\":\"2012-10-21T19:17:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-with-spring.html\"},\"wordCount\":1808,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-with-spring.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/aspectj-logo.jpg\",\"keywords\":[\"Apache Maven\",\"Apache Tomcat\",\"Aspect Oriented Programming\",\"AspectJ\",\"Eclipse\",\"Spring\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-with-spring.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-with-spring.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-with-spring.html\",\"name\":\"Aspect Oriented Programming with Spring AspectJ and Maven - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-with-spring.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-with-spring.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/aspectj-logo.jpg\",\"datePublished\":\"2010-07-06T02:24:00+00:00\",\"dateModified\":\"2012-10-21T19:17:21+00:00\",\"description\":\"Spring framework comes with AOP support. In fact, as stated in Spring reference documentation, \u201cOne of the key components of Spring is the AOP framework.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-with-spring.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-with-spring.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-with-spring.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/aspectj-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/aspectj-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/07\\\/aspect-oriented-programming-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\":\"Aspect Oriented Programming with Spring AspectJ and Maven\"}]},{\"@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\\\/9c0c8d27141b068173953202dd9aebeb\",\"name\":\"Byron Kiourtzoglou\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/45058c722c80f088c409be43e0f4be20dad81d55a7c9aefd75bab2e4253ae4e6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/45058c722c80f088c409be43e0f4be20dad81d55a7c9aefd75bab2e4253ae4e6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/45058c722c80f088c409be43e0f4be20dad81d55a7c9aefd75bab2e4253ae4e6?s=96&d=mm&r=g\",\"caption\":\"Byron Kiourtzoglou\"},\"description\":\"Byron is a master software engineer working in the IT and Telecom domains. He is an applications developer in a wide variety of applications\\\/services. He is currently acting as the team leader and technical architect for a proprietary service creation and integration platform for both the IT and Telecom industries in addition to a in-house big data real-time analytics solution. He is always fascinated by SOA, middleware services and mobile development. Byron is co-founder and Executive Editor at Java Code Geeks.\",\"sameAs\":[\"https:\\\/\\\/www.pivotalgamers.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/byron-kiourtzoglou-530ab222\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/byron-kiourtzoglou\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Aspect Oriented Programming with Spring AspectJ and Maven - Java Code Geeks","description":"Spring framework comes with AOP support. In fact, as stated in Spring reference documentation, \u201cOne of the key components of Spring is the AOP framework.","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\/2010\/07\/aspect-oriented-programming-with-spring.html","og_locale":"en_US","og_type":"article","og_title":"Aspect Oriented Programming with Spring AspectJ and Maven - Java Code Geeks","og_description":"Spring framework comes with AOP support. In fact, as stated in Spring reference documentation, \u201cOne of the key components of Spring is the AOP framework.","og_url":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2010-07-06T02:24:00+00:00","article_modified_time":"2012-10-21T19:17:21+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/aspectj-logo.jpg","type":"image\/jpeg"}],"author":"Byron Kiourtzoglou","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Byron Kiourtzoglou","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html"},"author":{"name":"Byron Kiourtzoglou","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/9c0c8d27141b068173953202dd9aebeb"},"headline":"Aspect Oriented Programming with Spring AspectJ and Maven","datePublished":"2010-07-06T02:24:00+00:00","dateModified":"2012-10-21T19:17:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html"},"wordCount":1808,"commentCount":5,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/aspectj-logo.jpg","keywords":["Apache Maven","Apache Tomcat","Aspect Oriented Programming","AspectJ","Eclipse","Spring"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html","url":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html","name":"Aspect Oriented Programming with Spring AspectJ and Maven - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/aspectj-logo.jpg","datePublished":"2010-07-06T02:24:00+00:00","dateModified":"2012-10-21T19:17:21+00:00","description":"Spring framework comes with AOP support. In fact, as stated in Spring reference documentation, \u201cOne of the key components of Spring is the AOP framework.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-with-spring.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/aspectj-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/aspectj-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2010\/07\/aspect-oriented-programming-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":"Aspect Oriented Programming with Spring AspectJ and Maven"}]},{"@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\/9c0c8d27141b068173953202dd9aebeb","name":"Byron Kiourtzoglou","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/45058c722c80f088c409be43e0f4be20dad81d55a7c9aefd75bab2e4253ae4e6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/45058c722c80f088c409be43e0f4be20dad81d55a7c9aefd75bab2e4253ae4e6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/45058c722c80f088c409be43e0f4be20dad81d55a7c9aefd75bab2e4253ae4e6?s=96&d=mm&r=g","caption":"Byron Kiourtzoglou"},"description":"Byron is a master software engineer working in the IT and Telecom domains. He is an applications developer in a wide variety of applications\/services. He is currently acting as the team leader and technical architect for a proprietary service creation and integration platform for both the IT and Telecom industries in addition to a in-house big data real-time analytics solution. He is always fascinated by SOA, middleware services and mobile development. Byron is co-founder and Executive Editor at Java Code Geeks.","sameAs":["https:\/\/www.pivotalgamers.com\/","https:\/\/www.linkedin.com\/in\/byron-kiourtzoglou-530ab222"],"url":"https:\/\/www.javacodegeeks.com\/author\/byron-kiourtzoglou"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/301","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\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=301"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/301\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/88"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}