English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2006-06-12 17:14:44 · 1 answers · asked by mudholkar_pankaj 1 in Computers & Internet Programming & Design

1 answers

Hi, that is kinda a weak answer :)

Usually it is like this from JSP you produce HTML, and when you navigate to a LINK link like http://localhost /MyApp/MyMainServlet
The WEB.XML file will tell it where to navigate. For example:
======================================

MainControllerServlet
MainControllerServlet bankapp.web.MainControllerServlet


MainControllerServlet
/MainController.do

======================================

What the above xml descriptor does is that whenever I visit http://localhost/BankApp/MainContoller.do It will goto the ServletName called MainControllerServlet which points to the servlet class: bankapp.web.MainControllerServlet

Notice that is inside the package bankapp.web, Now inside that servlet you have your doGet and doPost and your computational within the beans and other yummy stuff :)

TO RUN!
Now If your using Eclipse IDE as your main IDE, you could download JBOSS from www.jboss.org, and download the server and the eclipse addon. It is pretty straight forward and you just right click on the project and make a package xml and deploy it. What is does is that it will automatically deploy it to the webserver. And you access it by doing http://localhost:8080/BankApp/

BUT if your not using that, you need to download Apache Tomcat
http://tomcat.apache.org/
What that does, it is a EJB/JavaBeans/JSP webserver. When you package your Servlet it will produce either .war or .ear dpending if its a EJB or a JavaBeans. In your case if it is JSP and Servlets, then it is only WAR. You place that War in htdocs within Tomcat and you navigate to http://localhost:8080/BankApp/

But now you tell me how do you package the whole thing to a war. That requires some practice, you need to read up on that

If you need more help let me know.
Take care

2006-06-12 17:47:53 · answer #1 · answered by ? 6 · 0 0

fedest.com, questions and answers