Forward, redirect and download
Exampe of forwarding, redirecting and download example. On developing web based software, you often use them.
To access this example, please access the url below or "Forward, redirect and download" link from the toppage.
Then the page below will appear.
After access this page, you can try next operations.
Select "by returning value, the page will forwarded." and push the "Submit" button. The contents shown in the browser is changed into the top page's one. But the url in the web browser's url is unchanged. This is forwarding.
Select "Redirect to the top page." and push the "Submit" button. The web browser go to the top page and the url shown in the browser changes.
Select "Download file." and push the "Submit" button. Then the browser download java script file.
The source code of this example is in "ALINOUS_HOME/samples/forward/" folder.
The implementation of "index.alns" in this folder is below.
To forward url, you should return thhe path to forward.
In order to redirect, use redirect sentence and target url. You can write internet url including other server or domain into this target url.
In order to download file, You have to
- Copy or make file in the "/tmp/" folder
- Call download sentence.
After download sentence called and download was done, the download sentence automatically delete the downloaded file.
This example is testable code, there is more example to do testing automation. Please take a look at Testing Forward, download.