Reputation: 4128
I'm testing IntelliJ with a Maven Project, it creates the Project fine, the problem is that I don't see the option to add a Servlet, and i don't see an option to add a package eather. just JSP and JSF pages, this is the sub-menu I get, how can I add a servlet and a package?
Upvotes: 1
Views: 1429
Reputation: 1
in resources create a folder java in that folder create a package and in that package create a servlet
Upvotes: 0
Reputation: 115
I was experimenting a bit and came across a scenario which may be helpful for someone.
I created a directory main\java, which was created as a maven source directories as suggested by Intellij by default as shown in image.
Then i marked src as source directory and i do not get option to create new servlet under created java directory.
So in this particular case if you want to create servlet then first go to, "Mark directory as > Unmark as sources root".
Now you can create servlet inside java directory as well.
Upvotes: 2
Reputation: 3859
This is because the folder on which you're invoking the context menu is not marked as a "source" folder.
One way of marking it is to right-click on it (in your case the "java" folder) and choose "Mark Directory As > Sources Root".
Upvotes: 3