Getting started with Struts2 & Google Map Integration
How to integrate Google Map in Struts2 Application.
Introduction
This tutorial shows how to integrate google map in Struts2 application.This is the most simple way to add google maps to struts2 web app https://github.com/lalotech/struts2-map-plugin. You can find that a lot of javascript is avoided and you can do it struts2 way i.e using tag lib.
-Struts2-plugin-map is a project that seeks full implementation of Google Maps JavaScript API V3? in a customtag Based on Struts2 tag of struts2-jquery projects like http://code.google.com/p/struts2-jquery/.
Now Let’s get started
Create a project in Eclipse
Open Eclipse and create new Project –> Dynamic Web Project.
Generate web.xml And Finish.
Before continuing to this Project, let us see the Jars used in this tutorial :
The Jars are added in the Classpath to this Project
Create MapAction.Java
Create a new Class MapAction in your package, the package is com.project.map
Create Struts.xml
Create index.jsp
Add new Folder named views and Add New Jsp File, in our case named index.jsp
Web.XML
Add the Filter for Strust2 in Web XML
Before you run the project , make sure your project looks like the following picture
Run the Project on the Server.
You can move on the map and choose Map or Satellite.
In our case we choose Tunisia ❤
Enjoy it !!! I hope it will be useful for you all.
If you are interested in this tutorial, Give me your email in message and I will send it to you soon.
Don’t Forget Believe in YourSelf
Best Regards
@Achrefo
Good Job !!!!