Commit a75f7959 by Vuk Lazovic

PRIKAZIVANJE OGLASA

parent 4f9e193d
...@@ -4,14 +4,12 @@ ...@@ -4,14 +4,12 @@
<option name="autoReloadType" value="ALL" /> <option name="autoReloadType" value="ALL" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="6e82c7f1-3949-40e2-bc26-7eb50b36f993" name="Default Changelist" comment="dodata ulogovana verzija"> <list default="true" id="6e82c7f1-3949-40e2-bc26-7eb50b36f993" name="Default Changelist" comment="DODATA FUNKCIONALNOST ZA CITANJE IZ BAZEe">
<change afterPath="$PROJECT_DIR$/src/main/java/app/model/Oglas.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/app/rep/OglasRep.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/app/usluga/OglasUsluga.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/app/usluga/web/OglasController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/resources/templates/oglasi.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/app/usluga/web/MainKontroler.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/app/usluga/web/MainKontroler.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/app/usluga/web/MainKontroler.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/app/usluga/web/MainKontroler.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/app/usluga/web/OglasController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/app/usluga/web/OglasController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/templates/oglasi.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/oglasi.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/templates/property.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/property.html" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -49,7 +47,7 @@ ...@@ -49,7 +47,7 @@
<map> <map>
<entry key="com.haulmont.jpb.jpaInspector" value="true" /> <entry key="com.haulmont.jpb.jpaInspector" value="true" />
<entry key="com.haulmont.jpb.jpaPalette" value="true" /> <entry key="com.haulmont.jpb.jpaPalette" value="true" />
<entry key="com.haulmont.jpb.jpaStructure" value="true" /> <entry key="com.haulmont.jpb.jpaStructure" value="false" />
</map> </map>
</option> </option>
</component> </component>
...@@ -195,7 +193,7 @@ ...@@ -195,7 +193,7 @@
<updated>1663427032475</updated> <updated>1663427032475</updated>
<workItem from="1663427050863" duration="1923000" /> <workItem from="1663427050863" duration="1923000" />
<workItem from="1663500169914" duration="6177000" /> <workItem from="1663500169914" duration="6177000" />
<workItem from="1663512751550" duration="4807000" /> <workItem from="1663512751550" duration="10597000" />
</task> </task>
<task id="LOCAL-00001" summary="dodata ulogovana verzija"> <task id="LOCAL-00001" summary="dodata ulogovana verzija">
<created>1663501497955</created> <created>1663501497955</created>
...@@ -204,7 +202,14 @@ ...@@ -204,7 +202,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1663501497955</updated> <updated>1663501497955</updated>
</task> </task>
<option name="localTasksCounter" value="2" /> <task id="LOCAL-00002" summary="DODATA FUNKCIONALNOST ZA CITANJE IZ BAZEe">
<created>1663517623868</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1663517623868</updated>
</task>
<option name="localTasksCounter" value="3" />
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
...@@ -265,7 +270,8 @@ ...@@ -265,7 +270,8 @@
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" /> <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="dodata ulogovana verzija" /> <MESSAGE value="dodata ulogovana verzija" />
<option name="LAST_COMMIT_MESSAGE" value="dodata ulogovana verzija" /> <MESSAGE value="DODATA FUNKCIONALNOST ZA CITANJE IZ BAZEe" />
<option name="LAST_COMMIT_MESSAGE" value="DODATA FUNKCIONALNOST ZA CITANJE IZ BAZEe" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/main/java/app/model/Korisnik.java"> <entry file="file://$PROJECT_DIR$/src/main/java/app/model/Korisnik.java">
......
package app.usluga.web; package app.usluga.web;
import app.model.Oglas;
import app.usluga.OglasUsluga; import app.usluga.OglasUsluga;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.ui.Model; import org.springframework.ui.Model;
...@@ -33,5 +35,19 @@ public class MainKontroler { ...@@ -33,5 +35,19 @@ public class MainKontroler {
return "dodaj"; return "dodaj";
} }
@Autowired
private OglasUsluga oglasUsluga;
@GetMapping("/oglasi")
public String prikazOglasa(Model model)
{
List<Oglas> oglasi = oglasUsluga.getAll();
model.addAttribute("oglasi",oglasi);
return "property";
}
} }
...@@ -24,14 +24,9 @@ public class OglasController ...@@ -24,14 +24,9 @@ public class OglasController
{ {
List<Oglas> oglasi = oglasUsluga.getAll(); List<Oglas> oglasi = oglasUsluga.getAll();
model.addAttribute("SIZE","3"); model.addAttribute("oglasi",oglasi);
int i=0;
for(Oglas O : oglasi)
{
i++;
model.addAttribute("A"+String.valueOf(i),O.getIme());
}
......
...@@ -6,24 +6,22 @@ ...@@ -6,24 +6,22 @@
</head> </head>
<body> <body>
<div id="div">
saas
</div>
<script th:inline="javascript"> <script th:inline="javascript">
/*<![CDATA[*/ let oglasi = /*[[${oglasi}]]*/ []
let x=document.getElementById("div");
s=''
for(let i=0;i<10;i++)
s+="<h1> CEVU NAJJACA GLAVA </h1>"
x.innerHTML=s;
</script>
let size = /*[[${SIZE}]]*/ '';
console.log(size)
for(let i=0; i<size; i++)
{
let name = [[${A1}]]
console.log(name);
}
/*]]>*/
</script>
<h3 th:text="${A1}"> </h3>
<h3 th:text="${A2}"> </h3>
<h3 th:text="${A3}"> </h3>
</body> </body>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment