1
Web Server - Ask For Help / Re: Method to substitute <!-- Net:s:SessionVariable --> in HTML?
« Last post by JohanR on November 23, 2026, 09:10:06 PM »Hi Bruce
Forgot to add,
I can create a function to do a manual replace, however if there was one or 2 methods I can use that does the Parse/replace that will be ideal, as it will use the existing rules.
thanks
Johan
2
Web Server - Ask For Help / Re: Method to substitute <!-- Net:s:SessionVariable --> in HTML?
« Last post by JohanR on November 23, 2026, 08:59:39 AM »Hi Bruce
Thanks , confirms what is happening.
If source is RAW, HTML either typed in the box or loaded from a session var does not parse the HTML and replace tags.
It works quite well if source is FILE.
Thinking it can be quite handy if the RAW source was also parsed and loaded from a session variable.
Would avoid the multiple disk file reads if there are a few of these on a page.
regards
Johan
Thanks , confirms what is happening.
If source is RAW, HTML either typed in the box or loaded from a session var does not parse the HTML and replace tags.
It works quite well if source is FILE.
Thinking it can be quite handy if the RAW source was also parsed and loaded from a session variable.
Would avoid the multiple disk file reads if there are a few of these on a page.
regards
Johan
3
Web Server - Ask For Help / Re: Method to substitute <!-- Net:s:SessionVariable --> in HTML?
« Last post by Bruce on November 22, 2026, 07:38:24 PM »>> However if the HTML is pre-loaded in a session variable the dynamic data is not updated if the field is refreshed.
It's not going to parse the contents of session values. I think that's the root of your problem here. You're not injecting HTML, you're injecting a session value, which happens to contain HTML.
It's not going to parse the contents of session values. I think that's the root of your problem here. You're not injecting HTML, you're injecting a session value, which happens to contain HTML.
4
Web Server - Ask For Help / Re: nettalk 14.38 Webserver crashes sometimes
« Last post by AtoB on November 19, 2026, 08:25:59 AM »Hi Bruce,
at that I looked at the download example app and the netwebpage proc, but there are some downsides to it. My netwebmethod is a little customized so automatically validates and identifies partys, generates help pages and now I also can simply let partys issue a
GET /wsResources/resources/somefile.jpg
And with netwebpage (as far as I know) I cannot achieve the same simple url usage without introducing an extra parameter for the actual filename (again: this might be my lack of knowledge). Without the parameter it always resolves to serving files from the public \web folder (so my procedure doesn't get called at all).
The mechanism I've created seems to work perfectly and I cannot find out why/how it crashes (in this case the procedure always returns an empty string, as this production environment doesn't even have this enpoint implemented and the procedure is hardcoded to return an empty string ...)
But now I know where it's roughly crashing and I can build in some tracer ... curious what requests actually kill this thing :-)
Thanks for pointing me in the right direction!
Regards
Ton
at that I looked at the download example app and the netwebpage proc, but there are some downsides to it. My netwebmethod is a little customized so automatically validates and identifies partys, generates help pages and now I also can simply let partys issue a
GET /wsResources/resources/somefile.jpg
And with netwebpage (as far as I know) I cannot achieve the same simple url usage without introducing an extra parameter for the actual filename (again: this might be my lack of knowledge). Without the parameter it always resolves to serving files from the public \web folder (so my procedure doesn't get called at all).
The mechanism I've created seems to work perfectly and I cannot find out why/how it crashes (in this case the procedure always returns an empty string, as this production environment doesn't even have this enpoint implemented and the procedure is hardcoded to return an empty string ...)
But now I know where it's roughly crashing and I can build in some tracer ... curious what requests actually kill this thing :-)
Thanks for pointing me in the right direction!
Regards
Ton
5
Web Server - Ask For Help / Re: Method to substitute <!-- Net:s:SessionVariable --> in HTML?
« Last post by JohanR on November 19, 2026, 03:04:24 AM »Hi Bruce
I have a form with a display field, this contains an HTML snippet, and the HTML also has some dynamic data from variables.
Currently I have the snippet in a file on disk and the display field source is a file tag.
The dynamic data is updated when the field is refreshed.
However if the HTML is pre-loaded in a session variable the dynamic data is not updated if the field is refreshed.
I have tried to follow the difference in code between the file tag and session variable, but not sure of the code that triggers the replacing of the tags eg. <!-- Net:s:cli:email -->
In the past I have used a procedure to generate HTML and then did the replacing by hand, so it's do-able.
As there are other tags available, like host besides session.
Would just be handy if the builtin methods can be used or triggered.
a simple example
<dl class="rows">
<div class="row">
<dt>
Full name
</dt>
<dd data-value="fullName">
<!-- Net:s:cli:first_name --><!-- Net:s:cli:name -->
</dd>
</div>
<div class="row">
<dt>
Email
</dt>
<dd data-value="email">
<!-- Net:s:cli:email -->
</dd>
</div>
<div class="row">
<dt>
Mobile
</dt>
<dd data-value="mobile">
<!-- Net:s:cli:cell_nr -->
</dd>
</div>
</dl>
thanks
Johan
I have a form with a display field, this contains an HTML snippet, and the HTML also has some dynamic data from variables.
Currently I have the snippet in a file on disk and the display field source is a file tag.
The dynamic data is updated when the field is refreshed.
However if the HTML is pre-loaded in a session variable the dynamic data is not updated if the field is refreshed.
I have tried to follow the difference in code between the file tag and session variable, but not sure of the code that triggers the replacing of the tags eg. <!-- Net:s:cli:email -->
In the past I have used a procedure to generate HTML and then did the replacing by hand, so it's do-able.
As there are other tags available, like host besides session.
Would just be handy if the builtin methods can be used or triggered.
a simple example
<dl class="rows">
<div class="row">
<dt>
Full name
</dt>
<dd data-value="fullName">
<!-- Net:s:cli:first_name --><!-- Net:s:cli:name -->
</dd>
</div>
<div class="row">
<dt>
</dt>
<dd data-value="email">
<!-- Net:s:cli:email -->
</dd>
</div>
<div class="row">
<dt>
Mobile
</dt>
<dd data-value="mobile">
<!-- Net:s:cli:cell_nr -->
</dd>
</div>
</dl>
thanks
Johan
6
Web Server - Ask For Help / Re: nettalk 14.38 Webserver crashes sometimes
« Last post by Bruce on November 18, 2026, 07:56:43 AM »If you want the result to be "just a file" and not an API response (with the file embedded in XML or JSON) then don't use a WebServiceMethod.
Use a NetWebPage instead. See File Download example.
Use a NetWebPage instead. See File Download example.
7
Web Server - Ask For Help / Re: nettalk 14.38 Webserver crashes sometimes
« Last post by AtoB on November 17, 2026, 11:12:20 PM »Hi Bruce,
then I problably know what is causing this and this is due to my own actions (see attached screenshot with code I inserted, line number might be off ... as the gpf report is from an exe I shipped months ago)
I'm trying to send a resource (file) when wsResources/resources is hit. It then calls "resources" (to validate api-key and the lot) which is a netwebservicemethod procedure.
I guess sometimes this doesn't return the correct data ... and crashes the server.
What I'm actually trying to accomplish is "send" the file from within the netwebservicemethod procedure (I commented out the line that was intended for this purpose, but adding the sendfile there doesn't work (I think it starts a recursion).
If you can pinpoint me in the right direction with the latter, the code in NetwebWorker can be removed
This is the part that now returns the filename to serve (SELF.rData is a StringTheory object that is returned to the call, NetWebWorker in this case and now contains the actual filename to be served):
IF lDownLoadOk
IF ~EXISTS(lFnResourceFull)
lDownloadOk = False
END
END
IF lDownloadOk
p_web.HeaderDetails.ContentDisposition = 'attachment; filename="' & CLIP(lFnResource) &'"'
p_web.ReplyContentType = p_web.GetContentType(lFnResource)
SELF.rData.setvalue('fn:' & lFnResourceFull)
ODS('value: ' & CLIP(SELF.rData.GetValue()))
!SELF.rP_Web._SendFile(lFnResourceFull)
SELF.SkipBuild = True
SELF.SkipSend = True
SELF.ReturnData = True
ELSE
SELF.rP_Web.SendError (400, 'Bad Request', 'The requested file was not valid') ! Bad Request
END
then I problably know what is causing this and this is due to my own actions (see attached screenshot with code I inserted, line number might be off ... as the gpf report is from an exe I shipped months ago)
I'm trying to send a resource (file) when wsResources/resources is hit. It then calls "resources" (to validate api-key and the lot) which is a netwebservicemethod procedure.
I guess sometimes this doesn't return the correct data ... and crashes the server.
What I'm actually trying to accomplish is "send" the file from within the netwebservicemethod procedure (I commented out the line that was intended for this purpose, but adding the sendfile there doesn't work (I think it starts a recursion).
If you can pinpoint me in the right direction with the latter, the code in NetwebWorker can be removed
This is the part that now returns the filename to serve (SELF.rData is a StringTheory object that is returned to the call, NetWebWorker in this case and now contains the actual filename to be served):
IF lDownLoadOk
IF ~EXISTS(lFnResourceFull)
lDownloadOk = False
END
END
IF lDownloadOk
p_web.HeaderDetails.ContentDisposition = 'attachment; filename="' & CLIP(lFnResource) &'"'
p_web.ReplyContentType = p_web.GetContentType(lFnResource)
SELF.rData.setvalue('fn:' & lFnResourceFull)
ODS('value: ' & CLIP(SELF.rData.GetValue()))
!SELF.rP_Web._SendFile(lFnResourceFull)
SELF.SkipBuild = True
SELF.SkipSend = True
SELF.ReturnData = True
ELSE
SELF.rP_Web.SendError (400, 'Bad Request', 'The requested file was not valid') ! Bad Request
END
8
Web Server - Ask For Help / Re: nettalk 14.38 Webserver crashes sometimes
« Last post by Bruce on November 17, 2026, 03:24:23 PM »the problem seems to be in applaunch004.clw. I'm guessing that's your WebHandler?
you would likely need to post that to get more information.
you would likely need to post that to get more information.
9
Web Server - Ask For Help / Re: Method to substitute <!-- Net:s:SessionVariable --> in HTML?
« Last post by Bruce on November 17, 2026, 03:21:06 PM »typically it's done for you. But it depends on the context. So tell us more about what HTML you are using here?
10
Web Server - Ask For Help / Re: nettalk 14.38 Webserver crashes sometimes
« Last post by osquiabro on November 13, 2026, 03:27:33 AM »Verify that all templates required by NT are updated to the latest version.
Recent Posts