Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet tasks on java
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


mastan
tasks on java
1 Answer(s)      6 years and a month ago
Posted in : JSP-Servlet



Advertisement
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


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
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 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 taskpriority
Java taskpriority  What is a tasks priority
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 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
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 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
Insectivore
Insectivore       The Insectivore project attempts to provide a way to share tasks in the "Tasks" view among team members. The first implementation uses a file
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       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
Java concurrency
Java concurrency utilities are classes used as building blocks in building... makes a program short, fast, easier to write, read and maintain. Java... implementations of building blocks. The new Java concurrency utilities have
ZF Data Insert in DB
. So, let's get started: To do database related tasks we need to create... the database related tasks in the form of functions. To know in details please
Maven 2 Eclipse Plug-in
Maven 2 Eclipse Plug-in         Plugins are great in simplifying the life of programmers; it actually reduces the repetitive tasks involved in the programming. In this article
Java Layout
Java Layout       In java a layout manager class implements the LayoutManager interface. It is used... the container. There are some of the common tasks associated to use layout managers
Java - Java Beginners
to complete the following tasks (a) Describe the manual procedure, if one has to use... codes (sorting and partitioning) to Java. It should be able to execute any set... and contrast it to the quicksort algorithm (f) Write a java program
java thread problem - Java Beginners
java thread problem  Hi Friends, My problem is related with java.util.concurrent.ThreadPoolExecutor I have a thread pool which using... to log my objRunnable either in DB or filesystem in case number of tasks in queue
Open Source Hardware
. It is a freely distributed piece of software for such tasks as photo retouching, image... written in the programming languages C, Ch, C++, Java, Lisp, Pascal, Perl, PHP... source, Java GIS toolkit for developing standards compliant solutions. It's modular
source code in java for a program using class - Java Beginners
source code in java for a program using class  Dear sir/madam i want source code in java for following program: WAP which creates a class... to their requirements.include the necessary member methods in order to accomlish following tasks: *accept
Iteration
. Repetition of similar tasks is what Iteration is and that too without making any...; The for Statement In the world of Java programming, the for loop has made... C:\javac>java printDemo Hello World! Hello
Java Programming
Java Programming  Assume that bank maintains two kinds of accounts... to their requirements. Include the necessary methods in order to achieve the following tasks...://www.roseindia.net/tutorial/java/core/bankAccountApplication.html   thnk
Multithreading in Java
Multithreading in Java      ... tasks at the same time, a task being a program. In multitasking only one CPU... a program or a process to execute many tasks concurrently (at the same time
IBM Cloudscape Workbench
and DB2 databases, and performing common tasks such as browsing schemas... based offerings. The two versions of the tool require a Java Runtime Environment
java
java  diff bt core java and java
Advertisements
 

 

 

DMCA.com