Title: How to specify pathname for image in XHTML file Post by: Candy M. on January 08, 2018, 04:23:07 pm We are using a custom sign on to the GBC, using this code on Github:
https://github.com/FourjsGenero/ex_simplesso (https://github.com/FourjsGenero/ex_simplesso) So we are having some success. We have place the external file in it's own group defined in as.xcf: Code
Code
So the external configuration file for the app resides in /users/mtdev/test_webapp and the external configuration file for the webservice resides in /users/mtdev/test_wsapp. The XHTML files for the forms reside in /users/mtdev/mt.res. So the in the application code for the web service (HTTPHelper.4gl), I tweaked the path for the form: Code
It finds the form and displays it in my browser. But it does not find the image I have in the HTML code: Code
I have tried changing that to all sorts of paths. This is what it shows in the Chrome developer's console: GET http://192.168.21.4/gas/ua/r/mttestwebapp/mt.res/web_mtstart.png 404 (Not Found) Here's the app configuration file: Code
Here is the web service configuration file: Code
How do I go about figuring out where to place that image? Thank you for any insight. Gas 3.10.08 and Genero 3.10.09. Using fastcgidispatch through Apache on centos 7 Candy Title: Re: How to specify pathname for image in XHTML file Post by: Candy M. on January 09, 2018, 12:42:18 am So I looked at this some more today and got it working. I moved my image to
/users/gas/3.10.08/web/pic And in my XHTML file, the path for the image is: Code
So, this isn't very clear to me. I'm really puzzled why it would not work unless I had ../../../ Unless it was relative to where the XHTML docs were (/users/mtdev/mt.res) What is the path in as.xcf that specifies where web documents are? I want to separate our code from the GAS directory. Do I need to add a path where I want my web docs to reside? Thank you for any help. Candy Title: Re: How to specify pathname for image in XHTML file Post by: Frank G. on January 09, 2018, 10:03:30 am Hi,
Actually, when you are behind a GAS, for performance issue it is recommended to let the web server serve the images. So a good solution is to have them in the GAS pic directory for instance. The GAS is by default configured to serve the images in that directory. As you did. But as your HTML form is served via a web service accessible on a URL of the form http://host:port/GAS/group/app/myservice, the images in that form are relative to the URL to fetch the HTML form. So to have the images correctly served by the GAS, you must add the ../../../pic in the HTML form to finally have the browser fetching the images in http://host:port/gas/group/app/myservice/../../../pic/image.jpg, or in short : http://host:port/gas/pic/image.jpg . If you want the images to be located else where, you have to configure the web server to access them properly and then of course have the correct path in the HTML form returned by the web service, or otherwise you have to write a web service to server your images. But not necessary as this is something the GAS does well. Regards, Frank Title: Re: How to specify pathname for image in XHTML file Post by: Candy M. on January 09, 2018, 02:33:49 pm Thank you Frank. That is clearer. So 4js recommends putting logo images, etc in the GAS pic directory?
Candy |