• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

not able to redirect to html file from a jsp

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67634
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67634
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67634
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear,

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

Thanks anyways for the knowledge sharing.
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic