Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FileNook
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sanblas
FileNook
Commits
79adc6d7
Commit
79adc6d7
authored
May 20, 2019
by
Patricia
Browse files
Options
Downloads
Patches
Plain Diff
CAMBIOS
parent
748447eb
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Source Packages/servlet/recuperarimagenOtroSV.java
+0
-85
0 additions, 85 deletions
Source Packages/servlet/recuperarimagenOtroSV.java
web/js/miscripts.js
+42
-0
42 additions, 0 deletions
web/js/miscripts.js
web/registro.html
+4
-39
4 additions, 39 deletions
web/registro.html
with
46 additions
and
124 deletions
Source Packages/servlet/recuperarimagenOtroSV.java
deleted
100644 → 0
+
0
−
85
View file @
748447eb
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package
servlet
;
import
conexionDB.usuarioDB
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.io.PrintWriter
;
import
javax.servlet.ServletException
;
import
javax.servlet.annotation.WebServlet
;
import
javax.servlet.http.HttpServlet
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
/**
*
* @author Usuario
*/
@WebServlet
(
name
=
"recuperarimagenOtroSV"
,
urlPatterns
=
{
"/recuperarimagenOtroSV"
})
public
class
recuperarimagenOtroSV
extends
HttpServlet
{
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected
void
processRequest
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
response
.
setContentType
(
"text/html;charset=UTF-8"
);
response
.
setContentType
(
"image/jpg"
);
OutputStream
respuesta
=
response
.
getOutputStream
();
String
usuario
=
request
.
getParameter
(
"autor"
);
usuarioDB
.
getImagen
(
usuario
,
respuesta
);
respuesta
.
close
();
response
.
flushBuffer
();
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected
void
doGet
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
processRequest
(
request
,
response
);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected
void
doPost
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
processRequest
(
request
,
response
);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public
String
getServletInfo
()
{
return
"Short description"
;
}
// </editor-fold>
}
This diff is collapsed.
Click to expand it.
web/js/miscripts.js
0 → 100644
+
42
−
0
View file @
79adc6d7
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
function
pswigual
(){
var
a
=
document
.
getElementsByName
(
"
psw
"
)[
0
].
value
;
var
b
=
document
.
getElementsByName
(
"
pswrepeat
"
)[
0
].
value
;
var
espacios
=
false
;
var
cont
=
0
;
if
(
a
!==
b
){
alert
(
"
Los campos
\"
Contraseña
\"
y
\"
Repetir Contraseña
\"
deben ser iguales
"
);
return
false
;
}
while
(
!
espacios
&&
(
cont
<
a
.
length
))
{
if
(
a
.
charAt
(
cont
)
===
"
"
)
espacios
=
true
;
cont
++
;
}
if
(
espacios
)
{
alert
(
"
La contraseña no puede contener espacios en blanco
"
);
return
false
;
}
if
(
a
.
length
===
0
||
b
.
length
===
0
)
{
alert
(
"
Los campos de la password no pueden quedar vacios
"
);
return
false
;
}
if
(
a
.
length
<=
4
)
{
alert
(
"
La contraseña debe tener mas de 4 dígitos
"
);
return
false
;
}
if
(
a
.
length
>=
15
)
{
alert
(
"
La contraseña debe tener menos de 15 dígitos
"
);
return
false
;
}
}
This diff is collapsed.
Click to expand it.
web/registro.html
+
4
−
39
View file @
79adc6d7
...
...
@@ -6,43 +6,8 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<link
href=
"style.css"
rel=
"stylesheet"
>
<script
type=
'text/javascript'
src=
'js/miscripts.js'
></script>
<script
type=
"text/javascript"
>
function
pswigual
(){
var
a
=
document
.
getElementsByName
(
"
psw
"
)[
0
].
value
;
var
b
=
document
.
getElementsByName
(
"
pswrepeat
"
)[
0
].
value
;
var
espacios
=
false
;
var
cont
=
0
;
if
(
a
!==
b
){
alert
(
"
Los campos
\"
Contraseña
\"
y
\"
Repetir Contraseña
\"
deben ser iguales
"
);
return
false
;
}
while
(
!
espacios
&&
(
cont
<
a
.
length
))
{
if
(
a
.
charAt
(
cont
)
===
"
"
)
espacios
=
true
;
cont
++
;
}
if
(
espacios
)
{
alert
(
"
La contraseña no puede contener espacios en blanco
"
);
return
false
;
}
if
(
a
.
length
===
0
||
b
.
length
===
0
)
{
alert
(
"
Los campos de la password no pueden quedar vacios
"
);
return
false
;
}
if
(
a
.
length
<=
4
)
{
alert
(
"
La contraseña debe tener mas de 4 dígitos
"
);
return
false
;
}
if
(
a
.
length
>=
15
)
{
alert
(
"
La contraseña debe tener menos de 15 dígitos
"
);
return
false
;
}
}
<script>
pswigual
();
</script>
</head>
<body
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment