• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redirecting to a Page outside the web project

 
Gaurav Kushwaha
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I redirect a JSF page to a page which is outside the web project (for eg. I have to redirect the a jsf page to a page
present in the workdir location)...... Is this possible ?
How about doing it through a JSP page ?
 
Tim Holloway
Saloon Keeper
Posts: 18302
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be a serious security problem if you could do that arbitrarily. I don't even want to think about the exploits that would open up.

Then again, as I like to point out, a WEB server is NOT a FILE server. The only reason any files get copied from a web app directory is that a web logic module decided to do so. So if you want to create a servlet that gets its page source from some external directory and copies it back to the requester, that's fine. Just be careful.

Note that when I say "copies", I mean just that. It's trivial to design a servlet/JSP that copies HTML, JavaScript, CSS, image or similar files to the client's response stream from any place in the server's filesystem. However, if you need processing (for example, trying to do an external JSF page file), that's a little trickier, since the default JSF servlet is expecting to find resources in its classpath (that is, inside the WAR). You'd actually have to extend the JSF servlet to handle that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic