Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Output from a server to a html page

 
Allypodyman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am new to programming in Java, my first assignment is to Post a information from HTML page , call a servlet and then after some processing save the output in a html page (not spew out to a browser). I mean to say that I will have to write my output to a file that can be viewed from a browser as a HTML page. Could anyonew help me in this.
Thanks and Regards
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13077
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What servlet engine are you supposed to be using? If you have it installed, what examples/demos do you have available to study?
Bill

------------------
author of:
 
Allypodyman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Jakarta-Tomcat, I dont know the version no.... I will try to look for the examples.... but the actual dillema for me is to write the HTML code on the file and put some images in.
Thanks
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Allypodyman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi if the line
File f = new File("/examples/servlets/index2.html")
looks like that , then where does the output go
Thanks
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please note that The Java Ranch has a naming policy, described here and "Allypodyman" is not a valid name. Please choose one which meets the requirements.
Thanks.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would go to the directory /examples/servlets/ off the root. The file specified has nothing to do with the web server software so it isn't based off the location of the htdocs, for example.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic