First, create a Java Web Project or Module
1 Create a static Java Web
clickpath
File-New-Module ...
Then create a static file in the module files (html, css, etc.)
2 create dynamic Java Web
2.1 of creating dynamic Web module
Engineering bar space new - module:
Here you must check the Web Application, you can create a Web project.
It provides Web project name. Note here that tinkering Content root and Module file location.
After the creation of the project is structured as follows:
Open index.jsp. Modified to read as follows. Here you will find the code hinting IDEA better than Eclipse.
3 Configuring Tomcat
Before you configure Tomcat in the IDEA, the need to ensure that Tomcat is already installed and configured the environment variables. If not installed and configured, after the configuration, at the command line: catalina run. Can start tomcat, the installation configuration proved successful.
Let's look at how to configure the IDEA:
1) Click Edit Configurations:
2) + Click here to choose TomEE Server or Tomcat Server can be. Then select Local.
3) the location where the configuration of Tomcat and configuring the name of the application server. Depending on the installation location of their decision Tomcat.
Other positions default value (set to start the browser and a port number), as described above
Then deployment, Application context complete the project name:
Click OK to
start tomcat
http request configuration, index.jsp effect executed just created as follows:
Information display after running Tomcat:
you can click on the red box, just click finish and can not shut down the server immediately, just disconnect from the server, and
later when the stop button is grayed out, it means closed.
4 associated database
1) associatively
Click DataBase- ± Click right side - Select Data Source
fill in the name of the database user name and password
on the surface of a lot of people think Configuration Database is to have a GUI database management functions, but this is not for IntelliJ IDEA Database The most important features. There are many GUI tool database, IntelliJ IDEA's Database not too obvious advantages. After Database is the biggest characteristic of IntelliJ IDEA for Java Web projects is concerned, ORM framework commonly used, such as Hibernate, Mybatis have good support, such as the Database configured, IntelliJ IDEA will automatically recognize the relationship between domain objects and data tables, domain may be generated by objects, etc. Database data tables directly.
Common database operations
Icon 1: synchronize the current database connection. This is the most important operations. After configured connection or through other means
, the need for timely operation after the synchronization database.
Icon 2: Configure current connection.
Icon 3: Disconnect the current connection.
Icon 4: the display data database objects
icon 5: Editing modify the current database object