0

nowadays i am learning how to work with spring framework , i am trying to build a simple web application, i have encountered a problem which i want you to help to solve.

in short, i want to redirect to HTML or JSP page without using a controller i know that i can do this using JSTL core library (c:url) in my case. every thing work properly until i click on the link (back to search) an 404 error pop up says this resource is not available. ** This is the only part that is not working properly with me **

First of all

Here is the App folder hierarchy:

Web Application Hierarchy Image

Web Application Hierarchy Image

Here is my JSP page which from i want to go back to search page

<%@ page language="java" contentType="text/html; charset=windows-1256"
    pageEncoding="windows-1256"%>
<%@ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>

<c:url var="url"  value="/jsp/test.html"/>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>Insert title here</title>
</head>
<body>
<p>${id}</p>
<h1>Book Added Success</h1>

  <a href= "${url}">Back To Search</a>
</body>
</html>

Any Help Please. Thanks in advance.

L_J
  • 2,351
  • 10
  • 23
  • 28
Abed
  • 7
  • 2

1 Answers1

0

The simple answer is No due to you have put all your jsp files under WEB-INF

You can not access files within WEB-INF,more details can be found at What is WEB-INF used for in a Java EE web application?

If you want to redirect without via Controller method,you need change the location of it,make them out of WEB-INF

flyingfox
  • 13,414
  • 3
  • 24
  • 39