• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help on writing a small java server  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm writing a tiny web server in java. I've managed to get it to return pages and images to the browser if I hard code in the filename in the code. I want to be able to read the filename from the get request from the browser though. Do I just cut the filename out from the get request? Could someone point me in the right direction please.
 
Sheriff
Posts: 3015
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A web server can return whatever it wants for a given request. However, for static pages, yes, it is a common thing to send a file that's sitting on the file system. Typically you'd have a base directory where all your pages sit, often called public_html, and then part of the URL would specify a path under that directory. What part of the URL? That depends on your server as well. But for a URL like http://www.coderanch.com/html/forums/jig/faq.html, it's probably the "/forums/jig/faq.html" part.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!