Tomcat does not pick up the class file - the JSP file is not displayed

Posted by blueSky on Stack Overflow See other posts from Stack Overflow or by blueSky
Published on 2011-11-17T17:47:29Z Indexed on 2011/11/17 17:50 UTC
Read the original article Hit count: 190

Filed under:
|
|
|
|

I have a Java code which is a controller for a jsp page, called: HomeController.java. Code is as follows:

@Controller
public class HomeController {

protected final transient Log log = LogFactory.getLog(getClass());

@RequestMapping(value = "/mypage")
public String home() {
    System.out.println("HomeController: Passing through...");
    return "home";
}
}

There is nothing especial in the jsp page: home.jsp. If I go to this url:

http://localhost:8080/adcopyqueue/mypage

I can view mypage and everything works fine. Also in the tomcat Dos page I can see the comment:

HomeController: Passing through...

As expected.

Now under the same directory that I have HomeController.java, I've created another file called: LoginController.java. Following is the code:

@Controller
public class LoginController {

protected final transient Log log = LogFactory.getLog(getClass());

@RequestMapping(value = "/loginpage")
public String login() {
    System.out.println("LoginController: Passing through...");        
    return "login";
}
}

And under the same place which I have home.jsp, I've created login.jsp.

Also under tomcat folders, LoginController.class exists under the same folder that HomeController.class exists and login.jsp exists under the same folder which home.jsp exists.

But when I go to this url: http://localhost:8080/adcopyqueue/loginpage

Nothing is displayed! I think tomcat does not pick up LoginController.class b/c on the tomcat Dos window, I do NOT see this comment:

LoginController: Passing through...

Instead I see following which I do not know what do they mean?

[ INFO] [http-8080-1 01:43:45] (AppInfo.java:populateAppInfo:34) got manifest
[ INFO] [http-8080-1 01:43:45] (AppInfo.java:populateAppInfo:36) manifest entrie
s 8

The structure and the code for HomeController.java and LoginController.java plus the jsp files match. I have no idea why tomcat sees one of the files and not the other?

Clean build did not help. Does anybody have any idea? Any help is greatly appraciated.

© Stack Overflow or respective owner

Related posts about java

Related posts about web-development