title: Getting Error 404 from tomcat on intellij
body: <p>I am trying to run tomcat in intellij, everything runs ok in the IDEA but when I try to open the corresponding page in the browser I get 
  <strong>HTTP Status 404 – Not Found</strong> with the <strong>Description</strong> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. I've looked everywhere and did not find an answer, I hope you can help.
  My code is as follows: </p>
  
  <pre><code>@EnableWebMvc
  @Configuration
  @ComponentScan({"com.asign.controller"})
  public class WebConfig extends WebMvcConfigurerAdapter {
  
  @Override
  public void addResourceHandlers(ResourceHandlerRegistry registry) {
      registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
  }
  
  @Bean
  public InternalResourceViewResolver resolver(){
      InternalResourceViewResolver resolver = new InternalResourceViewResolver();
      resolver.setViewClass(JstlView.class);
      resolver.setPrefix("/WEB-INF/");
      resolver.setSuffix(".jsp");
  
      return resolver;
  }
  }
  
  
  @Configuration
  public class WebInit extends AbstractAnnotationConfigDispatcherServletInitializer {
  
  @Override
  protected Class&lt;?&gt;[] getRootConfigClasses() {
      return null;//new Class&lt;?&gt;[]{RootConfig.class};
  }
  
  @Override
  protected Class&lt;?&gt;[] getServletConfigClasses() {
      return new Class&lt;?&gt;[]{WebConfig.class};
  }
  
  @Override
  protected String[] getServletMappings() {
      return new String[]{"/"};
  }
  }
  
  @Controller
  public class AppController {
  
  @RequestMapping(value = "/")
  public String helloWorld(Model model) {
      //let’s pass some variables to the view script
      model.addAttribute("wisdom", "Goodbye XML");
  
      return "hey"; // renders /WEB-INF/views/hey.jsp
  }
  }
  </code></pre>
  
  <p>I hope this is enough to help me with my problem. Thank you !</p>
  
  <p><strong>edit:</strong> I do get the following messages in the Localhost log: </p>
  
  <pre><code>INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
  INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
  INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
  </code></pre>
  
  <p>For anyone facing the same problem: I could not make this project work, but I used the one from 
  <a href="http://www.mkyong.com/spring3/spring-3-mvc-hello-world-example-annotation/" rel="nofollow noreferrer">http://www.mkyong.com/spring3/spring-3-mvc-hello-world-example-annotation/</a>
  and it worked just fine in my Intellij (after I removed the plugins from pom.xml)</p>