Demonstrates the features of the Spring MVC web framework

Overview

Spring MVC Showcase

Demonstrates the capabilities of the Spring MVC web framework through small, simple examples. After reviewing this showcase, you should have a good understanding of what Spring MVC can do and get a feel for how easy it is to use. Includes project code along with a supporting slideshow and screen cast.

In this showcase you'll see the following in action:

  • The simplest possible @Controller
  • Mapping Requests
  • Obtaining Request Data
  • Generating Responses
  • Message Converters
  • Rendering Views
  • Type Conversion
  • Validation
  • Forms
  • File Upload
  • Exception Handling

To get the code:

Clone the repository:

$ git clone git://github.com/SpringSource/spring-mvc-showcase.git

If this is your first time using Github, review https://help.github.com to learn the basics.

To run the application:

From the command line with Maven:

$ cd spring-mvc-showcase
$ mvn jetty:run 

Access the deployed web application at: http://localhost:8080/spring-mvc-showcase/

Note:

This showcase originated from a blog post and was adapted into a SpringOne presentation called Mastering MVC 3.

A screen cast showing the showcase in action is available in QuickTime format.

Comments
  • HTTP Status 500 - Servlet.init() for servlet appServlet threw exception

    HTTP Status 500 - Servlet.init() for servlet appServlet threw exception

    Hi can you please suggest me? I am using spring mvc with Spring Tool Suite first time

    HTTP Status 500 - Servlet.init() for servlet appServlet threw exception

    type Exception report

    message Servlet.init() for servlet appServlet threw exception

    description The server encountered an internal error that prevented it from fulfilling this request.

    exception javax.servlet.ServletException: Servlet.init() for servlet appServlet threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745)

    root cause org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745)

    root cause java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41) javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:269) org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:184) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745)

    root cause java.lang.ClassNotFoundException: javax.validation.ParameterNameProvider org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157) org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41) javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:269) org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:184) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745)

    note The full stack trace of the root cause is available in the Apache Tomcat/8.0.23 logs.

    opened by mundrika 11
  • Error on pom.xml

    Error on pom.xml

    Using Eclipe plugin Maven Integration for Eclipse 1.5.0:

    On line 271: <executions> <execution> <goals> <goal>compile</goal> <goal>test-compile</goal> </goals> </execution> </executions>

    Error: Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (execution: default, phase: process-sources)

    I have solved it adding an <id> and <phase> tags to the <execution> block.

    opened by roizpi 7
  • STS project files missing

    STS project files missing

    Just got started using STS and I couldn't help but notice that the project files are missing; could I be missing something? I cloned the repository but cannot seem to find the project files.

    opened by lightonphiri 7
  • LinkageError: loader constraint violation

    LinkageError: loader constraint violation

    I'm running the maven app like described in the README file with mvn tomcat:run. My environment is Mac OS X 10.6.8 with Java 1.6.0_26. When accessing the application through the browser at address http://localhost:8080/spring-mvc-showcase it get the following exception:

    INFO: Starting Coyote HTTP/1.1 on http-8080 DEBUG: org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'appServlet' processing GET request for [/spring-mvc-showcase/] DEBUG: org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Looking up handler method for path / DEBUG: org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Did not find handler method for [/] DEBUG: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/] to HandlerExecutionChain with handler [org.springframework.web.servlet.mvc.ParameterizableViewController@5994a1e9] and 1 interceptor DEBUG: org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/spring-mvc-showcase/] is: -1 DEBUG: org.springframework.web.servlet.DispatcherServlet - Rendering view [org.springframework.web.servlet.view.JstlView: name 'home'; URL [/WEB-INF/views/home.jsp]] in DispatcherServlet with name 'appServlet' DEBUG: org.springframework.web.servlet.view.JstlView - Forwarding to resource [/WEB-INF/views/home.jsp] in InternalResourceView 'home' 11.07.2011 21:11:11 org.apache.catalina.core.ApplicationDispatcher invoke SCHWERWIEGEND: Servlet.service() for servlet jsp threw exception java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/WEB_002dINF/views/home_jsp, and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature at org.apache.jsp.WEB_002dINF.views.home_jsp._jspInit(home_jsp.java:25) at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52) at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1120) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:890) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:851) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:756) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.mvc.extensions.flash.FlashMapFilter.doFilterInternal(FlashMapFilter.java:33) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:680)

    I guess it has something to do with the javax.el library?

    opened by serpensalbus 5
  • HTTP Status 500 - Servlet.init() for servlet appServlet threw exception

    HTTP Status 500 - Servlet.init() for servlet appServlet threw exception

    type Exception report

    message Servlet.init() for servlet appServlet threw exception

    description The server encountered an internal error that prevented it from fulfilling this request.

    exception

    javax.servlet.ServletException: Servlet.init() for servlet appServlet threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745) root cause

    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml]; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.springframework.samples.mvc.data.custom.CustomArgumentResolver] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188) org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129) org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:605) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:509) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745) root cause

    java.lang.IllegalArgumentException: Cannot find class [org.springframework.samples.mvc.data.custom.CustomArgumentResolver] org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:287) org.springframework.web.servlet.config.AnnotationDrivenBeanDefinitionParser.wrapLegacyResolvers(AnnotationDrivenBeanDefinitionParser.java:504) org.springframework.web.servlet.config.AnnotationDrivenBeanDefinitionParser.getArgumentResolvers(AnnotationDrivenBeanDefinitionParser.java:493) org.springframework.web.servlet.config.AnnotationDrivenBeanDefinitionParser.parse(AnnotationDrivenBeanDefinitionParser.java:215) org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74) org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1411) org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1401) org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:168) org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:138) org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188) org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129) org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:605) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:509) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745) root cause

    java.lang.ClassNotFoundException: org.springframework.samples.mvc.data.custom.CustomArgumentResolver org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) org.springframework.util.ClassUtils.forName(ClassUtils.java:250) org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:284) org.springframework.web.servlet.config.AnnotationDrivenBeanDefinitionParser.wrapLegacyResolvers(AnnotationDrivenBeanDefinitionParser.java:504) org.springframework.web.servlet.config.AnnotationDrivenBeanDefinitionParser.getArgumentResolvers(AnnotationDrivenBeanDefinitionParser.java:493) org.springframework.web.servlet.config.AnnotationDrivenBeanDefinitionParser.parse(AnnotationDrivenBeanDefinitionParser.java:215) org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74) org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1411) org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1401) org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:168) org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:138) org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188) org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129) org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:605) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:509) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745) note The full stack trace of the root cause is available in the Apache Tomcat/8.0.28 logs.

    opened by sudhan041 4
  • Add bean name to property accessors in html.jsp

    Add bean name to property accessors in html.jsp

    html.jsp missing bean name "javaBean" in property accessors. Add name to accessors, e.g. ${javaBean.fruit} so model data will appear in the view.

    opened by kpb 4
  • HTTP Status 403 - Expected CSRF token not found

    HTTP Status 403 - Expected CSRF token not found

    In "Request Mapping" tab, when click "By consumes" button occurred error:

    HTTP Status 403 - Expected CSRF token not found. Has your session expired?

    image

    opened by huguangju 4
  • Can't build application

    Can't build application

    Hello,

    i tried to build the application on command-line. But it doesn't work, her is my log.

    noname:spring-mvc-showcase christianhenle$ mvn tomcat7:run [INFO] Scanning for projects... [INFO]
    [INFO] ------------------------------------------------------------------------ [INFO] Building spring-mvc-showcase 1.0.0-BUILD-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> tomcat7-maven-plugin:2.0:run (default-cli) @ spring-mvc-showcase >>> [INFO] [INFO] --- aspectj-maven-plugin:1.2:compile (default) @ spring-mvc-showcase --- [ERROR] The import javax.servlet.http.HttpServletRequest cannot be resolved [ERROR] HttpServletRequest cannot be resolved to a type [ERROR] The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from required .class files [ERROR] The import javax.servlet.http.HttpServletRequest cannot be resolved [ERROR] HttpServletRequest cannot be resolved to a type [ERROR] The type org.joda.time.base.BaseLocal cannot be resolved. It is indirectly referenced from required .class files [ERROR] The import org.hibernate.validator.constraints.NotEmpty cannot be resolved [ERROR] NotEmpty cannot be resolved to a type [ERROR] The type javax.servlet.http.HttpServletResponse cannot be resolved. It is indirectly referenced from required .class files [ERROR] The import javax.servlet.http.HttpServletRequest cannot be resolved [ERROR] The import javax.servlet.http.HttpServletResponse cannot be resolved [ERROR] The import javax.servlet.http.HttpSession cannot be resolved [ERROR] HttpServletRequest cannot be resolved to a type [ERROR] HttpServletResponse cannot be resolved to a type [ERROR] HttpSession cannot be resolved to a type [ERROR] The import javax.servlet.http.HttpServletRequest cannot be resolved [ERROR] HttpServletRequest cannot be resolved to a type [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.003s [INFO] Finished at: Thu Dec 19 22:25:08 CET 2013 [INFO] Final Memory: 11M/147M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (default) on project spring-mvc-showcase: Compiler errors : [ERROR] error at import javax.servlet.http.HttpServletRequest; [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/mapping/ClasslevelMappingController.java:3:0::0 The import javax.servlet.http.HttpServletRequest cannot be resolved [ERROR] error at public @ResponseBody String byPathPattern(HttpServletRequest request) { [ERROR] ^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/mapping/ClasslevelMappingController.java:21:0::0 HttpServletRequest cannot be resolved to a type [ERROR] error at result.setResult(new ModelAndView("views/html", "javaBean", new JavaBean("bar", "apple"))); [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/async/DeferredResultController.java:66:0::0 The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from required .class files [ERROR] error at import javax.servlet.http.HttpServletRequest; [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/mapping/MappingController.java:3:0::0 The import javax.servlet.http.HttpServletRequest cannot be resolved [ERROR] error at public @ResponseBody String byPathPattern(HttpServletRequest request) { [ERROR] ^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/mapping/MappingController.java:21:0::0 HttpServletRequest cannot be resolved to a type [ERROR] error at (no source information available) [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/redirect/RedirectController.java:1:0::0 The type org.joda.time.base.BaseLocal cannot be resolved. It is indirectly referenced from required .class files [ERROR] error at import org.hibernate.validator.constraints.NotEmpty; [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/form/FormBean.java:10:0::0 The import org.hibernate.validator.constraints.NotEmpty cannot be resolved [ERROR] error at @NotEmpty [ERROR] ^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/form/FormBean.java:19:0::0 NotEmpty cannot be resolved to a type [ERROR] error at (no source information available) [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/data/standard/StandardArgumentsController.java:1:0::0 The type javax.servlet.http.HttpServletResponse cannot be resolved. It is indirectly referenced from required .class files [ERROR] error at import javax.servlet.http.HttpServletRequest; [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/data/standard/StandardArgumentsController.java:11:0::0 The import javax.servlet.http.HttpServletRequest cannot be resolved [ERROR] error at import javax.servlet.http.HttpServletResponse; [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/data/standard/StandardArgumentsController.java:12:0::0 The import javax.servlet.http.HttpServletResponse cannot be resolved [ERROR] error at import javax.servlet.http.HttpSession; [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/data/standard/StandardArgumentsController.java:13:0::0 The import javax.servlet.http.HttpSession cannot be resolved [ERROR] error at public @ResponseBody String standardRequestArgs(HttpServletRequest request, Principal user, Locale locale) { [ERROR] ^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/data/standard/StandardArgumentsController.java:27:0::0 HttpServletRequest cannot be resolved to a type [ERROR] error at public @ResponseBody String response(HttpServletResponse response) { [ERROR] ^^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/data/standard/StandardArgumentsController.java:48:0::0 HttpServletResponse cannot be resolved to a type [ERROR] error at public @ResponseBody String session(HttpSession session) { [ERROR] ^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/data/standard/StandardArgumentsController.java:65:0::0 HttpSession cannot be resolved to a type [ERROR] error at import javax.servlet.http.HttpServletRequest; [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/data/custom/CustomArgumentController.java:3:0::0 The import javax.servlet.http.HttpServletRequest cannot be resolved [ERROR] error at void beforeInvokingHandlerMethod(HttpServletRequest request) { [ERROR] ^^^^^^^^^^^^^^^^ [ERROR] /Users/christianhenle/git/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/data/custom/CustomArgumentController.java:15:0::0 HttpServletRequest cannot be resolved to a type [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

    opened by christianhenle 4
  • Async Requests Tab

    Async Requests Tab

    Hello,

    I am getting the following error when try to access the async requests tab:

    java.lang.UnsupportedOperationException: No async support in a pre-Servlet 3.0 runtime

    i was just wondering if anyone else encountered such a problem.

    Many thanks for your time.

    Pishty

    opened by pishty1 4
  • Null pointer exception while server startup

    Null pointer exception while server startup

    Hi Team, I am using spring mvc for my application and tomcat 8.0 version. during server startup i am getting the below error.This is happening for the first api call.After that it is working fine. Can you please guide me in resolving this?

    java.lang.NullPointerException org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659) org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:748)

    opened by sudhagarn 3
  • installation

    installation

    Hello, java noobie here. I was just wondering if i can have more detail on how to install this, do i just run tomcat and copy the code into it, or do i need to run maven install to produce a war file of some sort. I guess am just asking for a bit more detail to get this application up and running.

    opened by pishty1 3
  • [ERROR] COMPILATION ERROR

    [ERROR] COMPILATION ERROR

    I tried mvn jetty:run but could not as it gave me the following error trace:

    howcase (master) $ mvn jetty:run
    [INFO] Scanning for projects...
    [WARNING] 
    [WARNING] Some problems were encountered while building the effective model for org.springframework.samples:spring-mvc-showcase:war:1.0.0-BUILD-SNAPSHOT
    [WARNING] 'dependencies.dependency.version' for org.apache.logging.log4j:log4j-core:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 48, column 13
    [WARNING] 'dependencies.dependency.version' for org.apache.logging.log4j:log4j-slf4j-impl:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 53, column 13
    [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. @ line 183, column 12
    [WARNING] 
    [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
    [WARNING] 
    [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
    [WARNING] 
    [INFO] 
    [INFO] ----------< org.springframework.samples:spring-mvc-showcase >-----------
    [INFO] Building spring-mvc-showcase 1.0.0-BUILD-SNAPSHOT
    [INFO] --------------------------------[ war ]---------------------------------
    [INFO] 
    [INFO] >>> jetty-maven-plugin:9.4.8.v20171121:run (default-cli) > test-compile @ spring-mvc-showcase >>>
    [INFO] 
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ spring-mvc-showcase ---
    [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
    [INFO] Copying 1 resource
    [INFO] 
    [INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ spring-mvc-showcase ---
    [INFO] Changes detected - recompiling the module!
    [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
    [INFO] Compiling 40 source files to /media/nobu/Ubuntu Backup/Comp Sci/Web/Java/spring-mvc-showcase/target/classes
    [INFO] /media/nobu/Ubuntu Backup/Comp Sci/Web/Java/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/form/FormBean.java: Some input files use or override a deprecated API.
    [INFO] /media/nobu/Ubuntu Backup/Comp Sci/Web/Java/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/form/FormBean.java: Recompile with -Xlint:deprecation for details.
    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR : 
    [INFO] -------------------------------------------------------------
    [ERROR] /media/nobu/Ubuntu Backup/Comp Sci/Web/Java/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/messageconverters/JavaBean.java:[4,33] package javax.xml.bind.annotation does not exist
    [ERROR] /media/nobu/Ubuntu Backup/Comp Sci/Web/Java/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/messageconverters/JavaBean.java:[6,2] cannot find symbol
      symbol: class XmlRootElement
    [ERROR] /media/nobu/Ubuntu Backup/Comp Sci/Web/Java/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/mapping/JavaBean.java:[3,33] package javax.xml.bind.annotation does not exist
    [ERROR] /media/nobu/Ubuntu Backup/Comp Sci/Web/Java/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/mapping/JavaBean.java:[5,2] cannot find symbol
      symbol: class XmlRootElement
    [INFO] 4 errors 
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  4.383 s
    [INFO] Finished at: 2019-03-31T09:31:00+07:00
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project spring-mvc-showcase: Compilation failure: Compilation failure: 
    [ERROR] /media/nobu/Ubuntu Backup/Comp Sci/Web/Java/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/messageconverters/JavaBean.java:[4,33] package javax.xml.bind.annotation does not exist
    [ERROR] /media/nobu/Ubuntu Backup/Comp Sci/Web/Java/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/messageconverters/JavaBean.java:[6,2] cannot find symbol
    [ERROR]   symbol: class XmlRootElement
    [ERROR] /media/nobu/Ubuntu Backup/Comp Sci/Web/Java/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/mapping/JavaBean.java:[3,33] package javax.xml.bind.annotation does not exist
    [ERROR] /media/nobu/Ubuntu Backup/Comp Sci/Web/Java/spring-mvc-showcase/src/main/java/org/springframework/samples/mvc/mapping/JavaBean.java:[5,2] cannot find symbol
    [ERROR]   symbol: class XmlRootElement
    [ERROR] -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
    
    opened by nyck33 3
  • HTTP Status 403 - Expected CSRF token not found. Has your session expired?

    HTTP Status 403 - Expected CSRF token not found. Has your session expired?

    My problem was different with "HTTP Status 403 - Expected CSRF token not found #29" at "https://github.com/spring-projects/spring-mvc-showcase/issues/29".

    When I send post request to access the URL with Java CloseableHttpClient, I get the result as fllowing.

    <html><head><title>Apache Tomcat/7.0.47 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 403 - Expected CSRF token not found. Has your session expired?</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Expected CSRF token not found. Has your session expired?</u></p><p><b>description</b> <u>Access to the specified resource has been forbidden.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.47</h3></body></html>
    

    The main codes as fllowing:

    String url  = "http://127.0.0.1:9123/spring-mvc-showcase/data/body";
    
    //配置请求参数
    		RequestConfig requestConfig = RequestConfig.custom().setConnectionRequestTimeout(2000).setConnectTimeout(2000).setSocketTimeout(2000).build();
    		//创建自定义的httpClient实例
    		CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig).build();
    		//创建httpPost
    		HttpPost post = new HttpPost(url);
    
    CloseableHttpResponse response = httpClient.execute(post);
    			HttpEntity respEntity = response.getEntity();
    

    But, when I sent get request, it can work rightly.

    Why this error? What shoud I do to solve this?

    opened by cleverlzc 0
Owner
Spring
Spring
A sample Spring-based application

Spring PetClinic Sample Application Understanding the Spring Petclinic application with a few diagrams See the presentation here Running petclinic loc

Spring 6k Dec 28, 2022
You are looking for examples, code snippets, sample applications for Spring Integration? This is the place.

Spring Integration Samples Note This (master) branch requires Spring Integration 5.0 or above. For samples running against earlier versions of Spring

Spring 2.1k Dec 30, 2022
Spring Data Example Projects

Spring Data Examples This repository contains example projects for the different Spring Data modules to showcase the API and how to use the features p

Spring 4.7k Jan 4, 2023
Spring Boot JdbcTemplate example with SQL Server: CRUD Rest API using Spring Data JDBC, Spring Web MVC

Spring Boot JdbcTemplate example with SQL Server: Build CRUD Rest API Build a Spring Boot CRUD Rest API example that uses Spring Data Jdbc to make CRU

null 7 Dec 20, 2022
jetbrick web mvc framework

jetbrick-webmvc Web MVC framework for jetbrick. Documentation http://subchen.github.io/jetbrick-webmvc/ Dependency <dependency> <groupId>com.githu

Guoqiang Chen 25 Nov 15, 2022
A web MVC action-based framework, on top of CDI, for fast and maintainable Java development.

A web MVC action-based framework, on top of CDI, for fast and maintainable Java development. Downloading For a quick start, you can use this snippet i

Caelum 347 Nov 15, 2022
DataFX - is a JavaFX frameworks that provides additional features to create MVC based applications in JavaFX by providing routing and a context for CDI.

What you’ve stumbled upon here is a project that intends to make retrieving, massaging, populating, viewing, and editing data in JavaFX UI controls ea

Guigarage 110 Dec 29, 2022
This project archetype is a template for creating a fully functional MVC web application using Hibernate, JSTL and Bootstrap

This project archetype is a template for creating a fully functional MVC web application using Hibernate, JSTL and Bootstrap. It has an automatic database creation, auto initial load of the data, with different variety of users. It also has a checkstyle to check the proper coding of your project immediately right after you enter the code.

null 90 Oct 21, 2022
A basic shard that demonstrates optional implementations, and interfaces.

Glass - Example A basic shard that demonstrates optional implementations, and interfaces. Basic Information A lot of stuff will be more complex than o

null 1 Feb 13, 2022
This project demonstrates reference implementation of Auth API Client

Client Application to test Auth API for OTP verification. Introduction Aadhaar “authentication” means the process wherein Aadhaar Number or Virtual ID

UIDAI 3 Oct 27, 2021
This project demonstrates usage of Captcha, OTP APIs to access Offline eKYC XML.

Client Application to simulate offline eKYC wrapper API flow Introduction This is a Spring boot application which can be used to download offline eKYC

UIDAI 4 Oct 29, 2021
This project demonstrates reference deployment of OTP API.

Client Application to simulate OTP Request API flow Introduction This is a Spring boot application which can be used to generate OTP on the registered

UIDAI 4 Oct 27, 2021
循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc

Spring 系列教程 该仓库为个人博客https://mrbird.cc中Spring系列源码,包含Spring Boot、Spring Boot & Shiro、Spring Cloud,Spring Boot & Spring Security & Spring Security OAuth2

mrbird 24.8k Jan 6, 2023
该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的线上博客项目/企业大型商城系统/前后端分离实践项目等,摆脱各种 hello world 入门案例的束缚,真正的掌握 Spring Boot 开发。

Spring Boot Projects 该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的前

十三 4.5k Dec 30, 2022
💡极致性能的企业级Java服务器框架,RPC,游戏服务器框架,web应用服务器框架。(Extreme fast enterprise Java server framework, can be RPC, game server framework, web server framework.)

?? 为性能而生的万能服务器框架 ?? Ⅰ. zfoo简介 ?? 性能炸裂,天生异步,Actor设计思想,无锁化设计,基于Spring的MVC式用法的万能RPC框架 极致序列化,原生集成的目前二进制序列化和反序列化速度最快的 zfoo protocol 作为网络通讯协议 高可拓展性,单台服务器部署,

null 1k Jan 1, 2023
:rocket: Lightning fast and elegant mvc framework for Java8

Based on Java8 + Netty4 to create a lightweight, high-performance, simple and elegant Web framework ?? Spend 1 hour to learn it to do something intere

Blade Framework 5.7k Dec 28, 2022
:rocket: Lightning fast and elegant mvc framework for Java8

Based on Java8 + Netty4 to create a lightweight, high-performance, simple and elegant Web framework ?? Spend 1 hour to learn it to do something intere

Blade Framework 5.7k Jan 5, 2023
Spring MVC,Data,Rest

Tekonolojiler Java 11 Spring Boot DevTools Lombok Spring Configuration Processor Spring Web Thymeleaf Spring Data JPA H2 Database MySQL Driver Validat

Java Full Stack Developer Hamit Mızrak 11 Mar 24, 2022