Java Server faces und Google-Maps

schlumsch

Mitglied
Hallo allerseits,

ich beschäftige mich erst seit kurzer Zeit mit Java und hoffe es kann mir vielleicht jemand von euch helfen, sei es mit Links oder Code oder Tips... hier also mal das Thema:

Ich möchte mit JSF und Google-Maps Informationen von Hotels darstellen lassen. Es soll also eine Seite dargestellt werden, welche einmal eine Map abbildet auf der die Hotels mit Pins gekennzeichnet sind. Daneben soll dann eine weitere Tabellenspalte die zusätzlichen Informationen der Hotels anzeigen.

Bislang habe ich mir eine Klasse und ein bean gebastelt, in welchem ich eine Liste von Hotels („hotels“) speichere und 3 einzelne Hotels mit ein paar Daten auffülle. Hat sich vielleicht schon wer von euch mit einem ähnlichen Thema beschäftigt und kann mir helfen, die Daten aus meiner Hotelliste in die oben erwähnte Map und zugehörige Tabelle zu bekommen? Wäre euch sehr dankbar und danke schon einmal im Voraus... Hier auch mal ein Auszug aus meinem Code...

lg!

Code:
//
// hotel.java
//
package com.e2e.portal.hotel;

public class Hotel {
   private String name, adresse;
   private double longitude, latitude;
   

   public Hotel() {
      // TODO Auto-generated constructor stub
      name = "";
      adresse = "";
      longitude = 0.0;
      latitude = 0.0;
   }

   public Hotel(String name, String adresse, double longitude, double latitude) {
      super();
      this.adresse = adresse;
      this.latitude = latitude;
      this.longitude = longitude;
      this.name = name;
   }


   public String getName() {
      return name;
   }


   public void setName(String name) {
      this.name = name;
   }


   public String getAdresse() {
      return adresse;
   }


   public void setAdresse(String adresse) {
      this.adresse = adresse;
   }


   public double getLongitude() {
      return longitude;
   }


   public void setLongitude(double longitude) {
      this.longitude = longitude;
   }


   public double getLatitude() {
      return latitude;
   }


   public void setLatitude(double latitude) {
      this.latitude = latitude;
   }

Code:
//.......................................................
//
// hotelBean.java
//

package com.e2e.portal.hotel;

import java.util.ArrayList;
import java.util.List;

import com.e2e.common.user.UnknownUserException;
import com.e2e.itps.user.UserAuthentication;
import com.e2e.itps.user.UserContext;
import com.e2e.portal.service.User;

import e2e.ta.portal.model.UserProfile;


public class HotelBean {
   private List<Hotel> hotels;
   

public HotelBean() {
// KONSTRUKTOR
   
hotels = loadHotels();   
      
}
   
   private List<Hotel> loadHotels ()   
   {
      List<Hotel> result = new ArrayList<Hotel> ();
      for (int i=0; i<3; i++) {
         double x = i;
         Hotel tmpHotel = new Hotel("Horst"+i, "a", 51+x, 11);
         result.add(tmpHotel);         
      }
      return result;
   }
   

   public List<Hotel> getHotels() {
      return hotels;
   }


   public void setHotels(List<Hotel> hotels) {
      this.hotels = hotels;
   }
}

Code:
//.......................................................
//
// hotelBean.java
//

package com.e2e.portal.hotel;

import java.util.ArrayList;
import java.util.List;

import com.e2e.common.user.UnknownUserException;
import com.e2e.itps.user.UserAuthentication;
import com.e2e.itps.user.UserContext;
import com.e2e.portal.service.User;

import e2e.ta.portal.model.UserProfile;


public class HotelBean {
   private List<Hotel> hotels;
   

public HotelBean() {
// KONSTRUKTOR
   
hotels = loadHotels();   
      
}
   
   private List<Hotel> loadHotels ()   
   {
      List<Hotel> result = new ArrayList<Hotel> ();
      for (int i=0; i<3; i++) {
         double x = i;
         Hotel tmpHotel = new Hotel("Horst"+i, "a", 51+x, 11);
         result.add(tmpHotel);         
      }
      return result;
   }
   

   public List<Hotel> getHotels() {
      return hotels;
   }


   public void setHotels(List<Hotel> hotels) {
      this.hotels = hotels;
   }
}
 

Neue Beiträge

Zurück