tasks on java

Ads

 
 

Share on Google+Share on Google+

mastan
tasks on java
1 Answer(s)      8 years ago
Posted in : JSP-Servlet
Ads
View Answers

December 13, 2008 at 12:56 AM


Hi friend,

Code for print "Hello World" in Servlet :

"HelloWorld.java"

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

public class HelloWorld extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException,IOException{
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("<html>");
pw.println("<head><title>Hello World</title></title>");
pw.println("<body>");
pw.println("<h1>Hello World</h1>");
pw.println("</body></html>");
}
}

"web.xml"

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">; -->

<web-app>
<servlet>
<servlet-name>Hello</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Hello</servlet-name>
<url-pattern>/HelloWorld</url-pattern>
</servlet-mapping>
</web-app>

For read more information,Examples and Tutorials on Servlet visit to :

http://www.roseindia.net/servlets/HelloWorld.shtml

Thanks

Ads









Related Tutorials/Questions & Answers:
tasks on java - JSP-Servlet
tasks on java  hi all, i am a beginner in java language ,i would like to practice some tasks in java..i have an idea about servlets, how to write code .so please can anyone forward a site which contains tasks on java
The common tasks of JDBC.
The common tasks of JDBC.  What are the common tasks of JDBC
Advertisements
Version of com.opencloud>slee-tasks dependency
List of Version of com.opencloud>slee-tasks dependency
Maven Dependency slee-tasks >> 1.0
You should include the dependency code given in this page to add Maven Dependency of com.opencloud >> slee-tasks version1.0 in your project
Version of dalma>dalma-ant-tasks dependency
List of Version of dalma>dalma-ant-tasks dependency
Version of com.orangevolt>orangevolt-ant-tasks dependency
List of Version of com.orangevolt>orangevolt-ant-tasks dependency
Version of maven-plugins>maven-tasks-plugin dependency
List of Version of maven-plugins>maven-tasks-plugin dependency
Version of com.jaroop>play-sbt-tasks-plugin dependency
List of Version of com.jaroop>play-sbt-tasks-plugin dependency
Maven Dependency dalma-ant-tasks >> 0.5
You should include the dependency code given in this page to add Maven Dependency of dalma >> dalma-ant-tasks version0.5 in your project
Maven Dependency orangevolt-ant-tasks >> 1.3
You should include the dependency code given in this page to add Maven Dependency of com.orangevolt >> orangevolt-ant-tasks version1.3 in your project
Maven Dependency dalma-ant-tasks >> ${pom.currentVersion}
You should include the dependency code given in this page to add Maven Dependency of dalma >> dalma-ant-tasks version${pom.currentVersion} in your project
Maven Dependency maven-tasks-plugin >> 1.0.0
You should include the dependency code given in this page to add Maven Dependency of maven-plugins >> maven-tasks-plugin version1.0.0 in your project
Maven Dependency maven-tasks-plugin >> 1.1.0
You should include the dependency code given in this page to add Maven Dependency of maven-plugins >> maven-tasks-plugin version1.1.0 in your project
Maven Dependency maven-tasks-plugin >> 1.2.0
You should include the dependency code given in this page to add Maven Dependency of maven-plugins >> maven-tasks-plugin version1.2.0 in your project
Maven Dependency maven-tasks-plugin >> 1.3.0
You should include the dependency code given in this page to add Maven Dependency of maven-plugins >> maven-tasks-plugin version1.3.0 in your project
Maven Dependency play-sbt-tasks-plugin >> 1.0.3
You should include the dependency code given in this page to add Maven Dependency of com.jaroop >> play-sbt-tasks-plugin version1.0.3 in your project
Java Multithreading Example
Java Multithreading Example In this section we will discuss how we can do a different task using the different threads. In Java Multithreading we can create multiple threads to run different tasks. This example will demonstrate you
Multithreading in Java
Multithreading in java is running multiple threads sharing same address space... Multithreading allows a process to run its tasks in parallel mode and execute these different tasks simultaneously. Following are 4 states of Thread: New
Java taskpriority
Java taskpriority  What is a tasks priority
Java API
Java API       What is Java API? Java API is not but a set of classes and interfaces that comes with the JDK. Java API is actually a huge collection of library routines
java
java  what is ment by daemon   Java Daemon Threads Daemon threads are like a service providers for other threads or objects running... supporting tasks and are only needed while normal threads are executing. For more
java
java  What is a daemon thread?  Daemon threads are used for background supporting tasks and are only needed while normal threads... ground doing the garbage collection operation for the java run time system
java - Java Beginners
java  how i can write code for task sheduling in core java ( that means we can store tasks in a file that tasks exicute with the given time)ex (: task date time : copy file1 to file 2 30/12/2009 10:35 am) that copy file work
java
tasks simultaneously within a program. The java come with the concept...java  what is java   Java is a programming language..., and business applications. Advantages of Java: * Java is simple, easy to design
java api
java api  what is work of api in java   An application programming interface (API) is a library of functions that Java provides for programmers for common tasks like file transfer, networking, and data structures
Java API
Java API       Java API Java API is not but a set of classes and interfaces that comes with the JDK. Java API is actually a huge collection of library
Multithreading ? - Java Interview Questions
Multithreading ?   Hi Friends, I am new to java... or a process to execute many tasks concurrently (at the same time and parallel). It allows a process to run its tasks in parallel mode on a single processor system
java code - Java Beginners
java code  plese provide code for the fallowing task Write a small record management application for a school. Tasks will be Add Record, Edit Record, Delete Record, List Records. Each Record contains: Name(max 100 char
Java scheduling
Java scheduling  What is the difference between preemptive scheduling and time slicing?  Under preemptive scheduling, the highest priority... slice of time and then reenters the pool of ready tasks. The scheduler
Java source code - Java Beginners
Java source code  Write a small record management application for a school. Tasks will be Add Record, Edit Record, Delete Record, List Records. Each Record contains: Name(max 100 char), Age, Notes(No Maximum Limit). No database
java - Java Beginners
or a process to execute many tasks concurrently (at the same time and parallel). It allows a process to run its tasks in parallel mode on a single processor system Multitasking : Multitasking allow to execute more than one tasks

Ads

 
Advertisement null

Ads