简体   繁体   English

将Maven框架添加到intelijidea中的Web应用程序后无法创建servlet文件

[英]servlet files cant create after add maven framework to the web application in intelijidea

I followed below steps 我按照以下步骤

  1. new project 新项目
  2. selected "java" type and marked the web application enter image description here 选择“ java”类型并标记为Web应用程序,请在此处输入图片描述

  3. gave a name for the project 给这个项目起个名字

  4. right click on the project and select maven 右键单击该项目,然后选择Maven

after add maven framework I cant see servelet file to create whatever the right click on the java folder and went to the new. 添加Maven框架后,我看不到servelet文件来创建任何右键单击java文件夹并转到新目录的文件。 but before add maven framework I can create servlet files. 但是在添加Maven框架之前,我可以创建servlet文件。

I can see the pom file and web.xml file both in the project path. 我可以在项目路径中看到pom文件和web.xml文件。

After you created your maven project you need to add web application module to your project. 创建maven项目后,需要将Web应用程序模块添加到项目中。


1. You should click right your project name(right side in your window intellij) 1.您应该在项目名称上单击鼠标右键(在窗口intellij的右侧)
2. Click add module and then select web application 2.单击添加模块,然后选择Web应用程序
3. Click OK 3.点击确定
4. Now you can add servlet in your project 4.现在,您可以在项目中添加servlet。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM