Problem creating links

Problem creating links

In my application, I keep the configuration of the menu in a database table.
One of the fields of the table stores the full address to the respective screen.
When I click a top menu link , I have a query to retrieve the respective submenus and the application is redirected to the screen associated with the first submenu in the query (using an external site widget)

My problem is that the link that goes to the external site widget has a blank space in the domain part of the url : http://machinename.<space>

In the database there is no space, but in runtime the platform always puts a space there
I've tried using the Replace() function and the EncodeHtml() and the space always is put there.

My workaround , was eliminating the domain part of the url : using just http://machinename/espace/screen_entry.aspx it works fine.

Now I have the need to use an IP address in the url, and I get the same error, it puts a space in the IP http://111.111.111.<space>111/espace/screen_entry.aspx

I tried having the IP in a site property and only the rest of the url in the database, and I get the same problem.

I have put an audit action , and if I put only the site property , I have no spaces in the IP but if I put in the audit : site.url+url_field_from_table, it puts the space there again

I tried again using the Replace() function and the EncodeHtml() function but it always puts the space there.

Any ideas?
Hi Nelson,

These URL links are being generated by the OutSystems Platform, or are you manually generating the URL (using external site urls)?

Where are you seing the "space"? in the links (while viewing the page source)?

I've already seen some problems when you're auditing an URL (when manually generated) in the Platform Monitoring (General Log option) the browser sometime adds a space in the middle of the auditted URL (the browser thinks that's a sentence and add spaces...)

João Portela
Hi João,

I have a screen to manually configure the options I want to see in the menu.
One of the fields is the URL, in a text field.

When I click a TopMenu, a query is made to get the SubMenus for the selected TopMenu.
One of the fields retrieved is the URL of the SubMenu.
The URL of the first record of the query is sent to an External Site widget.
I have put and Audit widget BEFORE the External Site widget and it sends the URL with the space to the General Log.

If I copy the URL from the database field in SQL Server  to the browser it works fine.
If I use http://machinename/espace/screen_entry.aspx in the database , it works fine.
If I use  OR http://ip_address/espace/screen_entry.aspx in the database , I get "page not found", and the space in the Audit.
All 3 work fine if I copy the links direct to the browser.

Hi João,

After a few more tests I've found that you are rigth, the space only shows up in the Log.
Now my problem is that the External Site widget does not redirect to the URL even if the URL is correct. I always get the typical "Page Not Found" from the browser.

I've removed the External Site Widget and put there an End widget and sent the URL to an expression in the screen. Then I copied the URL from the screen to the browser and the screen opened.

Somehow the External Site widget doesn't redirects to the URL and I don't get any message in the logs (it could loose the session, for example), just the Page Not Found.

Hi Nelson,

There are 2 ways of using External Sites:
  1. Specify the targetURL in the External Site node,
  2. Or "Add Dynamic URL" to the external site. this will add a URL parameter to the external site link that you can specify durint the rendering of the page.
Both option will only generate a URL that will be wrote in the page.

The external site is not a redirect node, it only dumps a specific URL to the page. The browser will render the URL, and after the user click on it the IIS will server the corresponding URL...

If you need additional help, you can attach a sample of the screen and a sample espace where you have the problem.

João Portela
I have a Destination Widget pointing to the External Site (that already has the URL parameter).
In the Destination widget I supply the URL from the query to the URL parameter.

This should do it?

Like I said , if I have only the machine name in the url this works fine, when I use ip addresses or machine_name.domain it gives me the "page not found" message.

For now I really need to use the ip address.

Ok, I understand now the problem.

It looks like a machineo or IIs configuration problem. If you write the url with ip/domain in the browser you get the correct page, but the redirect is not working.

Have you tried to check if the machine can access those URLs (with ip/domain-name)? Try to ping the ip and host with domain; and also try to use a brower inside the server.

João Portela
Ping from the machine to the ip address and machine_name.domain works fine.

Forget to say an important detail , it's http://ip_address:4000/...

Maybe have to change something in the IIS ?

Hi Nelson,

I would suggest you to check what's being transmitted from/to brower<->IIS. In this case you should receive a 302 to redirect to the new URL, but something is going  wrong.... You can check the communication with a tool like FireBug (for Firefox)

João Portela

I was always trying with IE7, now I've tried with Chrome.

In IE7 , when I get the "page not found", the address that shows in the address bar is always the previous address but in Chrome I get this:

http://IP_ADDRESS<without the 4000 port>/EnterpriseManagerExt/ExternalURL.aspx?URL=http://IP_ADDRESS:4000/timemanagement/AllTimeSheetConsult.aspx%3fEntryPoint%3dTimeSheetConsultManager

For what I see , somehow the External Site widget loses the 4000 port.
If I manually (in the address bar) put it there it works fine.
It looks like a proxy problem.... 

First, the OutSytems Platform do not change the URL you provide, normally the .Net/IIS do not do that stuff. I've tried a similar pattern and it worked ok. So, it could some kind of problem with a proxy (~ISA).

If you're working behind a ISA proxy you can look at this post Configuring a Microsoft ISA Server to serve Agile Platform web applications.

Hope this could be useful.