Skip to content

Commit

Permalink
servlet next
Browse files Browse the repository at this point in the history
  • Loading branch information
AtulDwivedi committed Jun 3, 2018
1 parent c6875ba commit 67df019
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/com/atuldwivedi/carcentre/aspect/LoggingAspect.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

//@Aspect
//@Component
@Aspect
@Component
public class LoggingAspect {

@Pointcut("execution(* com.atuldwivedi.carcentre.*.*.*(..))")
Expand Down
6 changes: 3 additions & 3 deletions src/com/atuldwivedi/carcentre/aspect/MyLogginAspect.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public class MyLogginAspect {
@Pointcut("execution(* com.atuldwivedi.carcentre.*.*.*(..))")
public void allMethods() {}

/*@Before("allMethods()")
@Before("allMethods()")
@Order(2)
public void runBeforeEveryMethod(JoinPoint joinPoint) {
System.out.println("1>> "+this.getClass().getSimpleName()+" "+joinPoint.getSignature()+" started");
}*/
}

/*@Before("allMethods()")
@Order(1)
Expand Down Expand Up @@ -69,7 +69,7 @@ public Object aroundSaveOrUpdate(ProceedingJoinPoint proceedingJoinPoint) throws
return result;
}

@AfterThrowing(pointcut="allMethods()", throwing="ex")
//@AfterThrowing(pointcut="allMethods()", throwing="ex")
public void afterTrowing(Throwable ex) {
System.out.println("----------------\n"+ex.getMessage());
}
Expand Down
6 changes: 3 additions & 3 deletions src/com/atuldwivedi/carcentre/aspect/MyLogginAspect2.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

//@Aspect
//@Component
//@Order(1)
@Aspect
@Component
@Order(1)
public class MyLogginAspect2 {

@Pointcut("execution(* com.atuldwivedi.carcentre.*.*.*(..))")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@

import com.atuldwivedi.carcentre.domain.Message;

@RestController
//@RestController
public class GreetController implements Serializable {

private Map<String, Message> msgMap;

@PostConstruct
//@PostConstruct
public void createData() {
msgMap = new HashMap<String, Message>();
msgMap.put("mor", new Message("Morning", "Good Morning!"));
msgMap.put("noon", new Message("After Noon", "Good After Noon!"));
msgMap.put("eve", new Message("Evening", "Good Evening!"));
}

@RequestMapping(value="/greet", method=RequestMethod.GET)
//@RequestMapping(value="/greet", method=RequestMethod.GET)
public Message greetMe(/*@RequestParam("time") String theTime*/) {
return msgMap.get("eve");
}
Expand Down
2 changes: 0 additions & 2 deletions src/com/atuldwivedi/carcentre/dao/CustomerDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.atuldwivedi.carcentre.user.Customer;

Expand Down Expand Up @@ -59,7 +58,6 @@ public Long addCustomerOld(Customer customer) {

@Override
public Long editCustomer(Customer customer) {
// TODO Auto-generated method stub
return null;
}

Expand Down

0 comments on commit 67df019

Please sign in to comment.