Struts2-GoogleMap

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.

struts-google-map-integration1

Generate web.xml And Finish.

struts-google-map-integration2

Before continuing to this Project, let us see the Jars used in this tutorial :

struts-google-map-integration3Add Jars to Java Build Path

struts-google-map-integration4

The Jars are added in the Classpath to this Project

struts-google-map-integration5

Create MapAction.Java

Create a new Class MapAction in your package, the package is com.project.map

struts-google-map-integration6

Create Struts.xml

struts-google-map-integration7

Create index.jsp

Add new Folder named views and Add New Jsp File, in  our case named index.jsp

struts-google-map-integration8

Web.XML

Add the  Filter for Strust2 in Web XML

struts-google-map-integration9Before you run the project , make sure your project looks like the following picture

struts-google-map-integration14Run the Project on the Server.

struts-google-map-integration10You can move on the map and choose Map or Satellite.

struts-google-map-tunisia-integration12

In our case we choose Tunisia ❤

struts-google-map-tunisia-integration11

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

One Response to “Struts2-GoogleMap”

  1. Gabriel October 24, 2015 at 4:47 pm #

    Good Job !!!!

Leave a comment