You need to follow the following steps to create the servlet in the myeclipse IDE. The steps are as follows: |
- Create a web project
- create a html file
- create a servlet
- start myeclipse tomcat server and deploy project
1) Create the web project:
For creating a web project click on File Menu -> New -> web project -> write your project name e.g. first -> Finish. |
2) Create the html file:
As you can see that a project is created named first. Now let’s explore this project. |
For creating a html file, right click on WebRoot -> New -> html -> write your html file name e.g. MyHtml.html -> Finish. |
As you can see that a html file is created named MyHtml.html. Now let’s write the html code here. |
3) Create the servlet:
For creating a servlet click on File Menu -> New -> servlet -> write your servlet name e.g. Hello -> uncheck all the checkboxes except doGet() -> next -> Finish. |
As you can see that a servlet file is created named Hello.java. Now let’s write the servlet code here. |
Now let’s make the MyHtml.html file as the default page of our project. For this, open web.xml file and change the welcome file name as MyHtml.html in place of index.jsp. |
Click on the source tab to see the source code. |
Now change the welcome file as MyHtml.html in place of index.jsp. |
4) Start the server and deploy the project:
For starting the server and deploying the project in one step Right click on your project -> Run As -> MyEclipse server application. |
The default port of myeclipse tomcat is 8080, if you have installed oracle on your system, the port no. will conflict so let’s first change the port number of myeclipse tomcat server. For changing the port number click on the start server icon at the left hand side of browser icon -> myeclipse tomcat -> Configure server connector -> change the port number as 8888 in place of 8080 -> apply -> ok. |
Now change the port number as 8888 in place of 8080 -> apply -> ok. |
Now port number have been changed. For starting the server Right click on your project -> Run As -> MyEclipse server application. |
As you can see that default page of your project is open, write your name -> go. |
I¡¦m not positive where you are getting your information, however good topic. I needs to spend some time learning much more or working out more. Thanks for excellent info I used to be searching for this information for my mission.
My husband and i felt now lucky that Raymond could round up his research out of the ideas he came across using your web site. It’s not at all simplistic just to choose to be giving freely strategies people today may have been making money from. And we also figure out we’ve got you to be grateful to for that. All of the explanations you made, the easy web site menu, the relationships you help instill – it’s most sensational, and it’s really letting our son in addition to us believe that that situation is pleasurable, and that’s extremely important. Thanks for everything!