Quantcast
Channel: Active questions tagged servlets - Stack Overflow
Viewing all articles
Browse latest Browse all 717

How do I create a new Servlet class in IntelliJ

$
0
0

Summary: The Create new servlet doesn't show up in the File > New > ... menu and I'm convinced this did work in older versions of InteliJ.

I'm using InteliJ 2024.1.1 Utlimate.

I've created a maven project and added this dependency:

<dependencies><dependency><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>4.0.1</version><scope>provided</scope></dependency></dependencies>

Clicked "Reload all maven projects".

Everything seems to be working as I'm used to from older versions of IntelliJ: src/main/java is marked as sources root, src\main\webapp\WEB-INF\web.xml is detected as deployment descriptor, src/main/webapp is detected as web resource directory.

Now I'd expect File > New > ... to contain Create new servlet.

I've even found a template that I would think is (or was) used by this shortcut:Settings > File and Code Templates > Other > Web > Java code templates > Servlet Class.java

Some of the answers in this very similar question imply that this should work:Where can i find to create new servlet file with intellij?

InteliJ's documentation says I should create a template myself:https://www.jetbrains.com/help/idea/creating-and-configuring-web-application-elements.html#elements-templates

Am I doing something wrong or do I really need to add a new file template myself?


Viewing all articles
Browse latest Browse all 717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>