E
E
Evgeny Petryaev2019-10-16 15:09:59
Java
Evgeny Petryaev, 2019-10-16 15:09:59

Problem with paths in tomcat?

At the address 127.0.0.1:8080, the index.html file located in apache-tomcat-9.0.27\webapps\ROOT is issued
, here is its content:

<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>MySite</title>
  <link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<style>
body 
{ 
  background: url(27.jpg) no-repeat; 
  background-size: 100%;
}
</style>
</head>
<body>
...
<p align="center">
<a href="../Example/index2.jsp" target="_blank">Registration</a>
...
<script>

</script>
</body>
</html>

The most important thing is that there is a project of Java classes (more precisely .classes) lying in apache-tomcat-9.0.27\webapps\Example\WEB-INF\classes
5da707e5a99d9112851251.png, in apache-tomcat-9.0.27\webapps\Example there are jsp files going from index.html to ../Example/index2.jsp I press Create New and 5da70848b3b7f657279636.png
I get 404 5da7085eaee53414655926.pngthere it can be seen that another one is added to the path Example: total Example/Example/create.jsp how to solve?
index2.jsp:
</head>
<body>
<h2>Users List</h2>
<p><a href='<c:url value="/create" />'>Create new</a></p>
<table>
<tr><th>NickName</th><th>Password</th><th>email</th></tr>
<c:forEach var="user" items="${users}">
 <tr>
    <td>${user.nickname}</td> 
    <td>${user.password}</td>
    <td>${user.email}</td>
    <td>
    <a href='<c:url value="/edit?id=${user.id}" />'>Edit</a> |
    <form method="post" action='<c:url value="/delete" />' style="display:inline;">
        <input type="hidden" name="id" value="${user.id}">
        <input type="submit" value="Delete">
    </form>
 </td></tr>
</c:forEach>
</table>
</body>
</html>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Petryaev, 2019-10-16
@Gremlin92

Solved by replacing ../Example/index2.jsp with localhost:8080/Example/create

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question