views:

48

answers:

2

I am using eclipse with maven2 plugin.

Maven created a /src folder, so I created my HomeController.java file in the following path:

/src/main/java/web/HomeController.java

When I compile using the RunAs mavin build, with a goal set to 'compile', I get the error:

E:\dev\eclipse\springmvc2\src\main\java\web\HomeController.java:[5,1] cannot find symbol
symbol: class Controller
@Controller

my homecontroller.java looks like:

package com.springmvc2.web;

import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class HomeController {


    @RequestMapping("/")
    public String Index(){

        return "index";
    }


    @RequestMapping("/test")
    public String Index2(){

        return "index";
    }


}
A: 

Its a missing jar from your classpath

Woot4Moo
+4  A: 

You have to import the Controller class just like RequestMapping.

Teja Kantamneni
thanks, but shouldn't eclipse give me a pre-compile warning or auto-import? it seemed to auto import when I did the requestmapping annotation.
Blankman