Useful code snippets
I'm having problems resetting the hw5.sxml_log file.
Is there any way that I can delete the log file and
start all over?
Yes, you can add another password field to your
form which would be used for reseting:
Then in your sxml, you reset the logs and counters if the reset password
(reset (.getParameter request "reset"))
(if (equal? reset "yabbadabbadoo")
(write-to-file httpservlet request "log" "")
(write-to-file httpservlet request "counter" "0")
(write-to-file httpservlet request "othercounter" "0"))
Logs have been reset
...rest of your code goes here ....
How can I have my servlet startup my applet as well?
This is pretty easy, if your applet is in "hw5a.applet"
then you just add the following code into your hw5.sxml
Similarly, you can add this tag to html if you want your applet to
automatically run when you visit the page.