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



Home Answers Viewqa JSP-Servlet tasks on java

Have Programming Question? Ask it here!
 
 
 


mastan
tasks on java
1 Answer(s)      5 years and 7 months 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
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
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 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
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
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
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
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
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
java  diff bt core java and java
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
java
java  what is java
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
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
Java
Java   Whether Java is pure object oriented Language
java
java  different between java & core java
java
java  explain technologies are used in java now days and structure java
java
java   why iterator in java if we for loop
JAVA
JAVA  how the name came for java language as "JAVA
java
java  what is java reflection
java
java  is java open source
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
what is the size of array in java ?  what is the size of array in java ? what is the mean of finalize in java
java
java   in java does not pointers concept but what is nullpointers in java?   nullpointer is a runtime Exception
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
java  write a java program using filenotfoundexception
Java
Java  how to draw class diagrams in java
java
java   difference between class and interface
java
java  why multiple inheritance is not possible in java
java
java  explain object oriented concept in java
java
java  is java purely object oriented language
Java
Java   Whether Java is Programming Language or it is SOftware
java
java  what are JAVA applications development tools
Advertisements
 

 

 

DMCA.com