answersLogoWhite

0


Best Answer

If ur developing servlet program manually.The First thing is that u have to put servlet-api jar file should be set in classpath. The root directory is like that

create a folder name.inside the folder create one more folder name WEB-INF. Inside the WEB-INF folder create two folders one is classes and another is Lib

In the WEB-INF folder you have to put web.xml. In classes you have to put servlet.java. In Lib u have to put servlet-api.jar file. Go to command prompt then compile servlet.java .Create a war file. steps to create war file file jar cvf name.war . enter .open the browser type the bar http://localhost: portnumber enter & then apache tomcat server start.Click tomcat manager.It will ask username & password.

then submit.In the downstairs page there is a option name War file to deploy .Click on choose file.It will locate where is the war file .Select it & deploy it.click the programs then you have to type in the addresss bar what u had written in url-pattern in web.xml then enter u get the output.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

No file pages only txt documents is

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you save java servlet program for running?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Can you write java program in Microsoft Word?

Since the Java program is basically a text file, you can write it in any text editor (although using a Java IDE, or an IDE with support for Java, does give you certain advantages). Thus, you can use programs such as NotePad or NotePad++ to write the Java program. Using word processors such as MS-Word is problematic, because these insert additional codes. You would have to make sure you save the resulting file in the text format - give the "Save As" command, and choose a text format from the list.


How do you save a notepad file into a java file?

just add an extension .java when you save your notepad text file


How to write java program without using main method?

Java program without mainWe need a main method for executing a program.But YES we can write a program without using main() method.TRICK 1 of 2 :: while writing applets in java we don't use main... we use init() method instead.TRICK 2 of 2 :: using 'static' we can write a program whic will execute successfully and output the desired message on screen. Here it is :: class Mohit{ static { System.out.println("This java program has run without the main method"); System.exit(0); } } -->save the program as Mohit.java to compile::javac Mohit.java (in command prompt) to run ::java Mohit(command prompt) output will be ::This java program has run without the main methodWhoa!!!!! we are done.;)


Give sample program?

class firstprog { public static void main (String args[]) { System.out.pritnln("My first Program in Java "); } } Simple Java Programe Write the above program in Ms dos's edit or Notepad of Windows save it with "firstprog.java" run the commands given below in command prompt of Ms Dos to get the output Remamber Java is case sensative so mentain capital and small letter. 1. javac firstprog.java 2. java firstprog


Explain the structure of a java program?

The fundamental structure of any Java programme should look like: [package declarations] [import statements] [class declaration] An example is given below: package abc; import java.lang; class Demo { public static void main(String[] args) { Sytem.out.println("Hello! World"); } } //The file containing this class must be named Demo.java

Related questions

How do you open java script?

You need to have some program that can open/run them on your computer. To save them, then run them, save them as a .Js files.


Can you write java program in Microsoft Word?

Since the Java program is basically a text file, you can write it in any text editor (although using a Java IDE, or an IDE with support for Java, does give you certain advantages). Thus, you can use programs such as NotePad or NotePad++ to write the Java program. Using word processors such as MS-Word is problematic, because these insert additional codes. You would have to make sure you save the resulting file in the text format - give the "Save As" command, and choose a text format from the list.


Copy running-config startup-config?

it save the current program to nvram


What are SWAP files used for?

A disk file used to temporarily save a program or part of a program running in memory


How do you save a notepad file into a java file?

just add an extension .java when you save your notepad text file


How to write java program without using main method?

Java program without mainWe need a main method for executing a program.But YES we can write a program without using main() method.TRICK 1 of 2 :: while writing applets in java we don't use main... we use init() method instead.TRICK 2 of 2 :: using 'static' we can write a program whic will execute successfully and output the desired message on screen. Here it is :: class Mohit{ static { System.out.println("This java program has run without the main method"); System.exit(0); } } -->save the program as Mohit.java to compile::javac Mohit.java (in command prompt) to run ::java Mohit(command prompt) output will be ::This java program has run without the main methodWhoa!!!!! we are done.;)


Give sample program?

class firstprog { public static void main (String args[]) { System.out.pritnln("My first Program in Java "); } } Simple Java Programe Write the above program in Ms dos's edit or Notepad of Windows save it with "firstprog.java" run the commands given below in command prompt of Ms Dos to get the output Remamber Java is case sensative so mentain capital and small letter. 1. javac firstprog.java 2. java firstprog


Is there any problem arrives if the program running currently gets automatically closed and if it is a problem what is the solution for it?

It depends on the Program, In some cases, programs will auto-save every so often. If your program did not auto-save and you did not manually save the program, It is moi likely that all the information that your program had on it from the time you started it to the time it crashed, is gone. Adios Asta la Vista Baby. I hope it wasn't something too important and/or difficult to do, Whatever program you were running. I hope you can make up for lost time though, Friend! :) Like a good neighborhoodlum, Tylor is there!


Explain the structure of a java program?

The fundamental structure of any Java programme should look like: [package declarations] [import statements] [class declaration] An example is given below: package abc; import java.lang; class Demo { public static void main(String[] args) { Sytem.out.println("Hello! World"); } } //The file containing this class must be named Demo.java


Can you save java source file without saving?

So you want to save a file, without saving it... You have some stuff to learn before you tackle java.


How do you compile your java code?

save it into a .java file. then open command prompt and navigate to your java bin directory. then type CD then your java bin directory. then type this . javac ProgName.java


How to save and compile packages in java?

by adding more documents