Web shop app
Spring Web MVC app for a online shop, with MySQL db. It lacks sophisticated GUI but it works.
Application has 3 pages: buyers (kupci), products (proizvodi) and sales (prodaja). Plus Index page.
On Proizvodi page you have a possibility to create, delete or update a certain product. You can do the same with buyers on the Kupci page. Selling a particular product to a particular buyer is possible on a Prodaja page.
Each sale involves updating the status in the product table as well in the table with customers.
index.jsp
kupci.jsp
proizvodi.jsp
prodaja.jsp
model.Kupci.java
model.Proizvodi.java
model.Prodaja.java
controller.KupciController.java
controller.ProizvodiController.java
controller.ProdajaController.java
dispatcher-servlet.xml
web.xml
prodavnicaDB.sql
Application has 3 pages: buyers (kupci), products (proizvodi) and sales (prodaja). Plus Index page.
On Proizvodi page you have a possibility to create, delete or update a certain product. You can do the same with buyers on the Kupci page. Selling a particular product to a particular buyer is possible on a Prodaja page.
Each sale involves updating the status in the product table as well in the table with customers.
index.jsp
1: <%@page contentType="text/html" pageEncoding="UTF-8"%>
2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
3: "http://www.w3.org/TR/html4/loose.dtd">
4:
5: <html>
6: <head>
7: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8: <title>WEB PRODAVNICA</title>
9: <style>
10: body {
11: color: cadetblue;
12: }
13: div{
14: width: 600px;
15: height: 100px;
16: position: absolute;
17: top:0;
18: bottom: 0;
19: left: 0;
20: right: 0;
21: margin: auto;
22: }
23: a{
24: color:dodgerblue;
25: text-decoration: none;
26: }
27: </style>
28: </head>
29: <body>
30: <div>
31: <h1>Dobrodosli u nasu Web Prodavnicu!</h1>
32: <a href="kupci.djo">Kupci</a> /
33: <a href="proizvodi.djo">Proizvodi</a> /
34: <a href="prodaja.djo">Prodaja</a>
35: </div>
36: </body>
37: </html>
38:
kupci.jsp
1: <%--
2: Document : kupci
3: Created on : May 29, 2017, 5:02:11 PM
4: Author : djordje
5: --%>
6:
7: <%@page contentType="text/html" pageEncoding="UTF-8"%>
8: <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
9: <!DOCTYPE html>
10: <html>
11: <head>
12: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
13: <title>Kupci - Web Prodavnica</title>
14: <style>
15: #lista_kupaca {
16: background-color: white;
17: color:dodgerblue;
18: border: 0px;
19: }
20: h1 {
21: color:cadetblue;
22: border-bottom: 1px solid cadetblue;
23: }
24: #div1 {
25: text-align: right;
26: }
27: #div1 a {
28: margin: 10px;
29: font-size: 12px;
30: color:gray;
31: text-decoration: none;
32: }
33: #forma{
34: position: absolute;
35: bottom: 350px;
36: border-top: 1px dotted dodgerblue;
37: padding: 5px;
38: }
39: </style>
40: </head>
41: <body>
42: <div id="div1">
43: <a href="proizvodi.djo">PROIZVODI</a>
44: <a href="prodaja.djo">PRODAJA</a>
45: </div>
46: <h1>Kupci</h1>
47: </br>
48: <textarea id="lista_kupaca" rows="15" cols="150" readonly>${sviKupci}</textarea>
49: </br>
50: <form:form action="kupci.htm" method="post" commandName="kupci" id="forma">
51: <form:input type="text" id="name" path="name" placeholder="ime i prezime kupca..."></form:input>
52: <input type="submit" name="Dodaj" value="Dodaj" />
53: <input type="submit" name="Obrisi" value="Obrisi" />
54: </form:form>
55: </body>
56: </html>
57:
proizvodi.jsp
1: <%--
2: Document : proizvodi
3: Created on : May 30, 2017, 3:46:23 PM
4: Author : djordje
5: --%>
6:
7: <%@page contentType="text/html" pageEncoding="UTF-8"%>
8: <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
9: <!DOCTYPE html>
10: <html>
11: <head>
12: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
13: <title>Proizvodi - Web Prodavnica</title>
14: <style>
15: #lista_proizvoda {
16: background-color: white;
17: color:dodgerblue;
18: border: 0px;
19: }
20: h1 {
21: color:cadetblue;
22: border-bottom: 1px solid cadetblue;
23: }
24: #div1 {
25: text-align: right;
26: }
27: #div1 a {
28: margin: 10px;
29: font-size: 12px;
30: color:gray;
31: text-decoration: none;
32: }
33: #forma{
34: position: absolute;
35: bottom: 350px;
36: border-top: 1px dotted dodgerblue;
37: padding: 5px;
38: }
39: </style>
40: </head>
41: <body>
42: <div id="div1">
43: <a href="kupci.djo">KUPCI</a>
44: <a href="prodaja.djo">PRODAJA</a>
45: </div>
46: <h1>Proizvodi</h1>
47: </br>
48: <textarea id="lista_proizvoda" rows="20" cols="45" readonly>${sviProizvodi}</textarea>
49: </br>
50: <form:form action="proizvodi.htm" method="post" commandName="proizvodi" id="forma">
51: <form:input type="text" id="name" path="name" placeholder="naziv proizvoda..."></form:input>
52: <input type="submit" name="Dodaj" value="Dodaj" />
53: <input type="submit" name="Obrisi" value="Obrisi" />
54: </form:form>
55: </br>
56: </body>
57: </html>
58:
prodaja.jsp
1: <%--
2: Document : prodaja
3: Created on : May 30, 2017, 5:57:05 PM
4: Author : djordje
5: --%>
6:
7: <%@page contentType="text/html" pageEncoding="UTF-8"%>
8: <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
9: <!DOCTYPE html>
10: <html>
11: <head>
12: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
13: <title>Prodaja - Web Prodavnica</title>
14: <style>
15:
16: #lista_kupaca{
17: position: absolute;
18: top: 200px;
19: background-color: white;
20: color:dodgerblue;
21: border: 0px;
22: }
23: #lista_proizvoda {
24: position: absolute;
25: top: 200px;
26: left: 650px;
27: background-color: white;
28: color:dodgerblue;
29: border: 0px;
30: }
31: #kupciT{
32: position: absolute;
33: top: 150px;
34: color:cadetblue;
35: font-size: 12px;
36: }
37: #proizvodiT{
38: position: absolute;
39: top: 150px;
40: left: 650px;
41: color:cadetblue;
42: font-size: 12px;
43: }
44: #forma{
45: position: absolute;
46: bottom: 350px;
47: border-top: 1px dotted dodgerblue;
48: padding: 5px;
49: }
50: #forma label {
51: color: cadetblue;
52: font-size: 12px;
53: margin: 5px;
54: }
55: #div1 {
56: text-align: right;
57: }
58: #div1 a {
59: margin: 10px;
60: font-size: 12px;
61: color:gray;
62: text-decoration: none;
63: }
64: h1 {
65: color:cadetblue;
66: border-bottom: 1px solid cadetblue;
67: }
68: </style>
69: </head>
70: <body>
71: <div id="div1">
72: <a href="kupci.djo">KUPCI</a>
73: <a href="proizvodi.djo">PROIZVODI</a>
74: </div>
75: <h1>Prodaja </h1></br>
76: <h3 id="kupciT">Kupci:</h3>
77: <textarea id="lista_kupaca" rows="15" cols="90" readonly>${sviKupci}</textarea>
78: <h3 id="proizvodiT">Proizvodi:</h3>
79: <textarea id="lista_proizvoda" rows="15" cols="40" readonly>${sviProizvodi}</textarea>
80:
81: <form:form action="prodaja.htm" method="post" commandName="prodaja" id="forma">
82: <form:label path="kupac">Kupac br.: </form:label>
83: <form:input type="number" id="kupac" path="kupac"></form:input>
84: <form:label path="proizvod"> Proizvod br.: </form:label>
85: <form:input type="number" id="proizvod" path="proizvod"></form:input>
86: <input type="submit" name="Prodaj" value="Prodaj" />
87: </form:form>
88:
89: </body>
90: </html>
91:
model.Kupci.java
1: package model;
2:
3: import java.sql.DriverManager;
4: import java.sql.ResultSet;
5: import java.sql.SQLException;
6: import java.sql.Statement;
7:
8: public class Kupci {
9:
10: private int id;
11: private String name;
12: private String korpa;
13:
14: public int getId() {
15: return id;
16: }
17: public String getName() {
18: return name;
19: }
20: public String getKorpa(){
21: return korpa;
22: }
23: public void setKorpa(String korpa){
24: this.korpa = korpa;
25: }
26: public void setId(int id) {
27: this.id = id;
28: }
29: public void setName(String name) {
30: this.name = name;
31: }
32:
33: public static String prikazKupaca() throws ClassNotFoundException, SQLException {
34: StringBuilder prikaz_kupaca = new StringBuilder();
35: Class.forName("com.mysql.jdbc.Driver");
36:
37: try (java.sql.Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/prodavnicaDB", "root", "");) {
38:
39: Statement st = conn.createStatement();
40: st.executeQuery("select kupci_id, ime_kupca, korpa from kupci");
41: ResultSet rs = st.getResultSet();
42:
43:
44: while (rs.next()) {
45: String korpa = rs.getString("korpa");
46: if(rs.getString("korpa")== null)
47: korpa = "Korpa je prazna";
48: prikaz_kupaca.append(rs.getString("kupci_id"));
49: prikaz_kupaca.append(": ");
50: prikaz_kupaca.append(rs.getString("ime_kupca"));
51: prikaz_kupaca.append(" // U korpi: ");
52: prikaz_kupaca.append(korpa);
53: prikaz_kupaca.append("\n");
54: }
55:
56: } catch (SQLException ex) {
57: prikaz_kupaca.append(ex.getMessage());
58: }
59: return prikaz_kupaca.toString();
60: }
61:
62:
63:
64: public void kreiranjeKupca() throws ClassNotFoundException {
65: Class.forName("com.mysql.jdbc.Driver");
66:
67: try (java.sql.Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/prodavnicaDB","root", "");) {
68:
69: if (name != null && !(name.isEmpty())) {
70:
71: Statement st = conn.createStatement();
72: st.execute("insert into kupci (ime_kupca) values ('" + name + "')");
73: }
74: } catch (SQLException ex) {
75: System.out.println("Error in database connection: \n" + ex.getMessage());
76: }
77: }
78:
79: public void brisanjeKupca() throws ClassNotFoundException {
80: Class.forName("com.mysql.jdbc.Driver");
81:
82: try (java.sql.Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/prodavnicaDB","root","");) {
83:
84: Statement st = conn.createStatement();
85: st.execute("delete from kupci where ime_kupca='" + name + "'");
86:
87: } catch (SQLException ex) {
88: System.out.println("Errorrrr: \n" + ex.getMessage());
89: }
90:
91: }
92:
93: }
94:
model.Proizvodi.java
1:
2: package model;
3:
4: import java.sql.DriverManager;
5: import java.sql.ResultSet;
6: import java.sql.SQLException;
7: import java.sql.Statement;
8:
9: public class Proizvodi {
10:
11: private String name;
12: private int id_proizvoda;
13:
14: public int getId_proizvoda(){
15: return id_proizvoda;
16: }
17: public void setId_proizvoda(int id_proizvoda){
18: this.id_proizvoda=id_proizvoda;
19: }
20: public String getName() {
21: return name;
22: }
23: public void setName(String name) {
24: this.name = name;
25: }
26:
27: public static String prikazProizvoda() throws ClassNotFoundException, SQLException {
28: StringBuilder prikaz_proizvoda = new StringBuilder();
29: Class.forName("com.mysql.jdbc.Driver");
30:
31: try (java.sql.Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/prodavnicaDB", "root", "");) {
32:
33: Statement st = conn.createStatement();
34: st.executeQuery("select proizvodi_id, naziv_proizvoda from proizvodi");
35: ResultSet rs = st.getResultSet();
36:
37: while (rs.next()) {
38: prikaz_proizvoda.append(rs.getString("proizvodi_id"));
39: prikaz_proizvoda.append(": ");
40: prikaz_proizvoda.append(rs.getString("naziv_proizvoda"));
41: prikaz_proizvoda.append("\n");
42: }
43:
44: } catch (SQLException ex) {
45: prikaz_proizvoda.append(ex.getMessage());
46: }
47: return prikaz_proizvoda.toString();
48: }
49:
50: public void kreiranjeProizvoda() throws ClassNotFoundException {
51: Class.forName("com.mysql.jdbc.Driver");
52:
53: try (java.sql.Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/prodavnicaDB","root", "");) {
54:
55: if (name != null && !(name.isEmpty())) {
56:
57: Statement st = conn.createStatement();
58: st.execute("insert into proizvodi (naziv_proizvoda) values ('" + name + "')");
59: }
60: } catch (SQLException ex) {
61: System.out.println("Error in database connection: \n" + ex.getMessage());
62: }
63: }
64:
65: public void brisanjeProizvoda() throws ClassNotFoundException {
66: Class.forName("com.mysql.jdbc.Driver");
67:
68: try (java.sql.Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/prodavnicaDB","root","");) {
69:
70: Statement st = conn.createStatement();
71: st.execute("delete from proizvodi where naziv_proizvoda='" + name + "'");
72:
73: } catch (SQLException ex) {
74: System.out.println("Errorrrr: \n" + ex.getMessage());
75: }
76:
77: }
78:
79: }
80:
model.Prodaja.java
1:
2: package model;
3:
4: import java.sql.DriverManager;
5: import java.sql.ResultSet;
6: import java.sql.SQLException;
7: import java.sql.Statement;
8:
9: public class Prodaja {
10: private int kupac;
11: private int proizvod;
12:
13: public int getKupac(){
14: return kupac;
15: }
16: public int getProizvod(){
17: return proizvod;
18: }
19: public void setKupac(int kupac) {
20: this.kupac = kupac;
21: }
22: public void setProizvod(int proizvod) {
23: this.proizvod= proizvod;
24: }
25:
26: public static void prodaja(int kupac, int proizvod) throws ClassNotFoundException {
27:
28: Class.forName("com.mysql.jdbc.Driver");
29: try (java.sql.Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/prodavnicaDB","root", "");) {
30:
31: Statement st = conn.createStatement();
32:
33: st.executeQuery("select korpa from kupci where kupci_id='" + String.valueOf(kupac) + "'");
34: ResultSet rs = st.getResultSet();
35: String korpa = null;
36: while(rs.next())
37: korpa = rs.getString("korpa");
38:
39: st.executeQuery("select naziv_proizvoda from proizvodi where proizvodi_id='" + String.valueOf(proizvod) + "'");
40: ResultSet rs2 = st.getResultSet();
41: String imeProizvoda = null;
42: while(rs2.next())
43: imeProizvoda = rs2.getString("naziv_proizvoda");
44:
45: if (korpa == null)
46: st.execute("update kupci set korpa='" + imeProizvoda + ", " + "' where kupci_id='" + String.valueOf(kupac) + "'");
47: else
48: st.execute("update kupci set korpa='" + korpa + imeProizvoda + ", " + "' where kupci_id='" + String.valueOf(kupac) + "'");
49:
50: st.execute("delete from proizvodi where proizvodi_id='" + String.valueOf(proizvod) + "'");
51:
52: } catch (SQLException ex) {
53: System.out.println("Error in database connection: \n" + ex.getMessage());
54: }
55:
56: }
57:
58: }
59:
controller.KupciController.java
1: package controller;
2:
3: import java.sql.SQLException;
4: import model.Kupci;
5: import org.springframework.stereotype.Controller;
6: import org.springframework.ui.ModelMap;
7: import org.springframework.web.bind.annotation.ModelAttribute;
8: import org.springframework.web.bind.annotation.RequestMapping;
9: import org.springframework.web.bind.annotation.RequestMethod;
10:
11:
12:
13: @Controller
14: public class kupciController {
15:
16: @RequestMapping(value="/kupci", method=RequestMethod.GET)
17: public String prikazSadrzaja(ModelMap model) throws ClassNotFoundException, SQLException {
18:
19: model.addAttribute("kupci", new Kupci());
20: model.addAttribute("sviKupci", Kupci.prikazKupaca());
21: return "kupci";
22:
23: }
24:
25: @RequestMapping(value="/kupci", params="Dodaj" , method=RequestMethod.POST)
26: public String dodajKupca(@ModelAttribute("kupci") Kupci odabraniKupac, ModelMap model) throws ClassNotFoundException, SQLException {
27:
28: odabraniKupac.kreiranjeKupca();
29: prikazSadrzaja(model);
30: return "kupci";
31:
32: }
33:
34: @RequestMapping(value="/kupci", params="Obrisi" , method=RequestMethod.POST)
35: public String obrisiKupca(@ModelAttribute("kupci") Kupci bivsiKupac, ModelMap model) throws ClassNotFoundException, SQLException {
36:
37: bivsiKupac.brisanjeKupca();
38: prikazSadrzaja(model);
39: return "kupci";
40:
41: }
42:
43: }
44:
controller.ProizvodiController.java
1:
2: package controller;
3:
4: import java.sql.SQLException;
5: import model.Proizvodi;
6: import org.springframework.stereotype.Controller;
7: import org.springframework.ui.ModelMap;
8: import org.springframework.web.bind.annotation.ModelAttribute;
9: import org.springframework.web.bind.annotation.RequestMapping;
10: import org.springframework.web.bind.annotation.RequestMethod;
11:
12: @Controller
13: public class ProizvodiController {
14:
15: @RequestMapping(value="/proizvodi", method=RequestMethod.GET)
16: public String prikazSadrzaja(ModelMap model) throws ClassNotFoundException, SQLException {
17:
18: model.addAttribute("proizvodi", new Proizvodi());
19: model.addAttribute("sviProizvodi", Proizvodi.prikazProizvoda());
20: return "proizvodi";
21:
22: }
23:
24: @RequestMapping(value="/proizvodi", params="Dodaj" , method=RequestMethod.POST)
25: public String dodajProizvod(@ModelAttribute("proizvodi") Proizvodi odabraniProizvod, ModelMap model) throws ClassNotFoundException, SQLException {
26:
27: odabraniProizvod.kreiranjeProizvoda();
28: prikazSadrzaja(model);
29: return "proizvodi";
30:
31: }
32:
33: @RequestMapping(value="/proizvodi", params="Obrisi" , method=RequestMethod.POST)
34: public String obrisiProizvod(@ModelAttribute("proizvodi") Proizvodi bivsiProizvod, ModelMap model) throws ClassNotFoundException, SQLException {
35:
36: bivsiProizvod.brisanjeProizvoda();
37: prikazSadrzaja(model);
38: return "proizvodi";
39:
40: }
41:
42: }
43:
controller.ProdajaController.java
1:
2: package controller;
3:
4: import java.sql.SQLException;
5: import model.Kupci;
6: import model.Prodaja;
7: import model.Proizvodi;
8: import org.springframework.stereotype.Controller;
9: import org.springframework.ui.ModelMap;
10: import org.springframework.web.bind.annotation.ModelAttribute;
11: import org.springframework.web.bind.annotation.RequestMapping;
12: import org.springframework.web.bind.annotation.RequestMethod;
13:
14: @Controller
15: public class ProdajaController {
16:
17: @RequestMapping(value="/prodaja", method=RequestMethod.GET)
18: public String prikazSadrzaja(ModelMap model) throws ClassNotFoundException, SQLException {
19:
20: model.addAttribute("kupci", new Kupci());
21: model.addAttribute("sviKupci", Kupci.prikazKupaca());
22: model.addAttribute("proizvodi", new Proizvodi());
23: model.addAttribute("sviProizvodi", Proizvodi.prikazProizvoda());
24: model.addAttribute("prodaja", new Prodaja());
25: return "prodaja";
26:
27: }
28:
29: @RequestMapping(value="/prodaja", params="Prodaj",method=RequestMethod.POST)
30: public String prodaja(@ModelAttribute("kupci") Kupci kupci, @ModelAttribute("proizvodi") Proizvodi proizvodi, @ModelAttribute("prodaja") Prodaja prodaja, ModelMap model) throws ClassNotFoundException, SQLException{
31:
32: int proizvod = prodaja.getProizvod();
33: int kupac = prodaja.getKupac();
34: Prodaja.prodaja(kupac, proizvod);
35: prikazSadrzaja(model);
36: return "prodaja";
37:
38: }
39:
40: }
41:
dispatcher-servlet.xml
1: <?xml version='1.0' encoding='UTF-8' ?>
2: <!-- was: <?xml version="1.0" encoding="UTF-8"?> -->
3: <beans xmlns="http://www.springframework.org/schema/beans"
4: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5: xmlns:p="http://www.springframework.org/schema/p"
6: xmlns:aop="http://www.springframework.org/schema/aop"
7: xmlns:tx="http://www.springframework.org/schema/tx"
8: xmlns:mvc="http://www.springframework.org/schema/mvc"
9: xmlns:context="http://www.springframework.org/schema/context"
10:
11: xsi:schemaLocation="http://www.springframework.org/schema/beans
12: http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
13: http://www.springframework.org/schema/aop
14: http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
15: http://www.springframework.org/schema/tx
16: http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
17: http://www.springframework.org/schema/context
18: http://www.springframework.org/schema/context/spring-context-4.0.xsd
19: http://www.springframework.org/schema/mvc
20: http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
21:
22: <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/>
23:
24:
25: <mvc:annotation-driven />
26: <bean class="controller.kupciController" id="kupciController" />
27: <bean class="controller.ProizvodiController" id="ProizvodiController" />
28: <bean class="controller.ProdajaController" id="ProdajaController" />
29:
30:
31: <!--
32: Most controllers will use the ControllerClassNameHandlerMapping above, but
33: for the index controller we are using ParameterizableViewController, so we must
34: define an explicit mapping for it.
35: -->
36: <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
37: <property name="mappings">
38: <props>
39: <prop key="index.htm">indexController</prop>
40: </props>
41: </property>
42: </bean>
43:
44: <bean id="viewResolver"
45: class="org.springframework.web.servlet.view.InternalResourceViewResolver"
46: p:prefix="/WEB-INF/jsp/"
47: p:suffix=".jsp" />
48:
49: <!--
50: The index controller.
51: -->
52: <bean name="indexController"
53: class="org.springframework.web.servlet.mvc.ParameterizableViewController"
54: p:viewName="index" />
55:
56: </beans>
57:
web.xml
1: <?xml version="1.0" encoding="UTF-8"?>
2: <web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
3: <context-param>
4: <param-name>contextConfigLocation</param-name>
5: <param-value>/WEB-INF/applicationContext.xml</param-value>
6: </context-param>
7: <listener>
8: <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
9: </listener>
10: <servlet>
11: <servlet-name>dispatcher</servlet-name>
12: <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
13: <load-on-startup>2</load-on-startup>
14: </servlet>
15: <servlet-mapping>
16: <servlet-name>dispatcher</servlet-name>
17: <url-pattern>*.htm</url-pattern>
18: <url-pattern>*.html</url-pattern>
19: <url-pattern>*.djo</url-pattern>
20: </servlet-mapping>
21: <session-config>
22: <session-timeout>
23: 30
24: </session-timeout>
25: </session-config>
26: <welcome-file-list>
27: <welcome-file>redirect.jsp</welcome-file>
28: </welcome-file-list>
29: </web-app>
30:
prodavnicaDB.sql
1: CREATE DATABASE IF NOT EXISTS `prodavnicaDB` /*!40100 DEFAULT CHARACTER SET latin1 */;
2: USE `prodavnicaDB`;
3: -- MySQL dump 10.13 Distrib 5.5.55, for debian-linux-gnu (i686)
4: --
5: -- Host: 127.0.0.1 Database: prodavnicaDB
6: -- ------------------------------------------------------
7: -- Server version 5.5.55-0ubuntu0.14.04.1
8:
9: /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10: /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11: /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12: /*!40101 SET NAMES utf8 */;
13: /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
14: /*!40103 SET TIME_ZONE='+00:00' */;
15: /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
16: /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
17: /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
18: /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
19:
20: --
21: -- Table structure for table `kupci`
22: --
23:
24: DROP TABLE IF EXISTS `kupci`;
25: /*!40101 SET @saved_cs_client = @@character_set_client */;
26: /*!40101 SET character_set_client = utf8 */;
27: CREATE TABLE `kupci` (
28: `kupci_id` int(11) NOT NULL AUTO_INCREMENT,
29: `ime_kupca` varchar(45) NOT NULL,
30: `korpa` text,
31: PRIMARY KEY (`kupci_id`)
32: ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
33: /*!40101 SET character_set_client = @saved_cs_client */;
34:
35: --
36: -- Dumping data for table `kupci`
37: --
38:
39: LOCK TABLES `kupci` WRITE;
40: /*!40000 ALTER TABLE `kupci` DISABLE KEYS */;
41: INSERT INTO `kupci` VALUES (1,'Zlatan Ibrahimovic',NULL),(2,'Duda Ivkovic',NULL),(3,'Stevan Mokranjac',NULL),(4,'Paja Jovanovic',NULL),(5,'Ada Lovelace',NULL),(6,'Djordje Gavrilovic',NULL),(8,'Paja Patak',NULL),(9,'Lili Ptica',NULL),(10,'Mitar Miric',NULL);
42: /*!40000 ALTER TABLE `kupci` ENABLE KEYS */;
43: UNLOCK TABLES;
44:
45: --
46: -- Table structure for table `proizvodi`
47: --
48:
49: DROP TABLE IF EXISTS `proizvodi`;
50: /*!40101 SET @saved_cs_client = @@character_set_client */;
51: /*!40101 SET character_set_client = utf8 */;
52: CREATE TABLE `proizvodi` (
53: `proizvodi_id` int(11) NOT NULL AUTO_INCREMENT,
54: `naziv_proizvoda` varchar(45) NOT NULL,
55: PRIMARY KEY (`proizvodi_id`)
56: ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
57: /*!40101 SET character_set_client = @saved_cs_client */;
58:
59: --
60: -- Dumping data for table `proizvodi`
61: --
62:
63: LOCK TABLES `proizvodi` WRITE;
64: /*!40000 ALTER TABLE `proizvodi` DISABLE KEYS */;
65: INSERT INTO `proizvodi` VALUES (1,'Lopta - bubamara'),(2,'Lopta - za basket'),(3,'Slikarski stafelaj'),(4,'Notna sveska'),(5,'Domaca kafa - 5kg'),(6,'Mikrofon - ekstra dobar'),(8,'Patkica - za kupanje');
66: /*!40000 ALTER TABLE `proizvodi` ENABLE KEYS */;
67: UNLOCK TABLES;
68: /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
69:
70: /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
71: /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
72: /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
73: /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
74: /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
75: /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
76: /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
77:
78: -- Dump completed on 2017-06-01 19:50:59
Comments
Post a Comment