2 |
3 |
4 | ## 📌 Project Description :
5 |
6 | The **Weather App** is a web-based application that provides real-time weather information for any city around the world. It uses the **OpenWeather API** to fetch weather data such as temperature, humidity, wind speed, and more. The app is built using a combination of **HTML**, **CSS**, and **JavaScript** on the frontend, and **Java** , **Servlets** and **JSP** on the backend.
7 |
8 | ## 🚀 Technologies Used :
9 |
10 | - HTML
11 | - CSS
12 | - JavaScript
13 | - Java
14 | - Servlet
15 | - JSP
16 | - OpenWeather API
17 |
18 |
📷 Screenshots
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | ## 🧑💻 Features :
31 |
32 | - Search weather by City name.
33 | - Displays temperature, humidity, weather description, wind speed, etc.
34 | - Responsive and user-friendly interface.
35 | - API integration with OpenWeather for real-time data.
36 |
37 | ## 🔧 How to Run the Project :
38 |
39 | 1. Clone the repository
40 | ```bash
41 | git clone https://github.com/Shubham-Bhoite/Weather-App.git
42 |
43 | 2. Open the project in your IDE (e.g., Eclipse or IntelliJ).
44 |
45 | 3. Set up your servlet container (e.g., Apache Tomcat).
46 |
47 | 4. Download and include any required libraries (e.g., for HTTP requests or JSON parsing).
48 |
49 | 5. Get your API key from OpenWeather.
50 |
51 | 6. Insert your API key into the appropriate section of your Java code.
52 |
53 | 7. Deploy and run the project on your local server.
54 |
55 | 8. Open your browser and go to:
56 | ```bash
57 | http://localhost:8080/Weather-App/
58 |
59 | ## 🙋♂️ Author
60 |
61 | - **Shubham Rama Bhoite**
62 | [GitHub](https://github.com/Shubham-Bhoite) | [LinkedIn](https://www.linkedin.com/in/shubham-bhoite98/)
63 |
64 |
--------------------------------------------------------------------------------
/MyWeatherApp/src/main/webapp/myScript.js:
--------------------------------------------------------------------------------
1 |
2 | var weatherIcon = document.getElementById("weather-icon");
3 |
4 | var val = document.getElementById("wc").value;
5 | switch (val) {
6 | case 'Clouds':
7 | weatherIcon.src = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwFTkt5z_dxU6w1UnS1PxiZV3HDiPGsAW5Lrsp09MnlCmkQre9GzO8MnGytaaY1eZoqBN6SMJ4U578_uDtiuXswovr1T3o-Kt5KK0mlN_zC0RDodJFaKHQ3Uk-HIZ3vuMvAKNJi8DDFwWA7F6BOxz78Oh-UePwJTuc3PG0ZIZypPE1xlMPl5z46joaEw/s320/Clouds.png";
8 | break;
9 | case 'Clear':
10 | weatherIcon.src = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7pmzNCftryAfpa1YBSzVeYtjgxDQnw09Ug0HVV47J8GEtHPYTH9hJgZ2M1k0YgE0pcZ1qekr4C14zyPCiVuQAfXLClK8Ww3hYB6v77yElP7Lo5BnUKo4n-w6yB17FAbw51WST6YKS0GMwyA4fYNxOZxEyNL6HhUfFRgVhOW0GyRdBRriMHFQ-qfh4cA/s320/sun.png";
11 | break;
12 | case 'Rain':
13 | weatherIcon.src = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDW_NdwvxV796rkFf43qmUDiTQePn5dg7PDfn1SijfpjtB0AWJMBcifU6LWyW7iOtjZhfqIJnKEGQ1PwbbXS7NoKMSAmvy7i2ljWXMYLue3EBIBBR2qTFbs6QCe5eoFr2CU9WzCVJ8u0J3z3eAo3Ajv1LXamZASFtbj9sA_gD-Kp3hfgAk17Xh17RoLQ/s320/rainy.png";
14 | break;
15 | case 'Mist':
16 | weatherIcon.src = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVpL23l0t1U_ibWi01TFcHMF6J_t-9Ada5PavGlwG4M_mKIcx0pV1md9SN9ip1d84NaVowml5Do16XO3nsuttnM2-Ov05d-wCjEYjdzaOYfKvijw8k6Hfj9pOiPyEZTp2W20EPbTeONTgJE2Rdxs4KZUfg6f2PmbMF1094NcqJ7DwSFUQwYiRmVCNvuA/s320/mist.png";
17 | break;
18 | case 'Snow':
19 | weatherIcon.src = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-P3iT_uQK95qFY4h7QGdEtbRc1aVQo9BZy0ZWyPBvCNrP-4wnRStw0xYj9e4xa4ZlYISeNZqVJ33UP4YukR4jBennDD_obIN4QxYNZHdzG_z6_MNL2U08wMXwdFhtfvitW5LGiHgrwMJFC8QJFqbSO3woGSBqOdagGxaEQ20_S31Gc-GYL4vYzPzaPw/s320/snow.png";
20 | break;
21 | case 'Haze':
22 | weatherIcon.src = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjld66Ia5g_hpBn3Impi3zzOBHqWkjQInGLxTb2uXksuCsrkQU8HjlVyLobEJEGg8fRSIxeFzldGEHUmWcaiZBwAcRy4dGDpFX1BjTSB56qmBjW5tEW3RSC9_mCuLU_a8RuXchxGY7Oc8HLLl-IfaDW19Z0ZJJfNae9tECXRIyEu7rmJ3da08z8cI-phw/s320/haze.png";
23 | break;
24 | }
--------------------------------------------------------------------------------
/MyWeatherApp/src/main/webapp/index.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=UTF-8"
2 | pageEncoding="UTF-8"%>
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Weather App
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |