Writing a HTML page to a tempfiel and open that in a dialog

Forum to discuss the Web client version of Servoy.

Writing a HTML page to a tempfiel and open that in a dialog

Postby pbakker » Wed Sep 06, 2006 1:04 pm

Hi,

Got the following requirement:
- Need to display some info in a separate browser window. This information differs per client, current record etc, so needs to be generated at runtime.

In the WebClient, you can open an URL using application.showURL.

Now I tried the following:
Write the HTML to a file, located in the root directory of Tomcat (../server/webapps/ROOT, so it can be opened using http://url:port/filename.extension. Writing the file there is no problem, since the WebClient in effect runs ServerSide, so the location is reachable.

Then I try to open the file using the following code:
Code: Select all
application.showURL(application.getServerURL()+'/'+filename+'.html','_blank','height=200,width=500,status=no,toolbar=no,menubar=no,location=no');


As long as the webclient is started on the machine where the server is running, all is fine. But, when I start the webclient from another machine, it won't work because the "application.getServerURL()" returns the URL from the serverside part of the Webclient, thus http://localhost:port...

Been breaking my head over this, trying to come up with some ideas to get this working but i can't... Anyone have some good idea's?

BTW: I also tried Server's FilePlugin feature to create a temporary file (so it gets automatically removed once the sessions is closed), but this is created in some user directory and when trying to open it from inside the webserver (TomCat), you get access denied errors. So i guess the tempfile needs to be created in the root directory of the webserver, or one of it's subdirectories.

If no one can think of a way to solve this, the only way to get this done, I think, is by having the "application.getServerURL()" altered, so that it indeed returns the real url over which the WebClient is started.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby pbakker » Wed Sep 06, 2006 1:08 pm

Never mind... Just after posting this, I had a brainwave... I removed the application.getServerURL from the URL to open and then it works :oops:

Paul

BTW: tried to delete the post, but that doesn't seem to be possible anymore...
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands


Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 16 guests

cron