📺 Develpreneur YouTube Episode

Video + transcript

Spring Boot - Thyme Leaf Part 2 - Bootstrap 5 Carousel

2023-11-30 •Youtube

Detailed Notes

We are continuing a series of tutorials focused on Spring Boot. The crux of the project is to convert/migrate an old JSP/Tomcat application to a modern Spring Boot application and Java 7/8 to a current version. Thymeleaf is an important piece of Spring Boot applications and we continue to look into it along with adding Bootstrap 5 and connecting a carousel.

You can learn more through our online classes at https://school.develpreneur.com and register for free. Registration will add you to our email list, and you will periodically receive coupons for courses and notifications of the latest releases.

Transcript Text
[Music]
well hello and welcome back we are
continuing migrating our application
over and this time around we are going
to take the login page basically we're
take our homepage and Spruce it up as it
were now
currently if we go to our
homepage of just
slash it gives us just hey your server
is running uh so let's go here and
that's because of the rest
controller uh let's do this is going
going to
be let's call this heartbeat
now oh let's
see I do
heartbeat we're going to call him
heartbeat just
because so now we've got that if we go
to our hello
controller we had before is we had a
greet but now what we're going to do is
we're going to have
a
homepage
this is going to be the
uh let's call it homepage why
not and for now we're going to do very
simple we're going to just make our come
in here and we're going to return uh we
called him login before so let's call uh
let's call him homepage
now and and we're going to convert this
thing over like we did last episode
around so if we go to log in we're going
to rename
him me call him
homepage. HTML well let's just call him
home okay so we have home HTML this is
where he's going to go so let's see what
this is going to look like so we need to
take a couple things we're going to have
to yank out our gstl stuff we're going
to grab our that we will just use from
this guy
here and we'll need our time Leaf
designator so we're going to come over
to
home and there's our
header let's jump down to the bottom and
that's going to be our
[Music]
footer and let's start with
that I'm not exactly sure what all I've
got going on
here so let's see what this looks
like so now if we run
it boom so we actually have although
it's not doing real well we do have
somewhat of a home page let's get this
cleaned up a little
bit so what this used was a
Carousel
and I'm not sure if this Carousel is
going to work now let's see do we have
oh we're not bringing in I don't think
we have the carousel stuff being brought
in uh let's go
look uh we do have
Carousel so we might be
[Music]
okay I think this is
uh okay so let's go look at this a
little bit do a little uh background
size cover let's see if we've got
something messed up
there uh oh there it
is that's what it is so we have here oh
this is our PNG so let's see do we have
those in so we've got some images that
we were we blew up so if we look
here uh screen 4.png I don't think I see
that oh there it is
okay so this actually needs to
be now obviously some of this is stuff
you aren't going to do but if you're
like me and you were
using a lot of the older P you know the
older approaches to this then you're
going to get some things like this where
you're going to get extra code lines in
that it doesn't like and like we saw
here it just sort of blows up it doesn't
know what to do now oh we're getting
better still got some stuff that's a
little bit jacked up uh now we're going
to figure out why that is if we go to my
Carousel then let's see
if
those all seem
okay it probably isn't getting oh there
you
go uh looks like it's not getting those
images
so let's go back
here this is where we're going to have
to have a little bit of work CU what we
want to do now this is because this is
in a
style sort of a pain in the
butt however let see if I get something
so let's try this let's try to just get
an image first let's keep it
simple
um and we will just put it right at the
top
here and let's just do screen one let's
try Image Screen one. PMG
PNG is that where's that yeah IMG there
so let's see what happens if we put that
there
troubleshoot this thing a little bit so
now there we go
and it is giving us an image so that
image came through so here we
go uh let's try uh I think here's where
this is where our problem lies is it's
double quotes versus single
quotes So we want that to be because we
do want it to know that it's a
URL it just needs to be there
so would a doubt look at documentation
for wh whatever it is you're doing for
example here we're doing a style for
background image so if I take
that let's see what we
got now we're seeing a bunch of images
all stacked
up and so it is probably not bringing
out the it's probably not handling the
carousel properly so let's go look at a
carousel I wonder if bootstrap five has
a carousel built in we might be able to
use it that
way and if so
yes it is they have a Cel so that is
what we're going to jump one into
probably next time actually let's look
at this real
quick um I don't know if this is
with let's see what happens so that's
what we
had if we look at what it should
be uh if we've got a did we have a next
I don't know if we had a next before if
we had our little buttons let's see did
we I look yes we did
so uh that means what I can probably do
is
take this let's take that first
one uh where to
go first slide
label placeholder
text
image okay so let's see what does this
look
like whoop
oh cuz it's an item active Okay so
before we
had each item so we have an enter there
we go the enter and we have an active so
active uh it's going to be like this but
we don't need
active we do need its style is still
going to be this image
and
then we want this to
be this is
what uh yeah Carousel
item and then there's an image
source oh let's look at this uh let's
see
all let's do this let's
see so that's what he looked like this
is what he should look like
now
wh let's do this
uh this is the image
active there we go let's do this we're
going to do actually let's take this
first and then we'll start replacing
stuff that's the easy way to do it so
let's put this at our
top oh see they do have
it uh Carousel slide container there's a
carousel so if we look
[Music]
here if we look at the
[Music]
indicators they are probably a little
different
yep so this is going to be data Target
data BS
Target is just going to
be
this and I do
have a
fourth 0 one two
three and he doesn't really need a
label um but let's give them one anyways
so there we go so there's
my
indicators and then what I want is I've
got let's take the
text which is going to be in the caption
area and let's pull that for each of
these so we're going to come in here
we're going to pull our
text and pull that over and this
one and then we're going to need to
duplicate that
item
and there we
go so let's pull that in so we can see a
little
bit so
now if I do my
source
here let's change it to a straight
up and let's see what
happens let's see if this even works we
may have a broken some broken HTML
but this maybe a quick way to get us
wh so now we have it we've got some text
we do have some
buttons and we do have some
slides
so let's see so what it comes down to
here
is uh let's take
this and that's going to be screen
two this is going to be screen
three it's going to be
screen
four oh we need the previous and the
next are going to be because they are my
cariso and
let's put that
there and let's see so now if we take
this let's take this crap and get rid of
it
that and now let's rebuild
it and maybe we have managed to add a
carousel in
here and let's see how's that
look now we don't have we need to darken
it uh
cuz somewhere and here is there we
go and then it just go so we need it to
Loop is one of our
things
and uh let's
see previous next let's see can we make
it let's go over
here
and
so we can make it dark if we want which
is probably what we
want uh let's see so it's going to
be and we want it to
be let's see what is it doing
[Music]
here oh let's try
that uh uh I'm going to play around with
this so we probably aren't going to go
too much further in this uh let's see
this was on
the uh class
Carousel where is it at class Carousel
slide dark Carousel dark and let's see
what we got
here and then we'll so there's a couple
things we're going to need to do still
on this
is oh here's a nice thing is it does
give us okay
now it ends up sliding all the way off
so we're going to have to work on that
but if you notice at the dark it does
now give us uh dark
text which we probably don't need dark
what we actually want to do is we want
to darken the
images which goes back to what we had
before if we go look at
home I think it was home well no not
home log
in
is that
this is what we needed is that we need
to get
that into the uh item active let's see
if that works let's just try that real
quick okay let's see what that looks
like
now and it does not like that so we're
going to play around with that a little
bit uh let's go back
to there okay and we will see what we
can do with this uh see if we can do a
little bit of work wh and get these
things cleaned up but as you can see we
can pull stuff over uh got a little bit
of
a uh introduction to bootstrap five
because that's what we're moving into
we've shifted some stuff over if we kept
it that would have been great these are
kinds of things you have to deal with
when you're migrating updating an
application that being said hope you
enjoyed it as always shoot us emails at
info@ developer.com or leave a comment
and we will talk to you next time so go
out there and have yourself a great day
a great week and then we will talk to
you next time hello this is Rob with
develop andur also known as building
better developers wanted to announce
that we have school. develop or.com feel
free to check it out if you like any of
this information any of the content that
we've sent and you would like to see
more you can come out you can enroll for
free we have free courses we've got
places for you to get better at just
learning a technology or how toos you
can work on your business skills we can
help you with becoming a better
developer as in coding and things like
that a lot of the stuff you've seen on
YouTube we also have out at school.
develop andur we have it a little more
of a educational format and a way for
you to track your progress as you move
forward becoming a better developer
[Music]
ER
Transcript Segments
1.35

[Music]

27.24

well hello and welcome back we are

29.439

continuing migrating our application

31.599

over and this time around we are going

33.36

to take the login page basically we're

35.44

take our homepage and Spruce it up as it

38.64

were now

41.12

currently if we go to our

44.32

homepage of just

46.48

slash it gives us just hey your server

50.52

is running uh so let's go here and

53.76

that's because of the rest

57.519

controller uh let's do this is going

59.96

going to

61.8

be let's call this heartbeat

65.479

now oh let's

68.68

see I do

70.56

heartbeat we're going to call him

72.56

heartbeat just

76.4

because so now we've got that if we go

78.4

to our hello

79.52

controller we had before is we had a

81.72

greet but now what we're going to do is

84.52

we're going to have

87

a

88.84

homepage

92.92

this is going to be the

94.96

uh let's call it homepage why

103

not and for now we're going to do very

105.88

simple we're going to just make our come

108.24

in here and we're going to return uh we

110.92

called him login before so let's call uh

114.24

let's call him homepage

118.68

now and and we're going to convert this

121.32

thing over like we did last episode

123.799

around so if we go to log in we're going

126.56

to rename

128.28

him me call him

130.92

homepage. HTML well let's just call him

135.84

home okay so we have home HTML this is

139.239

where he's going to go so let's see what

141.879

this is going to look like so we need to

143.48

take a couple things we're going to have

145

to yank out our gstl stuff we're going

148.319

to grab our that we will just use from

152.319

this guy

155.239

here and we'll need our time Leaf

157.519

designator so we're going to come over

158.92

to

160.879

home and there's our

164.4

header let's jump down to the bottom and

167.959

that's going to be our

169.51

[Music]

176.319

footer and let's start with

180.36

that I'm not exactly sure what all I've

182.76

got going on

185.12

here so let's see what this looks

189

like so now if we run

195.599

it boom so we actually have although

198.68

it's not doing real well we do have

202.159

somewhat of a home page let's get this

204.84

cleaned up a little

207.519

bit so what this used was a

212.2

Carousel

213.879

and I'm not sure if this Carousel is

216.319

going to work now let's see do we have

219.04

oh we're not bringing in I don't think

220.519

we have the carousel stuff being brought

221.879

in uh let's go

224.599

look uh we do have

237.56

Carousel so we might be

239.92

[Music]

245.519

okay I think this is

248.76

uh okay so let's go look at this a

250.92

little bit do a little uh background

254.519

size cover let's see if we've got

256.6

something messed up

258.959

there uh oh there it

262.04

is that's what it is so we have here oh

266.479

this is our PNG so let's see do we have

269.199

those in so we've got some images that

270.88

we were we blew up so if we look

273.88

here uh screen 4.png I don't think I see

278.36

that oh there it is

281.639

okay so this actually needs to

285.44

be now obviously some of this is stuff

288.12

you aren't going to do but if you're

291.28

like me and you were

292.96

using a lot of the older P you know the

295.919

older approaches to this then you're

298.32

going to get some things like this where

299.72

you're going to get extra code lines in

302.44

that it doesn't like and like we saw

304.96

here it just sort of blows up it doesn't

307.16

know what to do now oh we're getting

310.639

better still got some stuff that's a

312.84

little bit jacked up uh now we're going

315.8

to figure out why that is if we go to my

323

Carousel then let's see

328.479

if

330.36

those all seem

333.68

okay it probably isn't getting oh there

336.52

you

337.44

go uh looks like it's not getting those

340.84

images

342.4

so let's go back

344.84

here this is where we're going to have

346.88

to have a little bit of work CU what we

348.4

want to do now this is because this is

351.08

in a

352.12

style sort of a pain in the

355.36

butt however let see if I get something

359.88

so let's try this let's try to just get

361.8

an image first let's keep it

365.52

simple

371.08

um and we will just put it right at the

374.639

top

375.96

here and let's just do screen one let's

380.4

try Image Screen one. PMG

383.319

PNG is that where's that yeah IMG there

385.84

so let's see what happens if we put that

388.4

there

395

troubleshoot this thing a little bit so

398.12

now there we go

400.88

and it is giving us an image so that

404.16

image came through so here we

407.72

go uh let's try uh I think here's where

411.08

this is where our problem lies is it's

412.919

double quotes versus single

417.479

quotes So we want that to be because we

420.08

do want it to know that it's a

424.199

URL it just needs to be there

431.919

so would a doubt look at documentation

435.759

for wh whatever it is you're doing for

439.319

example here we're doing a style for

442.56

background image so if I take

448.319

that let's see what we

451.4

got now we're seeing a bunch of images

454.199

all stacked

457.12

up and so it is probably not bringing

461.12

out the it's probably not handling the

462.879

carousel properly so let's go look at a

468.4

carousel I wonder if bootstrap five has

472

a carousel built in we might be able to

473.84

use it that

477.72

way and if so

480.599

yes it is they have a Cel so that is

484.199

what we're going to jump one into

486.479

probably next time actually let's look

487.72

at this real

490.44

quick um I don't know if this is

493.84

with let's see what happens so that's

497.199

what we

498.84

had if we look at what it should

503.96

be uh if we've got a did we have a next

506.919

I don't know if we had a next before if

508.199

we had our little buttons let's see did

511.24

we I look yes we did

514.12

so uh that means what I can probably do

516.64

is

518.479

take this let's take that first

522.399

one uh where to

526.36

go first slide

529

label placeholder

532.399

text

534.36

image okay so let's see what does this

537.2

look

538

like whoop

541.92

oh cuz it's an item active Okay so

544.72

before we

549.519

had each item so we have an enter there

552.56

we go the enter and we have an active so

555.24

active uh it's going to be like this but

558.6

we don't need

562.76

active we do need its style is still

566.44

going to be this image

574.959

and

576.64

then we want this to

581.72

be this is

585.56

what uh yeah Carousel

588.88

item and then there's an image

595

source oh let's look at this uh let's

598.6

see

603.6

all let's do this let's

607.64

see so that's what he looked like this

610.6

is what he should look like

615.68

now

619.279

wh let's do this

622.2

uh this is the image

624.8

active there we go let's do this we're

627.959

going to do actually let's take this

629.6

first and then we'll start replacing

631.2

stuff that's the easy way to do it so

634.519

let's put this at our

637.36

top oh see they do have

640.72

it uh Carousel slide container there's a

644.24

carousel so if we look

646.52

[Music]

649.48

here if we look at the

652.18

[Music]

655.6

indicators they are probably a little

658.76

different

662.68

yep so this is going to be data Target

665.079

data BS

667.24

Target is just going to

671.079

be

677.839

this and I do

680.92

have a

683.32

fourth 0 one two

687.959

three and he doesn't really need a

694.6

label um but let's give them one anyways

698.639

so there we go so there's

700.56

my

704.519

indicators and then what I want is I've

706.6

got let's take the

711.16

text which is going to be in the caption

717.959

area and let's pull that for each of

720.519

these so we're going to come in here

722.079

we're going to pull our

726.72

text and pull that over and this

740.44

one and then we're going to need to

742.48

duplicate that

747.88

item

752.72

and there we

757.36

go so let's pull that in so we can see a

760.6

little

765.48

bit so

772.6

now if I do my

777.839

source

784.279

here let's change it to a straight

791.6

up and let's see what

794.24

happens let's see if this even works we

796.519

may have a broken some broken HTML

799.36

but this maybe a quick way to get us

805.959

wh so now we have it we've got some text

809.839

we do have some

811.16

buttons and we do have some

816.079

slides

818.399

so let's see so what it comes down to

821.8

here

825.16

is uh let's take

832.48

this and that's going to be screen

835.88

two this is going to be screen

840.959

three it's going to be

844.12

screen

849.959

four oh we need the previous and the

852.44

next are going to be because they are my

867.12

cariso and

871.8

let's put that

878.36

there and let's see so now if we take

882.56

this let's take this crap and get rid of

888.6

it

893.68

that and now let's rebuild

896.519

it and maybe we have managed to add a

900.16

carousel in

905.199

here and let's see how's that

907.72

look now we don't have we need to darken

911

it uh

915.8

cuz somewhere and here is there we

920.36

go and then it just go so we need it to

924.8

Loop is one of our

927.6

things

930.92

and uh let's

936.079

see previous next let's see can we make

943.519

it let's go over

953.279

here

957.6

and

963.839

so we can make it dark if we want which

966.44

is probably what we

968.24

want uh let's see so it's going to

971.72

be and we want it to

979.48

be let's see what is it doing

982.33

[Music]

984.759

here oh let's try

987.36

that uh uh I'm going to play around with

989.959

this so we probably aren't going to go

991.319

too much further in this uh let's see

993.48

this was on

994.8

the uh class

997.48

Carousel where is it at class Carousel

1001

slide dark Carousel dark and let's see

1003.88

what we got

1008.36

here and then we'll so there's a couple

1011.319

things we're going to need to do still

1013

on this

1014.839

is oh here's a nice thing is it does

1017.24

give us okay

1019.24

now it ends up sliding all the way off

1020.759

so we're going to have to work on that

1022.12

but if you notice at the dark it does

1024.24

now give us uh dark

1027.12

text which we probably don't need dark

1029.439

what we actually want to do is we want

1030.6

to darken the

1034.24

images which goes back to what we had

1039.52

before if we go look at

1042.919

home I think it was home well no not

1046.24

home log

1047.4

in

1048.96

is that

1052.76

this is what we needed is that we need

1055.28

to get

1057.08

that into the uh item active let's see

1060.48

if that works let's just try that real

1063.6

quick okay let's see what that looks

1066.08

like

1073.44

now and it does not like that so we're

1076.2

going to play around with that a little

1077.28

bit uh let's go back

1081.36

to there okay and we will see what we

1085.4

can do with this uh see if we can do a

1088.24

little bit of work wh and get these

1092.36

things cleaned up but as you can see we

1094.64

can pull stuff over uh got a little bit

1097.159

of

1098

a uh introduction to bootstrap five

1101.72

because that's what we're moving into

1103.08

we've shifted some stuff over if we kept

1105.2

it that would have been great these are

1107.039

kinds of things you have to deal with

1108

when you're migrating updating an

1109.84

application that being said hope you

1111.84

enjoyed it as always shoot us emails at

1114.159

info@ developer.com or leave a comment

1117.2

and we will talk to you next time so go

1118.88

out there and have yourself a great day

1119.919

a great week and then we will talk to

1122.679

you next time hello this is Rob with

1125.96

develop andur also known as building

1127.76

better developers wanted to announce

1130.08

that we have school. develop or.com feel

1133.039

free to check it out if you like any of

1135.44

this information any of the content that

1137.559

we've sent and you would like to see

1138.88

more you can come out you can enroll for

1140.88

free we have free courses we've got

1143.28

places for you to get better at just

1145.799

learning a technology or how toos you

1148.4

can work on your business skills we can

1150.72

help you with becoming a better

1152.08

developer as in coding and things like

1154.44

that a lot of the stuff you've seen on

1156.08

YouTube we also have out at school.

1158.76

develop andur we have it a little more

1160.799

of a educational format and a way for

1163.36

you to track your progress as you move

1165.88

forward becoming a better developer

1170.24

[Music]

1184.039

ER