Skip to content

Commit

Permalink
Javadoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeinum committed Apr 29, 2012
1 parent d432bc5 commit dd6df1a
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 16 deletions.
Expand Up @@ -4,6 +4,7 @@
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
Expand All @@ -13,6 +14,30 @@
import com.apress.prospringmvc.bookstore.config.TestDataContextConfiguration;
import com.apress.prospringmvc.bookstore.web.config.WebMvcContextConfiguration;

/**
* {@link WebApplicationInitializer} that will be called by Spring's {@code SpringServletContainerInitializer} as part
* of the JEE {@code ServletContainerInitializer} pattern. This class will be called on application startup and will
* configure our JEE and Spring configuration.
* <p/>
*
* It will first initializes our {@code AnnotationConfigWebApplicationContext} with the common {@link Configuration}
* classes: {@code InfrastructureContextConfiguration} and {@code TestDataContextConfiguration} using a typical JEE
* {@code ContextLoaderListener}.
* <p/>
*
* Next it creates a {@link DispatcherServlet}, being a normal JEE Servlet which will create on its turn a child
* {@code AnnotationConfigWebApplicationContext} configured with the Spring MVC {@code Configuration} classes
* {@code WebMvcContextConfiguration} and {@code WebflowContextConfiguration}. This Servlet will be registered using
* JEE's programmatical API support.
* <p/>
*
* Note: the {@code OpenEntityManagerInViewFilter} is only enabled for pages served soley via Spring MVC. For pages
* being served via WebFlow we configured WebFlow to use the JpaFlowExecutionListener.
*
* @author Marten Deinum
* @author Koen Serneels
*
*/
public class BookstoreWebApplicationInitializer implements WebApplicationInitializer {

private static final String DISPATCHER_SERVLET_NAME = "dispatcher";
Expand Down
Expand Up @@ -6,11 +6,11 @@
import org.springframework.web.servlet.view.tiles2.TilesViewResolver;

/**
* Configuration for the view technologies.
* Spring MVC configuration for the View Technologies.
*
* @author Marten Deinum
* @author Koen Serneels
*
* @author M. Deinum
* @Author K. Serneels
*
*/
@Configuration
public class ViewConfiguration {
Expand Down
Expand Up @@ -38,9 +38,10 @@
import com.apress.prospringmvc.bookstore.web.method.support.SessionAttributeProcessor;

/**
* WebMvc Configuration.
* Configures Spring MVC.
*
* @author M. Deinum
* @author Marten Deinum
* @author Koen Serneels
*/
@Configuration
@EnableWebMvc
Expand Down
Expand Up @@ -19,6 +19,12 @@
import com.apress.prospringmvc.bookstore.repository.OrderRepository;
import com.apress.prospringmvc.bookstore.web.method.support.SessionAttribute;

/**
*
* @author Marten Deinum
* @author Koen Serneels
*
*/
@Controller
@RequestMapping("/customer/account")
@SessionAttributes(types = Account.class)
Expand Down
Expand Up @@ -12,8 +12,8 @@
/**
* Controller to handle book detail requests.
*
* @author M. Deinum
* @author K. Serneels
* @author Marten Deinum
* @author Koen Serneels
*
*/
@Controller
Expand Down
Expand Up @@ -17,8 +17,8 @@
/**
* Controller to handle book search requests.
*
* @author M. Deinum
* @author K. Serneels
* @author Marten Deinum
* @author Koen Serneels
*
*/
@Controller
Expand Down
Expand Up @@ -12,6 +12,11 @@
import com.apress.prospringmvc.bookstore.domain.Cart;
import com.apress.prospringmvc.bookstore.service.BookstoreService;

/**
*
* @author Marten Deinum
* @author Koen Serneels
*/
@Controller
public class CartController {

Expand Down
Expand Up @@ -27,6 +27,11 @@
import com.apress.prospringmvc.bookstore.service.BookstoreService;
import com.apress.prospringmvc.bookstore.validation.OrderValidator;

/**
*
* @author Marten Deinum
* @author Koen Serneels
*/
@Controller
@SessionAttributes(types = { Order.class })
@RequestMapping("/cart/checkout")
Expand Down
Expand Up @@ -13,6 +13,13 @@
import com.apress.prospringmvc.bookstore.service.AccountService;
import com.apress.prospringmvc.bookstore.service.AuthenticationException;

/**
* Controller to handle login.
*
* @author Marten Deinum
* @author Koen Serneels
*
*/
@Controller
@RequestMapping(value = "/login")
public class LoginController {
Expand Down
Expand Up @@ -7,9 +7,10 @@
import org.springframework.web.bind.annotation.RequestMethod;

/**
* Controller to handle a logout.
* Controller to handle logout.
*
* @author marten
* @author Marten Deinum
* @author Koen Serneels
*
*/
@Controller
Expand Down
Expand Up @@ -20,8 +20,10 @@
import com.apress.prospringmvc.bookstore.validation.AccountValidator;

/**
* Controller to handle the registration of a new {@link Account}
* @author marten
* Controller to handle the registration of a new {@code Account}
*
* @author Marten Deinum
* @author Koen Serneels
*
*/
@Controller
Expand Down
Expand Up @@ -7,6 +7,12 @@

import com.apress.prospringmvc.bookstore.service.BookstoreService;

/**
* {@code WebRequestInterceptor} implementation to add common data (random books) to the model.
*
* @author Marten Deinum
* @author Koen Serneels
*/
public class CommonDataInterceptor implements WebRequestInterceptor {

@Autowired
Expand Down
Expand Up @@ -3,7 +3,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import org.springframework.web.util.WebUtils;

Expand All @@ -12,7 +11,7 @@
import com.apress.prospringmvc.bookstore.web.controller.LoginController;

/**
* {@link HandlerInterceptor} to apply security to controllers.
* {@code HandlerInterceptor} to apply security to controllers.
*
* @author Marten Deinum
* @author Koen Serneels
Expand Down
Expand Up @@ -6,6 +6,12 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Annotation to mark a method argument or return value to be retrieved or stored in the {@code javax.servlet.http.HttpSession}.
*
* @author Marten Deinum
* @author Koen Serneels
*/
@Target({ ElementType.PARAMETER, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
Expand Down
Expand Up @@ -9,6 +9,13 @@
import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
import org.springframework.web.method.support.ModelAndViewContainer;

/**
* {@code HandlerMethodReturnValueHandler} and {@code HandlerMethodArgumentResolver} implementation to
* handle a {@code SessionAttribute}.
*
* @author Marten Deinum
* @author Koen Serneels
*/
public class SessionAttributeProcessor implements HandlerMethodReturnValueHandler, HandlerMethodArgumentResolver {

@Override
Expand Down

0 comments on commit dd6df1a

Please sign in to comment.