Home Answers Viewqa JSP-Servlet tasks on java

 
 


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

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 Pages:
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
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
Loop break statement
Java NotesLoop break statement Loops are often used to accomplish the same kinds of tasks, so many loops tend to be one of several common styles. Loop reading input Immediate loop exit. When you execute a break statement, the loop
Loop Idioms
Java NotesLoop Idioms Loops are often used to accomplish the same kinds of tasks, so many loops tend to be one of several common styles. Loop reading input It's very common to read input in a loop: read a value, process it, go back
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
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
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  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
Eclipse Plunging/UI
this by making tasks a first class part of Eclipse, and integrating rich... your tasks are integrated, Mylyn monitors your work activity to identify... for Java. It includes a comprehensive class library and integrated development
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
Maven 2 Eclipse Plug-in
; it actually reduces the repetitive tasks involved in the programming... or to enable Maven support on plain Java project · It helps to search quickly for dependencies in Maven remote repositories · It quickly fixes in the Java editor
Eclipse Plunging-Database
tasks such as browsing schemas, altering database objects, and working with SQL... This plug-in has many innovative features that allow Java professionals to easily... of the statements in their Java program. * Visual Database Browser  Allows users
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
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
Softabar Password Manager
generation helps you in your day to day tasks. Optionally accounts and passwords can.... Requirements: Windows 2000 or XP for Windows installer. Java 5.0.
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 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 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
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 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
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 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
Open Source ERP/CRM written in Java - Java Beginners
Open Source ERP/CRM written in Java  I seek an Open Source ERP/CRM RECRUITMENT database. to integrate - candidate/client/tasks/records/ and for functionality use. Please advise
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
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
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
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 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
Java Memory Leak - Java Beginners
Java Memory Leak  I am having a memory leak in my java version of the game Snake. I have narrowed the exact step of when the program memory... and creating of new ones and new timer tasks. Whenever this.pack() is called
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 problem - Java Beginners
java problem  Hotel.java This file declares a class of object which.... Next you need to perform some initialisation tasks for the rooms as described... from a small Java program
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
java problem - Java Beginners
java problem  Room.java This file defines a class of Room objects... will be created. Next you need to perform some initialisation tasks for the rooms... from a small Java program. HotelMain.java The aim of this class is to provide
Multithreading in Java
Multithreading in Java      .... Multitasking : Multitasking allow to execute more than one tasks... or a process to execute many tasks concurrently (at the same time
Features of Java
Features of Java: Java is one of the most popular language in the field... programming is its large number of important and robust features. Java can be used... applications. Java has various important features: SIMPLE Java
Java Ant
Java Ant       In this section, you will learn about the java ant tool. Apache Ant is a software tool... applications) but is written in the Java language, requires the Java platform
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
Nested If Statements
condition is not true then it should do some other tasks. Consider a situation where
Java EE
instead of the infrastructure and integration tasks.     Like Java... Java EE       Java Platform, Enterprise Edition or Java EE is builds on the solid foundation of Java
Java Thread
sequential flow of control within a program. Programmer may use java thread mechanism to execute multiple tasks at the same time. In Java Programming language, ... Java Thread       A java
servlet - Java Beginners
servlet performs specific tasks for a web server and returns the results formatted... java code constructs (classes, methods, fields, etc.) with metadata information
Eclipse Tidy
Eclipse Tidy         HTML Tidy Eclipse plug-in provides two very useful tasks of HTML Tidy: Formatting and Checking (X)HTML or XML code. It doesn't provide any editor
Xcarecrows 4 XML
graphical editor to perform the daily tasks required when working with XML... tasks required by an XML workflow. To this end, Xcarecrows 4 XML offers
Java hibernate
Java hibernate      ... mapping tool for Java platform. Hibernate maps java classes to database tables... programming tasks. It is most useful with object-oriented domain models and business logic

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.