Detailed explanation of how to configure the tomcat external server in HBuilderX to view and edit the jsp interface

Detailed explanation of how to configure the tomcat external server in HBuilderX to view and edit the jsp interface

1. The first method is to start the local tomcat and view jsp

Create a folder HBuilderX in the webapps directory of tomcat

Open HBuilderX software, click File/Import/Import Local Files, and find the webapps of tomcat

This is what a successful import looks like.

Open the tool settings, find the run settings, external web server call url, enter http://localhost:8080. The port number behind it is the default port of your tomcat. If it has not been modified, it is 8080. Because I changed it to port 80 (port 80 is optional), it is not filled in the configuration. Pay attention to the option below, whether the external web server url contains the project name. If you did not import the webpps directory when importing, but the next level directory, you need to check it.

Finally, we find the bin directory in the tomcat directory, open tomcat8w.exe, click start, and then view the jsp interface in HBuilderX

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Insert title here</title>
 </head>
 <%
  String a = "a";
 %>
 <%=a%>
 <body>
 </body>
</html>

Note that in this case eclipse cannot run the web program. If you want to run it, you need to click Stop to close it. After closing it, HBuilderX will not be able to view jsp. The second method below solves this problem.

2. The second method is to run the project and then view it. You can run the project at the same time and use HBuilderX to view jsp

  • This method needs to be configured in eclipse. Before configuring, we need to solve a problem first. That is, when we run the local tomcat, which is the above step, we enter http://localhost:8080 in the browser and find that there is no problem. The kitten page appears normally. However, after executing the web program in eclipse, entering http://localhost:8080 cannot enter the kitten interface. However, after adding the project name, http://localhost:8080/project name can access the project normally. Why is this?
  • The reason is that the Server locations path we just set in eclipse is: Use workspace metadata. When you start tomcat in eclipse and deploy the project, it is actually Eclipse that calls the core components of tomcat, which are built into eclipse. The startup and deployment have nothing to do with the real tomcat. Therefore, when you enter http://localhost:8080/ in the browser, it shows that it is not started. However, after entering http://localhost:8080/project name, it directly enters the built-in tomcat of eclipse, so it can be previewed.
  • Start configuring now

Double-click tomcat below to enter the configuration page. We find that Server Locations is gray. It doesn’t matter. We just need to remove the project under tomcat and clean it to configure it. The specific operation is to right-click tomcat, and there are ADD and Remove and Clean. After the clearing is successful, we select the middle option Use Tomcat installation to actually deploy to Tomcat, select the webapps directory under Tomcat in Deploy path, and finally set the timeouts in the upper right corner to 100 to prevent the project from being too large and taking a long time to start, judge the response timeout, and finally save.

After setting these, we only need to start the web program to see the project in the webapps in HBuilderX and view the jsp. If the imported directory is the next level of webapps, it needs to be re-imported.

Note that these settings do not mean that you can run a web project and local tomcat at the same time, but that you can view jsp in HBuilderX when running the project. There is a problem with this method. There is a problem with saving changes in HBuilderX, or in the project under webapps. If you re-run it in eclipse, the content in HbuilderX will still be overwritten. The specific reasons are not explained here. Two solutions are given. One is to copy it directly to eclipse after modification. The other is to copy the jsp file directly from the project to the HBuilerX created in the first step, and then perform the operation to prevent accidentally re-running the program and doing useless work.

Summarize:

Although these two methods solve the problem of viewing and editing jsp using HBuilderX, they are still quite troublesome due to problems with the HBuilderX software. If you edit the jsp code, it is recommended to do it directly in eclipse. If you need to adjust the html code in the jsp, you can configure it in this way. Finally, with the above configuration, any files in HBuilderX that are not under webapps will not be able to run. You only need to delete the external web server call url in the configuration to restore it to normal.

This is the end of this article about HBuilderX configuration of tomcat external server to view and edit jsp interface. For more relevant content about HBuilderX configuration of tomcat external server, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to install Node.js10 or above on Centos7
  • Node.js Express Installation and Usage Tutorial
  • How to solve the problem that Linux cannot install and uninstall Node.js normally
  • How to solve the error 2503 and 2502 when installing Node.js on Windows
  • Node.js installation and environment configuration method under Windows
  • Detailed explanation of node.js installation and HbuilderX configuration

<<:  vue+element custom query component

>>:  How to use mysqladmin to get the current TPS and QPS of a MySQL instance

Recommend

W3C Tutorial (8): W3C XML Schema Activities

XML Schema is an XML-based alternative to DTD. XM...

Use Typescript configuration steps in Vue

Table of contents 1. TypeScript is introduced int...

Vue image cropping component example code

Example: tip: This component is based on vue-crop...

Sample code for realizing book page turning effect using css3

Key Takeaways: 1. Mastering CSS3 3D animation 2. ...

Analysis of the process of simply deploying nginx in Docker container

1. Deploy nginx service in container The centos:7...

Docker binding fixed IP/cross-host container mutual access operation

Preface Previously, static IPs assigned using pip...

Setting the engine MyISAM/InnoDB when creating a data table in MySQL

When I configured mysql, I set the default storag...

Troubleshooting of master-slave delay issues when upgrading MySQL 5.6 to 5.7

Recently, when upgrading the Zabbix database from...

HTML web page creation tutorial Use iframe tags carefully

Using iframes can easily call pages from other we...

Nginx URL rewriting mechanism principle and usage examples

URL rewriting helps determine the preferred domai...

How to configure the Runner container in Docker

1. Create a runner container mk@mk-pc:~/Desktop$ ...

MySQL 8.0.18 stable version released! Hash Join is here as expected

MySQL 8.0.18 stable version (GA) was officially r...

Delegating Privileges in Linux Using Sudo

Introduction to sudo authority delegation su swit...

Detailed steps to use Arthas in a Docker container

What can Arthas do for you? Arthas is Alibaba'...