This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have a servlet that uses three JSP pages. I am using Eclipse Indigo and running the Tomcat v5.5 server on localhost, port 80 and the app runs just fine. The app starts up with a login page (JSP page 1). The user credentials are authenticated and then JSP page 2 is displayed. The user clicks on a list item on this page to make a selection and JSP page 3 is "loaded" with the associated bean data and displayed. When running under port 80 there is no problem.
However, if I change the Tomcat port this breaks the app in a bizarre way. If I change Tomcat's port to, say, 25000, then JSP page 1 displays fine and we see JSP page 2. The user clicks to make a selection and again the associated bean data is used to "load" JSP page 3 and it is displayed. However, this time, the HTML [head] (can't use angle brackets in the post!) block that is delivered to the browser is the [head] block of JSP page ***2***. Further, the HTML [body] block that is delivered to the browser consists of the contents of the [body] block of JSP page ***2***, followed by the correct contents of the [body] block of JSP page 3! That is, the page that is "generated" out Tomcat is the [head] block from page 2 and a combination of the [body] block of page 2 and 3.
In summary, if I run Tomcat on port 80 I can include jQuery in JSP page 2 and there is no problem. If I change Tomcat's port to something other than 80, the inclusion of jQuery Mobile in JSP page 2 causes JSP page 3 to be trashed. At this point I don't think that jQuery Mobile itself could be the real problem - how could it cause JSP page 3 to include page 2? However, the Tomcat JSP processing facility is parsing, patching and generating these pages that are sent to the browser so it seems more likely that the problem lies there. But I have no clue as to why changing the Tomcat port # would affect JSP processing.
Is there something else I must change other than the port # on the Eclipse Tomcat v5.5 Server pane to ensure that JSP processing keeps working? Anyone who can explain what in the world is going on here really knows their stuff!!!