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