A link to go back one level in the folder hierarchy and go to the level below in another folder

3

Hello.

The problem is this: inside the WebContent folder I have the hotel folder and inside this hotel folder, I have the cadastro_hotel.jsp file.

In the root of WebContent, I have the folder menu and inside this folder, I have the file menu_inicial.jsp. I created a link, inside the menu_initial.jsp to point to hotel / cadastro_hotel.jsp, but I can not. I've used ../ and nothing.

<a href="../hotel/cadastro_hotel.jsp">Cadastrar hotel</a>  

That is, I am one level down from the root, I want to go back to the root and so, go down the level to the other folder. I can get back to the root using ../, but I can not go to the level below.

    
asked by anonymous 17.11.2016 / 03:44

2 answers

1

I have decided as follows:

<a href="../menu/menu_inicial.jsp"></a>

and to the hotel folder and the cadastro_hotel.jsp file, I did:

<a href="../hotel/cadastro_hotel.jsp"></a>

The '../' returns to the root folder, which in this case is the webContent and from there just put the path: / folder / file or if it is at the same level, folder put file name: / file. jsp.

    
23.11.2016 / 17:21
0

In the case of JEE, the browser "sees" your application from WebContent. Since you are using the 'a' tag, it generates a new request from outside (from JSP / Java), ie it is not necessary to use the '../'.

Just put a href="hotel/cadastro_hotel.jsp"

If you are using response.SendRedirect ('path') or request.forward (), then you would have to consider the hierarchical structure of your project, since you would be doing a request / redirect via JSP.     

21.11.2016 / 02:57