Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
th-app-java
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oscar Enrique Gonzalez Escurra
th-app-java
Commits
5217c61a
Commit
5217c61a
authored
Nov 05, 2021
by
Javier Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
form para agregar tecnologias nuevas
parent
a2013f11
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
1 deletions
+82
-1
curriculumsearch/src/main/java/com/roshka/controller/TecnologiaController.java
+41
-0
curriculumsearch/src/main/java/com/roshka/modelo/Tecnologia.java
+1
-1
curriculumsearch/src/main/webapp/jsp/tecnologia-form.jsp
+40
-0
No files found.
curriculumsearch/src/main/java/com/roshka/controller/TecnologiaController.java
0 → 100644
View file @
5217c61a
package
com
.
roshka
.
controller
;
import
com.roshka.modelo.Tecnologia
;
import
com.roshka.repositorio.TecnologiaRepository
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@Controller
public
class
TecnologiaController
{
TecnologiaRepository
tecRepo
;
@Autowired
public
TecnologiaController
(
TecnologiaRepository
tecRepo
){
this
.
tecRepo
=
tecRepo
;
}
@GetMapping
(
"/tecnologia"
)
public
String
addtecnologiaView
(
Model
model
)
{
model
.
addAttribute
(
"tecnologia"
,
new
Tecnologia
());
return
"tecnologia-form"
;
}
@PostMapping
(
"/tecnologia"
)
public
String
addtecnologia
(
@ModelAttribute
(
"tecnologia"
)
Tecnologia
tecnologia
)
{
tecRepo
.
save
(
tecnologia
);
return
"redirect:/"
;
}
}
curriculumsearch/src/main/java/com/roshka/modelo/Tecnologia.java
View file @
5217c61a
...
...
@@ -29,7 +29,7 @@ public class Tecnologia {
this
.
id
=
id
;
}
public
String
getNombre
()
{
return
nombre
.
toLowerCase
()
;
return
nombre
;
}
public
void
setNombre
(
String
nombre
)
{
this
.
nombre
=
nombre
;
...
...
curriculumsearch/src/main/webapp/jsp/tecnologia-form.jsp
0 → 100644
View file @
5217c61a
<
%@
taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%
>
<
%@
taglib
prefix=
"form"
uri=
"http://www.springframework.org/tags/form"
%
>
<
%@
page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%
>
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<!-- Bootstrap CSS -->
<link
href=
"https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel=
"stylesheet"
integrity=
"sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin=
"anonymous"
>
<title>
Hello, world!
</title>
<style
type=
"text/css"
media=
"screen"
>
body
{
background-color
:
rgba
(
98
,
0
,
255
,
0
)
}
</style>
</head>
<body>
<form:form
action=
"/tecnologia"
method=
"post"
modelAttribute=
"tecnologia"
>
<form:label
path=
"nombre"
>
name:
</form:label>
<form:input
type=
"text"
path=
"nombre"
/>
<input
type=
"submit"
value=
"submit"
/>
</form:form>
</body>
</html>
\ No newline at end of file
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