📺 Develpreneur YouTube Episode

Video + transcript

Spring Boot - Form Processing

2024-01-04 •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. We are working on a complex form for entering data. This episode focuses on getting our data to pass to and from the web page for saving it.

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 working on on our application
conversion uh last time around we were
starting to fill out a form we're
working on some drop downs and some
selects uh we're going to continue that
so we're going to go check this one out
here that prior descriptions I bet we do
not have our options built out right so
if we go down to our prior
descriptions uh there correct we do not
have that set up so we've got our uh
everything set up sort of uh but we've
got an option
here for we just want to build a regular
option and then we you want to come
in and based off of description
list whoops
descriptions
list and then this one we don't even
need the feel because this is actually
just going to
be
um I'll give it an
ID and we're going to call it
descriptions list because we probably
need that somewhere so we have an ID for
it uh we don't need form options and so
here we're going to have a description
and it's going to be
probably uh we can probably just let it
be I and I I bet let's go look at our
descriptions list uh if we go look
here and our hello controller if we look
at descriptions list somewhere in here
descriptions list is description list
which comes from the Dao get
past so if we go here project
Dao get past get past uh get past
descriptions it's just select
descriptions so that's going to be a
straight up
text so that's easy enough to fix let's
go ahead and get this uh earnings and
agent cost thing here that we did not
pick up last time so these are going to
be uh your standard th values which we
just had some formatting around
those uh where did those go they're down
here aren't they I keep going by them
okay yeah agent cost and earnings there
we go so this we're just going to come
in and this is going to be a
div and we're going to do a th
value and we can probably pull that out
completely and make
that let's do
this
and let's do that for our div and and
we're going to do the same thing for our
uh the other one we're just going to
change a couple values though because
now it's going to be this is going to be
our
value let's see how that works for
us uh div div there we go so let's see
if this works and that should allow us
to step into our next section of filling
out uh fixing another series
of our uh little
Loop and there we go look at that we got
a bunch of descriptions not sure why we
have an equal but that's okay uh then we
come in here let's see those are not
getting their values so let's go check
those
again those are oops
[Music]
um yeah because those need to be
instead of the th value that probably
needs to be the
star I think that may get it for us so
if we do those as a
star then let's run
those and if we run
that and we come over here oh it blew up
didn't like
that probably got something in there
that is not
right uh project cost cannot be found
okay
so one project cost oh I wonder if we
sent that as a single value so we
probably
did project cost is an object so what we
need this is good we we get a little bit
wh this where it gets a little
interesting because now we if I can get
that fixed back there we go go so what
we have here is Project cost is
actually not the same as this star
project so we almost need it probably
need it to be like this is we need to
say
dollar project cost
times uh that should
actually work let's do it this way let's
just check this
first
um let's do him like three
times and then I'll just give us so
here we'll put a little pipe between
them so if we do project
cost here and then we do
project agent percent let's see how that
works let's see how those
work
and we come over
here probably still going to blow up but
at least we can see something maybe
no and it is BEC oh because it's going
to blow up there or not uh let's
see there's still more data in the
expression oh that's why let's do that
and then let's get rid of this
one for now so that doesn't
blow up oh actually it'll be okay
because we can put it there so
okay so we should be okay doing
that and if we run through here we go to
our project boom and we're getting
nothing so it's not coming
across so project cost it doesn't like
at all why doesn't it like that at all
oh I wonder if it is actually zero
um if I go back did it have it listed
here
no
but that's probably because let's see if
we've got one here we
go okay so he has some stuff but he does
not have earnings nor agent cost so
that's not coming across
right so let's go look at this so what
we
had
um project cost and then the agent
percent and so agent percent is going to
be that should
be oh it's whoa It's not th shoot that's
problem it's not th value it's th
text because we're in a dip that can
cause some
problems so if we do that that let's
just save it here as well because this
is actually just a straight it's not
really as much a form thing so now let's
look at it um yeah we'll just keep all
of those three and then we'll clean it
up in a
minute clean it up next time
around log
in and now we've got zeros coming across
which is what we wanted so we're going
to take uh these and get rid of those
and yeah we'll do that and
[Music]
then uh we've got a break and then we
have the agent cost because so we wanted
that there okay and then uh we've got
its value I don't think we need another
break do we that seems like a lot let's
uh we'll see how that looks in a minute
so let's fix so if we got those now we
got that we've got our descriptions
let's go down here look at our tasks and
our actually specifically our overhead
requirements actually probably both of
them are broken so let's look at our
tasks
first and so we have an if uh we're
coming in here we have an if so let's
get take a look at that we're going to
copy that because we're basically going
to rebuild that down here uh so he's
going to say select task but he doesn't
have any but we do have apparently some
maybe some overhead requirements for
this one well let's see let me go look
um let's see if we have one there we go
so this one does have tasks so tasks is
set up correctly but of course we're
going to add some more here because this
is going to do an onclick so let's go
and get our overhead requirements get
that one
fixed and that is here we can see that
we've got our old demesis the C4 each so
let's just take him and it's going to be
21126 21126 oh good he is the same size
and here he's instead going to be from
list
overhead and we want him to
be uh let's
see let's call him
over and so it's going to be instead of
Select task it's going to be select
overhead and it's going to be
uh over. project ID most
likely uh yes project ID but it also has
over.
ID uh
comma wh did I get that right no there
we go that over
ID and
then
why is
that oh that's probably a typo up
here that's probably supposed to be a
comma that could cause US
problems and then here uh let's see so
this is going to be uh it's not be it's
going to be status I'm sorry over and
over
ID uh status is going to be great we'll
keep that and then
here we're going to
be we're just going to take
these and put those
here and those are going to be let's get
rid of that and then these are each
going to
be we're just going to do
th uh text equals and then throw it
there throw it there close it so we get
to take
that um we'll go
there uh over.
scription there we
go th text
this
is do it that way yep so that's going to
be a
div actually we'll just go to this
part and that brings him
across and we're going do that uh we'll
do it like that so now there's the div
close the div div div div div div
div uh this one is oh I see why we had
that
before th text
equals oh quotes and quotes close the
div there we go and then this one's
going to be let's close that div
there and do the th text equals that
and close the PRS or the yeah the double
PRS which I had so that
should cover
it and then at the bottom we've got that
which we want to have
a get the filter in
[Music]
there I think we just called it
footer let's go go check that real quick
so if we go look at basically any other
page oops I want
that let's just kill it there we go and
then come in here let's make sure we got
that right we did okay so now let's run
this see how we
do so I think we now have a working
form to some extent
and now the next thing is going to be
trying to change so let's pick this uh
let's do this guy he's probably got both
okay so he doesn't have that but now
let's go take one of these and let's see
because I bet we have to actually hook
it up so let's change this to a bit
amount of let's just say 500 and if we
do save or update then we've got an
issue
because we got an error and that error
is all the way up
[Music]
here
uh project ID cannot be
found on overhead okay so somewhere in
overhead we had a project ID oh here it
is a project ID but it's project project
ID let's go look at our
overheads that's a user oh it's in a
model we want overhead
model let's do it over here so it's
easier to see did we have a project ID
wh uh we have a project ID but it's
with uh I don't think it's going to like
this wants the capital
I most
likely so let's try
that
uh is that
right oh here we go cannot render airor
p oh as a response has already been
committed double check make sure I
didn't run
over that latest
error
and okay so I think that is it so let's
try that
again so I kind like to send so it's
going to log me
in and if I come in here and I set a bit
amount for 500 do a save then I'm
getting an issue and it is not telling
me what it is because
here that save project is probably not
even if we go to Hello that's probably
what we're going to do next
is uh go
find
save so it is not there what is that
saor update that saver update was for
register user we need to have a save
project so next time around that's what
we're going to pick up and we'll just
pick up right where we left off and uh
we're going to actually get some form
saving finally and starting to get some
actual uh crud you know create retrieve
update delete kind of functionality into
our app uh as always sh any questions
you have to info at developer.com we
happy to help you out point you in the
right direction anywhere uh we need to
or if there's some additional stuff and
some examples you'd like this to do
happy to do so until the next time go
out there and have yourself a great day
a great week and we'll see you next
[Music]
time
Transcript Segments
1.35

[Music]

27.24

well hello and welcome back we are

29.16

continuing working on on our application

31.199

conversion uh last time around we were

32.96

starting to fill out a form we're

34.399

working on some drop downs and some

35.96

selects uh we're going to continue that

38.399

so we're going to go check this one out

39.92

here that prior descriptions I bet we do

42.52

not have our options built out right so

44.239

if we go down to our prior

46.399

descriptions uh there correct we do not

49.16

have that set up so we've got our uh

51.36

everything set up sort of uh but we've

53.76

got an option

56.76

here for we just want to build a regular

59.28

option and then we you want to come

61.359

in and based off of description

68.52

list whoops

71.68

descriptions

74.04

list and then this one we don't even

76.08

need the feel because this is actually

77.92

just going to

79.56

be

82.36

um I'll give it an

85.64

ID and we're going to call it

87.439

descriptions list because we probably

89.28

need that somewhere so we have an ID for

91.2

it uh we don't need form options and so

94.479

here we're going to have a description

96.159

and it's going to be

98.119

probably uh we can probably just let it

100.479

be I and I I bet let's go look at our

105.759

descriptions list uh if we go look

109.36

here and our hello controller if we look

112.079

at descriptions list somewhere in here

114.24

descriptions list is description list

116.32

which comes from the Dao get

118.84

past so if we go here project

122.84

Dao get past get past uh get past

128.28

descriptions it's just select

129.319

descriptions so that's going to be a

130.599

straight up

132.72

text so that's easy enough to fix let's

135.239

go ahead and get this uh earnings and

137.04

agent cost thing here that we did not

140.08

pick up last time so these are going to

142.519

be uh your standard th values which we

145.64

just had some formatting around

147.76

those uh where did those go they're down

151.72

here aren't they I keep going by them

155.319

okay yeah agent cost and earnings there

157.599

we go so this we're just going to come

160.72

in and this is going to be a

163.84

div and we're going to do a th

167.959

value and we can probably pull that out

173.8

completely and make

176.599

that let's do

178.76

this

181.64

and let's do that for our div and and

185.48

we're going to do the same thing for our

188.4

uh the other one we're just going to

189.28

change a couple values though because

190.799

now it's going to be this is going to be

192.64

our

195.239

value let's see how that works for

201.64

us uh div div there we go so let's see

204.84

if this works and that should allow us

206.799

to step into our next section of filling

209.2

out uh fixing another series

213.319

of our uh little

217.92

Loop and there we go look at that we got

221.12

a bunch of descriptions not sure why we

222.599

have an equal but that's okay uh then we

225.28

come in here let's see those are not

227.319

getting their values so let's go check

229.64

those

232.2

again those are oops

234.75

[Music]

236

um yeah because those need to be

240.84

instead of the th value that probably

242.519

needs to be the

244.48

star I think that may get it for us so

247.439

if we do those as a

250.2

star then let's run

257.479

those and if we run

262.24

that and we come over here oh it blew up

266.12

didn't like

267.52

that probably got something in there

269.759

that is not

272.12

right uh project cost cannot be found

276.12

okay

281.56

so one project cost oh I wonder if we

284.32

sent that as a single value so we

286.72

probably

287.84

did project cost is an object so what we

291.8

need this is good we we get a little bit

294.039

wh this where it gets a little

295.36

interesting because now we if I can get

298.56

that fixed back there we go go so what

300.16

we have here is Project cost is

303.039

actually not the same as this star

305.96

project so we almost need it probably

309.4

need it to be like this is we need to

311

say

312.36

dollar project cost

316.6

times uh that should

321.6

actually work let's do it this way let's

325.039

just check this

328.479

first

333.199

um let's do him like three

336.039

times and then I'll just give us so

339.08

here we'll put a little pipe between

341.639

them so if we do project

345

cost here and then we do

349.72

project agent percent let's see how that

354.96

works let's see how those

358.479

work

362.759

and we come over

366.08

here probably still going to blow up but

368.08

at least we can see something maybe

370.639

no and it is BEC oh because it's going

373.199

to blow up there or not uh let's

377.72

see there's still more data in the

380.24

expression oh that's why let's do that

384.599

and then let's get rid of this

386.4

one for now so that doesn't

390

blow up oh actually it'll be okay

392.84

because we can put it there so

395.319

okay so we should be okay doing

400.56

that and if we run through here we go to

403.8

our project boom and we're getting

407

nothing so it's not coming

409.24

across so project cost it doesn't like

412.72

at all why doesn't it like that at all

415.96

oh I wonder if it is actually zero

422.4

um if I go back did it have it listed

425.319

here

427.319

no

429.36

but that's probably because let's see if

432.599

we've got one here we

435.68

go okay so he has some stuff but he does

438.199

not have earnings nor agent cost so

439.879

that's not coming across

441.36

right so let's go look at this so what

443.639

we

445.08

had

447.879

um project cost and then the agent

450.879

percent and so agent percent is going to

458.08

be that should

461.16

be oh it's whoa It's not th shoot that's

465.759

problem it's not th value it's th

470.4

text because we're in a dip that can

473.4

cause some

477.72

problems so if we do that that let's

480.479

just save it here as well because this

484.759

is actually just a straight it's not

486.479

really as much a form thing so now let's

489.08

look at it um yeah we'll just keep all

491.44

of those three and then we'll clean it

492.44

up in a

493.919

minute clean it up next time

496.599

around log

501.08

in and now we've got zeros coming across

504.319

which is what we wanted so we're going

505.599

to take uh these and get rid of those

513.56

and yeah we'll do that and

515.98

[Music]

517.12

then uh we've got a break and then we

519.56

have the agent cost because so we wanted

522.399

that there okay and then uh we've got

525.08

its value I don't think we need another

526.88

break do we that seems like a lot let's

530.6

uh we'll see how that looks in a minute

532.519

so let's fix so if we got those now we

535.36

got that we've got our descriptions

536.839

let's go down here look at our tasks and

538.959

our actually specifically our overhead

540.76

requirements actually probably both of

542.519

them are broken so let's look at our

543.76

tasks

545.2

first and so we have an if uh we're

548.48

coming in here we have an if so let's

551.24

get take a look at that we're going to

553.16

copy that because we're basically going

554.16

to rebuild that down here uh so he's

556.88

going to say select task but he doesn't

558.56

have any but we do have apparently some

562.16

maybe some overhead requirements for

564.48

this one well let's see let me go look

568.12

um let's see if we have one there we go

572.12

so this one does have tasks so tasks is

574.12

set up correctly but of course we're

576.16

going to add some more here because this

577.32

is going to do an onclick so let's go

579.04

and get our overhead requirements get

580.56

that one

582.76

fixed and that is here we can see that

586

we've got our old demesis the C4 each so

591.64

let's just take him and it's going to be

594.72

21126 21126 oh good he is the same size

599.76

and here he's instead going to be from

602.8

list

605.92

overhead and we want him to

611.8

be uh let's

616.399

see let's call him

621.32

over and so it's going to be instead of

623.48

Select task it's going to be select

627.279

overhead and it's going to be

629.839

uh over. project ID most

636.36

likely uh yes project ID but it also has

640.519

over.

645.24

ID uh

647.48

comma wh did I get that right no there

650.24

we go that over

653.32

ID and

658.04

then

668.04

why is

670.519

that oh that's probably a typo up

674.76

here that's probably supposed to be a

676.72

comma that could cause US

679.32

problems and then here uh let's see so

682.2

this is going to be uh it's not be it's

684.24

going to be status I'm sorry over and

687.959

over

690.959

ID uh status is going to be great we'll

693.8

keep that and then

695.76

here we're going to

699.48

be we're just going to take

703.24

these and put those

708.279

here and those are going to be let's get

710.72

rid of that and then these are each

712.72

going to

715.12

be we're just going to do

717.48

th uh text equals and then throw it

723.44

there throw it there close it so we get

728.079

to take

730.2

that um we'll go

737

there uh over.

742.56

scription there we

746.8

go th text

749.8

this

752.6

is do it that way yep so that's going to

757

be a

759.8

div actually we'll just go to this

765.079

part and that brings him

771.32

across and we're going do that uh we'll

774.72

do it like that so now there's the div

777.24

close the div div div div div div

780.959

div uh this one is oh I see why we had

785.079

that

787.88

before th text

791.68

equals oh quotes and quotes close the

797.32

div there we go and then this one's

801.24

going to be let's close that div

805.92

there and do the th text equals that

809.44

and close the PRS or the yeah the double

813.639

PRS which I had so that

818.92

should cover

822.6

it and then at the bottom we've got that

825.72

which we want to have

828.12

a get the filter in

830.44

[Music]

832.56

there I think we just called it

837.399

footer let's go go check that real quick

839.959

so if we go look at basically any other

844.839

page oops I want

851.24

that let's just kill it there we go and

854.24

then come in here let's make sure we got

855.6

that right we did okay so now let's run

859.24

this see how we

861.759

do so I think we now have a working

866.56

form to some extent

869.8

and now the next thing is going to be

871.279

trying to change so let's pick this uh

873.32

let's do this guy he's probably got both

874.959

okay so he doesn't have that but now

877.759

let's go take one of these and let's see

880.759

because I bet we have to actually hook

881.959

it up so let's change this to a bit

883.88

amount of let's just say 500 and if we

886.68

do save or update then we've got an

889.12

issue

891.279

because we got an error and that error

894.199

is all the way up

895.99

[Music]

897.68

here

900.32

uh project ID cannot be

905.199

found on overhead okay so somewhere in

908.839

overhead we had a project ID oh here it

912.959

is a project ID but it's project project

916.32

ID let's go look at our

918.6

overheads that's a user oh it's in a

920.959

model we want overhead

923.32

model let's do it over here so it's

925.6

easier to see did we have a project ID

930.12

wh uh we have a project ID but it's

934.56

with uh I don't think it's going to like

936.68

this wants the capital

939.04

I most

942.12

likely so let's try

948.12

that

952.959

uh is that

955.44

right oh here we go cannot render airor

958.399

p oh as a response has already been

963.399

committed double check make sure I

965.319

didn't run

967.36

over that latest

971.279

error

973.279

and okay so I think that is it so let's

975.72

try that

981.04

again so I kind like to send so it's

983.44

going to log me

985.48

in and if I come in here and I set a bit

989.079

amount for 500 do a save then I'm

993.16

getting an issue and it is not telling

995.839

me what it is because

997.639

here that save project is probably not

1001.759

even if we go to Hello that's probably

1004.44

what we're going to do next

1006.16

is uh go

1010.6

find

1013.959

save so it is not there what is that

1016.839

saor update that saver update was for

1019.24

register user we need to have a save

1022.16

project so next time around that's what

1023.639

we're going to pick up and we'll just

1026

pick up right where we left off and uh

1028.72

we're going to actually get some form

1030.16

saving finally and starting to get some

1032.64

actual uh crud you know create retrieve

1035.199

update delete kind of functionality into

1037.52

our app uh as always sh any questions

1040.36

you have to info at developer.com we

1042.439

happy to help you out point you in the

1043.64

right direction anywhere uh we need to

1046.12

or if there's some additional stuff and

1047.64

some examples you'd like this to do

1049.919

happy to do so until the next time go

1052.559

out there and have yourself a great day

1053.96

a great week and we'll see you next

1058.47

[Music]

1072.2

time