Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

not able to redirect to html file from a jsp

 
Praveen Sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am stuck in a stupid problem.
I want to redirect my window to a new page and that fileis placed inside WEB-INF folder.

This is my code for the file "index.jsp":



This is the directory stucture :




But some how this is not working.
Could you please help me out of this problem.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Files under WEB-INF cannot be directly addressed.
 
Praveen Sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

That is correct, files under WEB-INF cannot be directly accessed but I am trying is to make my program do that.
I understand what you say. By putting them under WEB-INF I would disallow users from typing the url and accessing the files directly.

But it should it be working if I am doing it programmatically, right ?

In case it should not I dont understand how this statement is working fine for me :
<%@ include file="/WEB-INF/jsp/treeInclude.jsp"%>

Please help me understand this.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Praveen Sharma wrote:But it should it be working if I am doing it programmatically, right ?

No. How on Earth could the server possibly know the difference?

Files under WEB-INF cannot be served by URL, no matter how the URL is generated or the request issued.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Praveen Sharma wrote:In case it should not I dont understand how this statement is working fine for me :
<%@ include file="/WEB-INF/jsp/treeInclude.jsp"%>

That's a server-side include, and has nothing to do with client-side access.
 
Praveen Sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

I got it. Maybe I need to reconsider my project structure.

Thanks anyways for the knowledge sharing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic