Note that there are some explanatory texts on larger screens.

plurals
  1. POTomcat does not pick up the class file - the JSP file is not displayed
    primarykey
    data
    text
    <p>I have a Java code which is a controller for a jsp page, called: HomeController.java. Code is as follows:</p> <pre><code>@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"; } } </code></pre> <p>There is nothing especial in the jsp page: home.jsp. If I go to this url: </p> <p><a href="http://localhost:8080/adcopyqueue/mypage" rel="nofollow">http://localhost:8080/adcopyqueue/mypage</a></p> <p>I can view mypage and everything works fine. Also in the tomcat Dos page I can see the comment: </p> <pre><code>HomeController: Passing through... </code></pre> <p>As expected.</p> <p>Now under the same directory that I have HomeController.java, I've created another file called: LoginController.java. Following is the code:</p> <pre><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"; } } </code></pre> <p>And under the same place which I have home.jsp, I've created login.jsp.</p> <p>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.</p> <p>But when I go to this url: <a href="http://localhost:8080/adcopyqueue/loginpage" rel="nofollow">http://localhost:8080/adcopyqueue/loginpage</a></p> <p>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:</p> <pre><code>LoginController: Passing through... </code></pre> <p>Instead I see following which I do not know what do they mean?</p> <pre><code>[ 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 </code></pre> <p>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?</p> <p>Clean build did not help. Does anybody have any idea? Any help is greatly appreciated.</p> <p>This is part of web.xml: config file:</p> <pre><code>&lt;servlet-mapping&gt; &lt;servlet-name&gt;spring&lt;/servlet-name&gt; &lt;url-pattern&gt;/app/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;rewriteFilter&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt; – </code></pre> <p>Just discovered: I modified the return value of method in LoginController from:</p> <pre><code>@RequestMapping(value = "/login") </code></pre> <p>To following:</p> <pre><code>@RequestMapping(value = "/myLastName") </code></pre> <p>And it just worked! The web page is seen as expected and in Tomcat Dos window, now I see this comment:</p> <p>LoginController: Passing through... </p> <p>I did suspect the naming before and had tried with "login", "loginpage" and "loginpage1" and none had worked! Have no idea why its happening! It has a problem with any name with the word "login" in it! Eventually it should work with "login" though!!!</p> <p>One more thing which I just noticed: The LoginController will NOT work as long as the value="/ any name that starts with login"</p> <p>So for ex. login, loginpage, ... will not work. However, pagelogin works, meaning the name should not start with the word: login.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload