Configure Tomcat in MyEclipse and write the first JSP program, my‑setomcat

Source: Internet
Author: User

Configure Tomcat in MyEclipse and write the first JSP program, my‑setomcat

Install myeclipse and configure the tomcat server. In the window, select servers


Select the tomcat folder path (my folder is obtained from someone else)


Select enable.


This interface appears


You can enable or disable the server here.

After opening the server, you can open the browser to see if the tomcat server has been opened

URL: http: // localhost: 8080/


Create a network project named myJsp.


Then there are the following


Open with allows you to Open the graphical development drag Interface


Right-click the new servlet Program

Jsp is the display interface view

Servlet transfer user request control

Java program is model

Mvc Architecture

Open the website after writing the program

Http: // localhost: 8080/myJSP/

 

Enter the name in the browser

Passed through servlet

The servlet key program is

Public voidDoPost (HttpServletRequest request, HttpServletResponseresponse)

ThrowsServletException, IOException {

String I = request. getParameter ("name ");

Test a =NewTest (); // related to the following java program

A. wawa (I );

}

 

On the console

Output this value in a java program

 

Java program is

Public classTest

{

Public voidWawa (String q ){

System.Out. Print ("name is" + q );

}

}

Deploy this project on the jsp server and select adddeployment.


Select project name


Input name by submission

 

If you access

Http: // your IP address: 8080/myJSP/you can also get the name he entered (the wired network connected to both computers during my test)

If other jsp files are added, add the file name directly after the path, for example

Http: // your IP address: 8080/myJSP/main. jsp




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.