简体   繁体   中英

simple web server in java called nanohttpd

How to code a simple,light weight web server in java which can take HTTP requests, runs HTML forms and returns requested pages. Im trying to integrate this server as a part of run time library of a newly developed language. I have got this one called nanohtpd which is just one java file, i scan compile at and run the server but when I open a html form,and click submit, the page which is put as the parameter for action ( action="some_name.php") ,the page gets downloaded instead of showing up in the browser. I mean the parameters are to be passed to the php file and the php file has the code to show the parameters in html form. but the page gets downloaded.

该页面被下载而不是由浏览器呈现,这可能是因为服务器未添加具有值text / htmlContent-Type http标头

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM