[Gambas-devel] Gambas server pages - allowing including class files

Joshua Higgins joshiggins at ...176...
Mon Nov 29 21:27:27 CET 2010


Hi list,

I've been using a modified version of gbs for a while now to develop my
Gambas server pages.

I've attached a modified MServerPage.module. I've been using Gambas 2.21,
but it looks like this file hasn't changed in gambas3...

It's a little ugly, but allows you to specify a class file to be included in
the server page before the virtual project compilation.

You use it like this in the html code:

<%@ /path/to/class/file %>

Example usage...

include.class file:

PRIVATE SUB test_print()
PRINT "this is a test"
END

index.gsp file:

#!/path/to/gbw2
<%@ /path/to/include.class %>
<html>
<body>
<% test_print() %>
</body>
</html>

output in browser:

this is a test

Hope this makes sense. It works for me. Makes it a lot easier to develop
pages that use the same functions again and again.
Posting it in case anyone else is interested or if you want to include it in
gambas! ;)

Josh

-- 
joshua higgins
joshiggins at ...176...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20101129/f38860e2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MServerPage.module
Type: application/octet-stream
Size: 4168 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20101129/f38860e2/attachment.obj>


More information about the Devel mailing list