0

I am new to .jsp web pages, I just want to edit some CSS and see the changes on my PC before sending back to customer. I dont want to edit any java coding or anything, just maybe change some html and CSS stuff.

I have Tomcat running on my computer, and I can browse to http://localhost:8080/ and see the Tomcat 9.0 web page.

No matter what I do, when I browse to any of the .jsp files I want to change, I get a 404, so am starting at the beginning to try and troubleshoot, and even with the most basic file, I get the same error.

What I am doing to test is I simply made a file called hello.jsp and uploaded it to the /webapps/hello folder

The code I am testing with has basically nothing in it:

<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<p>Test</p>
</body>
</html>

When I browse to the URL: http://localhost:8080/hello.jsp

I get:

HTTP Status 404 - /hello.jsp

type Status report

message /hello.jsp

description The requested resource is not available. Apache Tomcat/9.0.0.M4

I dont understand what is not available?

justAbit
  • 4,226
  • 2
  • 19
  • 34
Francois
  • 9
  • 1

2 Answers2

0

the url you should be calling in this context is :

 http://localhost:8080/hello/hello.jsp

assuming that hello is the name of the folder under webapps

Rafik BELDI
  • 4,140
  • 4
  • 24
  • 38
  • Thank you, that worked perfectly for my test file. But does not for the customer files. Their files are structured: webapps/customer/WEB-INF/view/home.jsp On the web, their site opens just on the domain name. I get the exact error when I try test one of their files on my computer using the name of their folder under webapps like what has worked with my test. – Francois Apr 06 '16 at 16:38
  • I tried: http://localhost:8080/customer/WEB-INF/view/home.jsp http://localhost:8080/customer/view/home.jsp http://localhost:8080/customer/home.jsp All give the same exact error. – Francois Apr 06 '16 at 16:44
  • You can't access your files under WEB-INF directly by specifying WEB-INF in URL. For that you need to declare it in your web.xml or you need to have a servlet which will forward it to `.jsp` file under WEB-INF. – justAbit Apr 06 '16 at 17:23
0
  1. Please check whether your port number 8080, defined in the server, is already being used by some other project on the same server. If so change your port number and try again.

  2. Your url should be in this format http://localhost:portno/hello/hello.jsp

António Ribeiro
  • 4,129
  • 5
  • 32
  • 49
Pravin
  • 1
  • 1