I'm new to tomcat and servlets. So I'm trying to test a simple jsp
page on my tomcat 8 container. When I open the index.jsp
file from localhost
or 127.0.0.1
it works fine i.e. index.jsp
page displays html
as well as outputs the jsp
code results. But when I run it through the pc's ip address(which is 192.168.1.100 on the local network), the browser displays the html
but the jsp
code is totally ignored. Here's a part of index.jsp
:
</head><body>
<%
out.print("<h2>Hello, I'm running!!</h2>");
%>
<header><h1>The Real Thing</h1><h4>Vote or die!</h4></header>
<main>
I've even changed the tomcat web.xml's welcome-list
, putting index.jsp
before index.html
but it's not working. So, if localhost is running the jsp
code from index.jsp
then why does the local network ip address not running the jsp
code?
Any help would be appreciated.
NOTE : I deleted the index.jsp from
/var/lib/tomcat8/webapps/ROOT/
but192.168.1.100
is still displaying the web page whilelocalhost
is giving 404 page not found.