This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<g:field type="number" name="iva" required="" value='${fieldValue(bean: productoInstance, field: "iva")}' step="0.01"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<g:field type="number" name="iva" required="" value='${productoInstance.iva}' step="0.01"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RequestMapping(params = "action=contenido") | |
public String contenido(RenderRequest request, @RequestParam("cursoId") Long id, Model model) throws SystemException { | |
log.debug("Edita contenido"); | |
curso = cursoDao.obtiene(id); | |
model.addAttribute("curso", curso); | |
// Obtiene los datos del usuario de session | |
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); | |
try { | |
// Obtiene el grupo en el que se encuentra trabajando el usuario firmado | |
long scopeGroupId = themeDisplay.getScopeGroupId(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Outbound Email Configuration | |
#------------- | |
mail.host = smtp.gmail.com | |
mail.port = 465 | |
mail.protocol = smtps | |
mail.username = test@gmail.com | |
mail.password = myGmailP455W0rD | |
mail.encoding = UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='UTF-8'?> | |
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> | |
<beans> | |
<!-- --> | |
<!-- MAIL SERVICE --> | |
<!-- --> | |
<bean id="mailService" class="org.springframework.mail.javamail.JavaMailSenderImpl"> | |
<property name="host"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Imagen { | |
String nombre | |
String tipoContenido | |
Long tamano | |
byte[] archivo | |
static constraints = { | |
nombre(maxSize:64,nullable:true) | |
tipoContenido(maxSize:64,nullable:true) | |
tamano(nullable:true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<g:form action="upload" method="post" enctype="multipart/form-data"> | |
<input type="file" name="myFile"> | |
<input type="submit"> | |
</g:form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload = { | |
def f = request.getFile('myFile') | |
if (!f.empty) { | |
def imagen = new Imagen( | |
nombre : f.originalFilename | |
, tipoContenido : f.contentType | |
, tamano : f.size | |
, archivo : f.bytes | |
).save() | |
response.sendError(200,'Done') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def imagen = { | |
def imagen = Imagen.get(params.id) | |
log.debug "Mostrando imagen ${imagen?.nombre}" | |
response.setHeader("Content-disposition", "attachment; filename=${imagen?.nombre}") | |
response.contentType = imagen?.tipoContenido | |
byte[] archivo = imagen?.archivo | |
response.contentLength = imagen?.tamano | |
response.outputStream << imagen.archivo | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dominio.withTransaction { | |
// bloque dentro de la transacción | |
} |
OlderNewer