It's not a secret anymore!
The moose likes JSF and the fly likes File Download and page navigation 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 "File Download and page navigation" Watch "File Download and page navigation" New topic
Author

File Download and page navigation

Ian Waghorne
Greenhorn

Joined: Jan 24, 2008
Posts: 2
I was wondering if anyone could help me?

I�m new to JSF (in fact Java), and I�m having problems implementing a feature.

Currently we�re providing a link on a page to allow a user to download a file onto their local machine, which I�ve successfully built, resulting in a Save As dialogue box being displayed by the client.

My problem is I need to find a way of automatically navigating the user to a confirmation screen once the download has been completed. There are some good reasons for this, which I won�t bore you with.

I�ve tried setting up a navigation rule in the faces-config.xml. But all that happens is the client�s browser simply gets direct to the confirmation screen without downloading the file. The same happens with a redirect.

Is automatic navigation possible after a file download is complete?

Many thanks for any advice/help offered!

Ian.
Bob Good
Ranch Hand

Joined: Jan 09, 2008
Posts: 86
Are you in the browser in javascript when the download completes?

If so you can do the following:

1) set up a hidden button with an action method to invoke a backing bean action, something like this:



2) in BackingBean.navAction method return a string to trigger navigatyion in the usual manner.

3) When the download is complete, trigger the navigation from javascript:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File Download and page navigation
 
Similar Threads
Double request
How to passed a login page with java code
Download through servlets
View not coming after certain screen
Downloading files to client from server