Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: CSS links on stand-alone web broker application


This question is answered.


Permlink Replies: 5 - Last Post: Jul 7, 2017 3:36 AM Last Post By: Bernt Wold
Davide Rubbiani

Posts: 70
Registered: 8/15/03
CSS links on stand-alone web broker application  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 25, 2017 10:01 AM
Hello,
I'm developing my first web broker application with Delphi Tokio.
I'm starting with a stand-alone application to permit me faster testing and debugging.
To show my pages I'm using TPageProducers that refer to some HTML files.
In these HTML files I have links to CSS external file.
I can't find the right path to save these CSS files so they can be included in the HTML file referenced by the TPageProducer.
Is there a root folder for web broker stand alone application?
What is it?
If no in which way I can provide my CSS to HTML files?

Thank you,
Davide
Bernt Wold

Posts: 10
Registered: 9/27/99
Re: CSS links on stand-alone web broker application
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 31, 2017 2:47 AM   in response to: Davide Rubbiani in response to: Davide Rubbiani
1 way
Have a look at Twebfiledispatcher
This can point to a root folder and contain your docs
then you can use this address for your HTML file...

2 way
put your css file on a webserver and point to it

Bernt

Davide Rubbiani wrote:
Hello,
I'm developing my first web broker application with Delphi Tokio.
I'm starting with a stand-alone application to permit me faster testing and debugging.
To show my pages I'm using TPageProducers that refer to some HTML files.
In these HTML files I have links to CSS external file.
I can't find the right path to save these CSS files so they can be included in the HTML file referenced by the TPageProducer.
Is there a root folder for web broker stand alone application?
What is it?
If no in which way I can provide my CSS to HTML files?

Thank you,
Davide
Delbert Murray

Posts: 20
Registered: 11/16/00
Re: CSS links on stand-alone web broker application
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 31, 2017 5:11 AM   in response to: Davide Rubbiani in response to: Davide Rubbiani
Davide,
After many years of webbroker development I suggest the following.

1. Test as an ISAPI .. not a CGI. It is just as fast and you will find some errors (like failing to maintain state) in your ISAPI that may not show up in a CGI.
2. Make your test environment and IIS configuration as identical as possible to your production environment.
3. Paths in url are "relative" to the website and not to the directory. While debugging the ISAPI you can see these paths and figure out how to set your CSS path.
4. I maintain "state" in a database file that is tied to a user session id. It's fast, flexible and puts practically no overhead on the application if using MS Sql .. cant comment on MySQL or any other database.
5. I also use a "codes" table that allows me to feed variable to the application. It can also hold values (such as path to CSS) that don't have to be hardcoded into the application. You want to avoid hard coding in an ISAPI because IIS can sometimes be a bear to deal with.

Your mileage may vary ...
Del
Bernt Wold

Posts: 10
Registered: 9/27/99
Re: CSS links on stand-alone web broker application
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 2, 2017 3:50 AM   in response to: Davide Rubbiani in response to: Davide Rubbiani
You can also have a look at this setup I am using myself.

https://docs.google.com/document/d/1D1ilgJe64SCeRLjZvnrMEC-Wbm2muy9TZ3fsqxkRzDQ/edit#


Davide Rubbiani wrote:
Hello,
I'm developing my first web broker application with Delphi Tokio.
I'm starting with a stand-alone application to permit me faster testing and debugging.
To show my pages I'm using TPageProducers that refer to some HTML files.
In these HTML files I have links to CSS external file.
I can't find the right path to save these CSS files so they can be included in the HTML file referenced by the TPageProducer.
Is there a root folder for web broker stand alone application?
What is it?
If no in which way I can provide my CSS to HTML files?

Thank you,
Davide
Davide Rubbiani

Posts: 70
Registered: 8/15/03
Re: CSS links on stand-alone web broker application  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 6, 2017 2:14 AM   in response to: Bernt Wold in response to: Bernt Wold
Bernt Wold wrote:
You can also have a look at this setup I am using myself.

https://docs.google.com/document/d/1D1ilgJe64SCeRLjZvnrMEC-Wbm2muy9TZ3fsqxkRzDQ/edit#


Davide Rubbiani wrote:
Hello,
I'm developing my first web broker application with Delphi Tokio.
I'm starting with a stand-alone application to permit me faster testing and debugging.
To show my pages I'm using TPageProducers that refer to some HTML files.
In these HTML files I have links to CSS external file.
I can't find the right path to save these CSS files so they can be included in the HTML file referenced by the TPageProducer.
Is there a root folder for web broker stand alone application?
What is it?
If no in which way I can provide my CSS to HTML files?

Thank you,
Davide

Hello,

I put a TWebFileDispatcher as you suggest.
Now my home page works fine but all linked page don't load external file (css, js, images) as expected.
In my home page I have a link like this "myDll.dll/details?id=10" to show details of a product with id = 10.
When I click on the link the page change right and and data are correctly retrieved but no image nor external file are correctly addressed.
I'm using relative path in the page producer and cause I put all my file in the same folder where the dll resides I set only the html file name.

When the /details page is shown in the browser I inspected an image path and I saw that "mydll.dll" prefix the image source url so it isn't right displayed.
The correct image src url should be "localhost:8080/images/myImage.png" but after navigate to my /details page using the above link the image src url is "localhost:8080/mydll.dll/images/myImage.png".

What I'm doing wrong?
How should I set up TWebFileDispatcher to avoid this kind of problem?

Thank you,
Davide
Bernt Wold

Posts: 10
Registered: 9/27/99
Re: CSS links on stand-alone web broker application  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 7, 2017 3:36 AM   in response to: Davide Rubbiani in response to: Davide Rubbiani
Can you link to the complete URL
like : http://localhost:8080/images/myImage.png

maybe put this web url as an Environment variabel in system : imageURL "http://localhost:8080/images/"

imageURL:=GetEnvironmentVariable('imageURL');

link imageURL+myImage.png

Just an idea


Davide Rubbiani wrote:
Bernt Wold wrote:
You can also have a look at this setup I am using myself.

https://docs.google.com/document/d/1D1ilgJe64SCeRLjZvnrMEC-Wbm2muy9TZ3fsqxkRzDQ/edit#


Davide Rubbiani wrote:
Hello,
I'm developing my first web broker application with Delphi Tokio.
I'm starting with a stand-alone application to permit me faster testing and debugging.
To show my pages I'm using TPageProducers that refer to some HTML files.
In these HTML files I have links to CSS external file.
I can't find the right path to save these CSS files so they can be included in the HTML file referenced by the TPageProducer.
Is there a root folder for web broker stand alone application?
What is it?
If no in which way I can provide my CSS to HTML files?

Thank you,
Davide

Hello,

I put a TWebFileDispatcher as you suggest.
Now my home page works fine but all linked page don't load external file (css, js, images) as expected.
In my home page I have a link like this "myDll.dll/details?id=10" to show details of a product with id = 10.
When I click on the link the page change right and and data are correctly retrieved but no image nor external file are correctly addressed.
I'm using relative path in the page producer and cause I put all my file in the same folder where the dll resides I set only the html file name.

When the /details page is shown in the browser I inspected an image path and I saw that "mydll.dll" prefix the image source url so it isn't right displayed.
The correct image src url should be "localhost:8080/images/myImage.png" but after navigate to my /details page using the above link the image src url is "localhost:8080/mydll.dll/images/myImage.png".

What I'm doing wrong?
How should I set up TWebFileDispatcher to avoid this kind of problem?

Thank you,
Davide
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02