JSP preliminary study notes (including installation software)

Install software

Install myeclipse10 (880M+)

Link: https://pan.baidu.com/s/1WFVij8lGFN5F0RTS5VuTKw
Extraction code: 1111
After downloading, go directly to the next step *n to complete the installation

You can also search and download directly from the computer butler

Activate myeclipse10

Gangster Tutorial Portal Thieves!

Install tomacat

Download tomcat

Go to tomacat official website -> click tomcat9 in download -> download 64-bit -> unzip after downloading to the path of frequently installed software (mine is C:\Program Files)
Insert picture description here

Configure tomcat

The premise is that the jdk has been configured and installed (you can jump to it if you don't configure it ) The
configuration variables are as follows:
Insert picture description here

Check whether tomcat is configured successfully

Open the folder where tomcat is located ->bin->select startup, open tomat and
Insert picture description hereenter localhost:8080 in the browser address bar. The configuration is successful when the following page is displayed
Insert picture description here

myeclipse connect tomcat

Open myeclipse->in myeclipse, select windows->preferences-> search tomcat in the upper left corner,
right-click myeclipse tomcat6, select disable (disable the tomcat that comes with myeclipse),
right-click tomcat7.0x->select enable->click browse to select the location after tomcat decompression Folder (connect to tomcat)
Insert picture description here

Click JDK under tomcat7.0x->click Add to select the folder where the JDK is located.
Insert picture description hereAt this time, the connection is successful (there is already tomcat7.0x in the servers. If the servers window is not displayed, click windows->show view->others->search servers-> OK)
Insert picture description here

Create the first page

In the upper left corner of myeclipse, new->web project->here named first->click the index.jsp file in this folder to start editing the webpage. After
writing, right-click tomcat7.0x in the servers->select add deployment-> finish (here is to publish the project to tomcat)
Insert picture description here

Search your own webpage

Enter localhost:8080/first (web project name) in the address bar of any browser to view the content in index.jsp. If the index file is not modified, the default display "This is my JSP page."
Insert picture description here

Chinese garbled problem

If you copy the code in the book directly, there will be no garbled problem in myeclipse8.5. If you copy and paste directly in myeclipse10, there may be a Chinese garbled problem in the web page.
First, set the workbench and related file encoding methods to UTF-8
and then set the default. Copy back a bunch of code

Window–>Preferences–>General–>Workspace–>UTF-8–>Apply
Insert picture description hereWindow–>preferences–> Genera–>Content Types–>Select HTML and JSP–>Enter UTF-8->Update->OK to
Insert picture description hereexplore Baidu After a long time, the problem finally lies here... Just copy the original one back (of course the encoding should be changed to UTF-8)
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_43760243/article/details/108833160