Create a Maven Web Project using Intellij IDEA


Open Intellij
File -> New Project
Maven
next

GroupId: com.skills421.training.web
ArtifactId: WebProject

Right click in pom.xml
Generate -> Dependency Template

in artifactId start typing servlet-api and select from the drop down to get:

javax.servlet
servlet-api
LATEST

File -> Project Structure
Modules
+
Web

Create Artifact

now in our project we have web/WEB-INF etc

right click on web
new jsp
index.jsp

Hello Servlet

Hello Servlet

Edit Configurations (drop down, top right pane menu)
+ -> Tomcat Server -> Local

name: Tomcat Server

WARNING: no artifacts marked for deployment
Fix

webProject – exploded -> Apply -> OK

click run TomcatServer

builds and deploys the project to Tomcat

new package
com.skills421.training.servlet

new Servlet
RuleServlet
create Java EE 6 annotated class

right click @WebServlet
add maven dependency

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Up ↑

%d bloggers like this: