This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes HTML page-tomcat servlet interaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTML page-tomcat servlet interaction" Watch "HTML page-tomcat servlet interaction" New topic
Author

HTML page-tomcat servlet interaction

Jim Barkley
Greenhorn

Joined: Jun 23, 2011
Posts: 12
Hi. I'm new to using java servlets.


The model I'm trying to create looks like this


Front web page(not a part of webapp for within Tomcat; just a standalone HTML page) -> Java servlet(in Tomcat) -> Remote Machine(Do some work here)

then the response generated in remote machine is delivered back to the web page.


How do I "return" something back to the web page from servlet?



I created an Ajax request from a javascript attached to the web page, which is sending a GET request to the servlet. I want to have the servlet give back a String to the web page.


In PHP, I'd use the print() method.


Do I just use Printwriter.println()? Or Printwriter.write()?



Thanks in advance.
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

I believe, either of the two are ok (unless you are worried about efficiency).


S.D. MADHAN
Not many get the right opportunity !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTML page-tomcat servlet interaction
 
Similar Threads
Providing dynamic content from separate web/app servers
Web Container
jsp:include page="header.html" causes IllegalStateException
IBM HttpServer and websphere Appserver
jsp:include page="header.html" causes IllegalStateException