1 Replies - 1072 Views - Last Post: 30 January 2012 - 08:23 AM

#1 brdstnstrnglr  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 23-February 11

Question, trying to use JavaScript to publish HTML page on localhost

Posted 30 January 2012 - 08:12 AM

Hi, I'm trying to use Javascript to create an HTML page on a local host tomcat server. I'm using Eclipse Indigo for the programming and when I run my code it brings up an internet window but I get an "unable to connect" message. following is my code, if anyone could give me an idea what I am missing or have wrong I'd greatly appreciate it.

//**********Begin: HelloWorlServlet.java*************//


import java.io.*;
import java.servlet.*;
import java.servlet.http.*;

public class helloWorld extends HttpServlet
{
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
					throws ServletException, IOException
	{
		PrintWriter out = resp.getWrite();
		out.println("<html><body>Hello World</body></html>");
		out.close();
	}
}



Is This A Good Question/Topic? 0
  • +

Replies To: Question, trying to use JavaScript to publish HTML page on localhost

#2 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2860
  • View blog
  • Posts: 10,964
  • Joined: 15-July 08

Re: Question, trying to use JavaScript to publish HTML page on localhost

Posted 30 January 2012 - 08:23 AM

Javascript != Java

In your case, this is JavaEE, so I'm going to move it the the JavaEE forum.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1