How to Run Spring MVC in Weblogic server

9:07 PM Hendry 0 Comments

What you need to have


1. Eclipse IDE with Spring Tool Suite Installed
2. Spring MVC Project
3. weblogic.xml
4. Running Weblogic server

Create weblogic.xml


1. Right click on "WEB-INF" folder and select "New" > "Other"



2. Create "XML" file and name it as "weblogic.xml"



3. "weblogic.xml" is now created under "WEB-INF" folder


4. Copy below codes and paste into your weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
<context-root>CreateSpringMVC</context-root>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>

5. Export project as WAR file, and install on your weblogic server 

How to create Spring MVC Project in Eclipse

11:37 PM Hendry 0 Comments



What you need to have
1. Eclipse IDE JEE
2. Spring Tool Suite
3. Apache Tomcat


Apache Tomcat Installation

1. Download Apache Tomcat download here


2. Extract zip file to your local directory
Eclipse Installation


1. Download Eclipse IDE Java EE download here

2. Extract zip file to local directory
3. Run eclipse.exe, and create your workspace for eclipse project repository
4. You should see eclipse welcome page


Spring Tool Suite Installation


    1. Navigate to Help > Eclipse Market Place


    2. Eclipse Marketplace window opened, then search "STS"

    3. Click "Install" Spring Tool Suite (4.4) 3.6.4 RELEASE
    4. Click "Confirm" 

    5. Select "Accept" and click "Finish"




    You are now installing Spring Tool Suite


    1. Restart spring

    2. Confirm that Spring is installed successfuly. Navigate to Help > About Eclipse
    3. About Eclipse window opened, click "Spring IDE Developers"

    4. Spring Tool Suite was installed successfully 



    Create Spring MVC Project

    1. Navigate to File > New > Others

    2. Select "Spring Project" 


    3. Select "Spring MVC Project",  Name your project, and click "Next"


    4. Name your project package, and click "Finish"


    5. You should now see your project on "Project Explorer" tab


    Run your Spring MVC Hello World on Local Apache Tomcat


    1. Right click on your project > Run As > Run on server 



    2. Select "Tomcat v8.0", and click "Next"



    3. Browse to your apache tomcat directory, and click "Finish"



    4. You may encounter a problem when starting tomcat because port 8080 is in use. Just click "OK"


    5. Open "Servers" tab at the bottom, and double click



    6. Tomcat overview window is now open, change HTTP/1.1 port from 8080 to for example 8082 then press "Enter". Close the window and save changes.



    7. Run your project ( Right click on your project , select "Run as" > "Run on server" > "Finish"


    8. Done!