aspose file tools
The moose likes JSF and the fly likes Redirecting to a Page outside the web project Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Redirecting to a Page outside the web project" Watch "Redirecting to a Page outside the web project" New topic
Author

Redirecting to a Page outside the web project

Gaurav Kushwaha
Greenhorn

Joined: May 20, 2009
Posts: 19
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

Joined: Jun 25, 2001
Posts: 14491
    
    7

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Redirecting to a Page outside the web project
 
Similar Threads
why my web pages are downloadable?
Redirect in a JSF page itself dependent on which panelGrid is rendered:
Handling session timeout and session invalidate differently
Confusing with JSF redirect
how to access a session value on JSF page?