系統也要用(read-from-web ...)產生收集單項問題的網頁, clips file 中(read)用(read-from-web ...)代替。 例如,
(defrule one-y
(one y)
=>
(printout t " " crlf)
(printout t "問題一.你認為你是一個有個性,有自己的思想及主見的人嗎?(y/n)")
(bind ?yn (read))
(assert (gquestion1 ?yn)))
改為
(defrule one-y
(one y)
=>
(printout t " " crlf)
(read-from-web "問題一.你認為你是一個有個性,有自己的思想及主見的人嗎?(y/n)" gquestion1))
經過servlet的處理, assert an ordered fact: (gquestion1 y)。函式 read-from-web 的設計如下:
(deffunction read-from-web (?prompt ?factName)
(printout t ?prompt)
(printout t "<FORM METHOD=POST ACTION=http://" ?*host* "/servlets/JessServlet>")
(printout t "<INPUT TYPE=\"hidden\" NAME=\"fileRB\" VALUE=\"com\">")
(printout t "<INPUT TYPE=\"hidden\" NAME=\"fact_name\" VALUE=" ?factName ">")
(printout t crlf "<INPUT TYPE=\"radio\" NAME=\"slot\" VALUE=\"n\" checked>no")
(printout t "<INPUT TYPE=\"radio\" NAME=\"slot\" VALUE=\"y\" >yes")
(printout t crlf crlf "<p><INPUT TYPE=submit VALUE=\"Enter\">")
(printout t "</FORM>")
)