Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
javab_20230617
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
javab_20230617
Commits
ddc73588
Commit
ddc73588
authored
Jul 15, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Poprawki stylu
parent
e29ae9eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
WalutyController.java
...c/main/java/com/example/demo/waluty/WalutyController.java
+9
-5
styl.css
PC25-Spring/src/main/resources/static/styl.css
+14
-0
No files found.
PC25-Spring/src/main/java/com/example/demo/waluty/WalutyController.java
View file @
ddc73588
...
@@ -27,7 +27,12 @@ public class WalutyController {
...
@@ -27,7 +27,12 @@ public class WalutyController {
@GetMapping
(
"/waluty"
)
@GetMapping
(
"/waluty"
)
public
String
wyswietlWaluty
(
String
data
,
Model
model
)
{
public
String
wyswietlWaluty
(
String
data
,
Model
model
)
{
TabelaWalut
tabela
=
null
;
TabelaWalut
tabela
=
pobierzTabele
(
data
);
model
.
addAttribute
(
"tabela"
,
tabela
);
return
"waluty.html"
;
}
private
TabelaWalut
pobierzTabele
(
String
data
)
{
String
adres
=
"https://api.nbp.pl/api/exchangerates/tables/a"
;
String
adres
=
"https://api.nbp.pl/api/exchangerates/tables/a"
;
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
adres
+=
"/"
+
data
;
adres
+=
"/"
+
data
;
...
@@ -52,7 +57,7 @@ public class WalutyController {
...
@@ -52,7 +57,7 @@ public class WalutyController {
String
numerTabeli
=
xpath
.
evaluate
(
"//No"
,
doc
);
String
numerTabeli
=
xpath
.
evaluate
(
"//No"
,
doc
);
LocalDate
dataTabeli
=
LocalDate
.
parse
(
xpath
.
evaluate
(
"//EffectiveDate"
,
doc
));
LocalDate
dataTabeli
=
LocalDate
.
parse
(
xpath
.
evaluate
(
"//EffectiveDate"
,
doc
));
tabela
=
new
TabelaWalut
(
nazwaTabeli
,
numerTabeli
,
dataTabeli
);
TabelaWalut
tabela
=
new
TabelaWalut
(
nazwaTabeli
,
numerTabeli
,
dataTabeli
);
NodeList
rates
=
(
NodeList
)
xpath
.
evaluate
(
"//Rate"
,
doc
,
XPathConstants
.
NODESET
);
NodeList
rates
=
(
NodeList
)
xpath
.
evaluate
(
"//Rate"
,
doc
,
XPathConstants
.
NODESET
);
final
int
n
=
rates
.
getLength
();
final
int
n
=
rates
.
getLength
();
...
@@ -65,12 +70,11 @@ public class WalutyController {
...
@@ -65,12 +70,11 @@ public class WalutyController {
tabela
.
dodajWalute
(
waluta
);
tabela
.
dodajWalute
(
waluta
);
}
}
return
tabela
;
}
catch
(
ParserConfigurationException
|
SAXException
|
XPathExpressionException
|
IOException
e
)
{
}
catch
(
ParserConfigurationException
|
SAXException
|
XPathExpressionException
|
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
return
null
;
}
}
model
.
addAttribute
(
"tabela"
,
tabela
);
return
"waluty.html"
;
}
}
}
}
PC25-Spring/src/main/resources/static/styl.css
View file @
ddc73588
...
@@ -34,3 +34,17 @@ form {
...
@@ -34,3 +34,17 @@ form {
color
:
red
;
color
:
red
;
font-weight
:
bold
;
font-weight
:
bold
;
}
}
table
.tabela-walut
{
background-color
:
#FFFFFF
;
border-collapse
:
collapse
;
border
:
3px
solid
black
;
margin
:
0
auto
;
}
table
.tabela-walut
td
,
table
.tabela-walut
th
{
border
:
1px
solid
black
;
padding
:
2px
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment