Forum OpenACS Q&A: Response to pros and cons of .adp pages...

Collapse
Posted by Roberto Mello on
AOLserver/OpenNSD caches the .adp's to avoid too much recompilation. This is a big pro IMHO. I don't know about any cons. To me it's more about the way you like to program.

In .adp's the "default" is HTML. You have to 'escape' into Tcl to be able to use it. It's something like: <h2>Some subsection</h2>

<%
  set db [ns_db gethandle]
  set name [database_to_tcl_string $db "select name from users where user_id=3"]
  ns_db releasehandle $db
%>

<b>your name</b> is <%= $name %>

Everything between <% %> is Tcl. You need to use ns_puts to output to the browser. Or <%= %>, which treats whatever is inside the brackets as arguments to an ns_puts. (I hope the < and > show up on the e-mail output).

AOLserver has good documentation on ADPs. Read the Tcl Development Guide at http://www.aolserver.com/docs