newLisp as localhost - html logbook

Started by didi, August 24, 2008, 10:47:58 AM

Previous topic - Next topic

didi

Is it possible to use newLisp as localhost in windows  and a webbrowser eg. explorer  AND store data via the browser and newLisp into a file ?



I like  to program a logbook-function with the webbrowser as a user-interface. The data which is typed in  a textfield should be appended as clear-text to a textfile - and displayed back to the html-page.



I'm no expert, maybe it's possible with this  200k-small newLisp.

Jeff

#1
Yes.  See here: http://www.newlisp.org/downloads/newlisp_manual.html#tcpip_server">http://www.newlisp.org/downloads/newlis ... pip_server">http://www.newlisp.org/downloads/newlisp_manual.html#tcpip_server.  newLISP comes with its own built-in web server.  You can save data easily with the 'save function.
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code

didi

#2
I started one newlisp with
  newlisp -d 4711
Then another newlisp where i typed :
( net-eval "localhost" 4711 { ( save "save.lsp") } )

It worked fine and saved the context and i think in the same way i can append every text to a file - the normal newLisp commands are working - and i think my own programfunctions ,  too, which i load while starting the localhost.



Thanks Jeff !

didi

#3
With  newLISP as a localhost  and windows it is not possible to respond to  a GET and PUT request - this is mentioned in the codepatterns.html  - nevertheless i tried it and it seems that it really doesn't work  ;-)



I tried a workaround -  i can filter the html-request ,  recognize the GET command .. and do everything eq. loading a file in a string and send it ..  but how the heck  can i send back my html-file as a answer to the request ?

Lutz

#4
If somewhere is written that server mode does not answer HTTP requests on Windows, than that is long obsolete.



newLISP server mode does answer HTTP reqests on Windows. But do not use IE explorer which gives problems on some versions with PUT requests. With Firefox everything works fine.



See the packages newlisp-ide-x.x.tgz and newlisp-wiki-x.x.tgz in the download area. There you can learn how to send HTML pages from a cgi process.

didi

#5
QuoteTesting the server HTTP mode using a web browser

A newLISP server also understands simple HTTP GET and PUT requests (currently UNIX only). Enter the full path of a file in the address-bar of the browser: ..


This is a quote out of the actual Code Patterns text.

I've tried it with the ie6.0 , maybe that was the reason why it didn't worked .





Thanks for your answer  :-)

unixtechie

#6
...

didi

#7
hi unixtechie,



i want newLISP as a loacalserver to build a logbook for eg. a project-change-tracking with some colleagues on my day-job .

In our company we must use  microsoft-windows and it's  internet-explorer  and  it's a bigger act to get  java on your pc - no way for an apache-server ...  



So the idea is to use the small newLISP-localhost and the browser as the user-interface .

I think the ide  ( or  wiki) example  has already everything you need .