Ir para conteúdo
Fórum Script Brasil

Pesquisar na Comunidade

Mostrando resultados para as tags ''spring''.

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • Programação & Desenvolvimento
    • ASP
    • PHP
    • .NET
    • Java
    • C, C++
    • Delphi, Kylix
    • Lógica de Programação
    • Mobile
    • Visual Basic
    • Outras Linguagens de Programação
  • WEB
    • HTML, XHTML, CSS
    • Ajax, JavaScript, XML, DOM
    • Editores
  • Arte & Design
    • Corel Draw
    • Fireworks
    • Flash & ActionScript
    • Photoshop
    • Outros Programas de Arte e Design
  • Sistemas Operacionais
    • Microsoft Windows
    • GNU/Linux
    • Outros Sistemas Operacionais
  • Softwares, Hardwares e Redes
    • Microsoft Office
    • Softwares Livres
    • Outros Softwares
    • Hardware
    • Redes
  • Banco de Dados
    • Access
    • MySQL
    • PostgreSQL
    • SQL Server
    • Demais Bancos
  • Segurança e Malwares
    • Segurança
    • Remoção De Malwares
  • Empregos
    • Vagas Efetivas
    • Vagas para Estágios
    • Oportunidades para Freelances
  • Negócios & Oportunidades
    • Classificados & Serviços
    • Eventos
  • Geral
    • Avaliações de Trabalhos
    • Links
    • Outros Assuntos
    • Entretenimento
  • Script Brasil
    • Novidades e Anúncios Script Brasil
    • Mercado Livre / Mercado Sócios
    • Sugestões e Críticas
    • Apresentações

Encontrar resultados em...

Encontrar resultados que...


Data de Criação

  • Início

    FIM


Data de Atualização

  • Início

    FIM


Filtrar pelo número de...

Data de Registro

  • Início

    FIM


Grupo


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Encontrado 4 registros

  1. Estou com problema e gostaria da ajuda de vocês para solucionar. É o seguinte tenho uma classe model em JAVA com um alguns atributos e dentre eles um que se relaciona com outra classe model, preciso que seja realizada um select no banco para retornar os dados da segunda tabela, isso com o thymeleaf . já esta pronto o controller e as demais classes necessária mas eu recebe o seguinte erro ao iniciar o projeto: java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name ‘aluno’ available as request attribute segue abaixo as classes para averiguação de vocês. Obrigado. Caso alguém tenha algum exemplo pronto para estudar eu agradeço. package com.sigesig.model; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity @Table(name = "addAlunoEB") public class AddAlunoEB implements Serializable { /** * */ private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; @ManyToOne private Membros aluno; @ManyToOne private EscolaBiblica escolaBiblica; private String dtNascAluno; public String getDtNascAluno() { return dtNascAluno; } public void setDtNascAluno(String dtNascAluno) { this.dtNascAluno = dtNascAluno; } public long getId() { return id; } public void setId(long id) { this.id = id; } public Membros getAluno() { return aluno; } public void setAluno(Membros aluno) { this.aluno = aluno; } public static long getSerialversionuid() { return serialVersionUID; } public EscolaBiblica getEscolaBiblica() { return escolaBiblica; } public void setEscolaBiblica(EscolaBiblica escolaBiblica) { this.escolaBiblica = escolaBiblica; } } package com.sigesig.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import com.sigesig.model.AddAlunoEB; import com.sigesig.model.EscolaBiblica; import com.sigesig.repository.AddAlunoEBRepository; import com.sigesig.repository.EscolaBiblicaRepository; import com.sigesig.repository.MembrosRepository; @Controller public class EscolaBiblicaController { @Autowired private EscolaBiblicaRepository ebr; @Autowired private AddAlunoEBRepository aar; @Autowired private MembrosRepository mr; @RequestMapping(value= "/cadastrarEscolaBiblica", method= RequestMethod.GET) public String form(){ return "escolabiblica/formEscolaBiblica"; } @RequestMapping(value= "/cadastrarEscolaBiblica", method= RequestMethod.POST) public String form(EscolaBiblica escolaBiblica){ ebr.save(escolaBiblica); return "redirect:/cadastrarEscolaBiblica"; } @RequestMapping("/escolasBiblicas") public ModelAndView listaEscolasBiblicas(){ ModelAndView mv =new ModelAndView("index"); Iterable<EscolaBiblica> escolasBiblicas = ebr.findAll(); mv.addObject("escolasBiblicas", escolasBiblicas); return mv; } /* @RequestMapping(value="/{id}", method=RequestMethod.GET) public ModelAndView membro(AddAlunoEB alunoEB){ ModelAndView mv =new ModelAndView("escolabiblica/detalhesEscolaBiblica"); mv.addObject(alunoEB); mv.addObject("alunos", mr.findAll()); return mv; } */ @RequestMapping(value="/{id}", method=RequestMethod.GET) public ModelAndView detalhesEscolaBiblica(@PathVariable("id") long id,AddAlunoEB alunoEB){ EscolaBiblica escolaBiblica = ebr.findById(id); ModelAndView mv =new ModelAndView("escolabiblica/detalhesEscolaBiblica"); mv.addObject(alunoEB); mv.addObject("alunos", mr.findAll()); mv.addObject("escolaBiblica",escolaBiblica); return mv; } @RequestMapping(value="/{id}", method=RequestMethod.POST) public String detalhesEscolaBiblicaPost(@PathVariable("id") long id, AddAlunoEB alunoEB){ EscolaBiblica escolaBiblica = ebr.findById(id); alunoEB.setEscolaBiblica(escolaBiblica); aar.save(alunoEB); return "redirect:/{id}"; } } <!DOCTYPE html> <html xmlns:th="http://thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"> <head> <title>SIGESIG</title> <!--Import Google Icon Font--> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" /> <!--Import materialize.css--> <link type="text/css" rel="stylesheet" href="materialize/css/materialize.min.css" media="screen,projection" /> <!--Let browser know website is optimized for mobile--> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta charset="UTF-8" /> </head> <body> <h1>Adicionar Alunos</h1> <h3> <a href="/escolasBiblicas" class="waves-effect waves-light btn"><i class="material-icons left">add_circle_outline</i>Listar Escola Bíblica</a> </h3> <div th:each="escolaBiblica : ${escolaBiblica}" class="container"> <div class="row"> <p>Turma: <span th:text="${escolaBiblica.turma}"></span></p> <p>Professor: <span th:text="${escolaBiblica.professor}"></span></p> <p>Status: <span th:text="${escolaBiblica.status}"></span></p> <p>Templo: <span th:text="${escolaBiblica.templo}"></span></p> </div> <form method="post"> Nome: <input type="text" value="" name=""/> Data Nascimento: <input type="text" value="" name="dtNascAluno"/> <select name="aluno" th:field="*{aluno}"> <option th:each="aluno: ${alunos}" th:value="${aluno.id}" th:text="${aluno.id}"></option> </select> <button class="waves-effect waves-light btn" type="submit" >Adicionar</button> </form> </div> <!--Import jQuery before materialize.js--> <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script> <script type="text/javascript" src="materialize/js/materialize.min.js"></script> </body> </html>
  2. O que estou errando, não consegui encontrar o erro. dispatcher-servlet.xml <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:jee="http://www.springframework.org/schema/jee" xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd "> <!-- ONDE ESTÃO OS COMPONENTES DO SPRING (EX:@Controller, @Repository, @Service e @Component ) --> <context:component-scan base-package="br.com.netsoft" /> <!-- SEM ESSA TAG ELE NÃO RETORNA O JSON --> <mvc:annotation-driven /> <!-- SEM ESSA TAG NÃO CARREGA OS CSS/JS --> <mvc:default-servlet-handler /> <!-- GERENCIAMENTO DO JPA PELO SPRING --> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="PERSISTENCE_UNIT" /> </bean> <!-- gerenciamento das transações --> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory" /> </bean> <tx:annotation-driven transaction-manager="transactionManager" /> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix"> <value>/WEB-INF/views/</value> </property> <property name="suffix"> <value>.html</value> </property> </bean> </beans> web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>DESIF</display-name> <servlet> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/dispatcher-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> </web-app> Log no console 01:19:05,602 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./desif.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./desif.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet from [Module "deployment.desif.war:main" from Service Module Loader] at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:1079) at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:284) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet from [Module "deployment.desif.war:main" from Service Module Loader] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93) at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:723) ... 6 more 01:19:05,608 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "desif.war")]) - failure description: { "WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./desif.UndertowDeploymentInfoService" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./desif.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet from [Module \"deployment.desif.war:main\" from Service Module Loader] Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet from [Module \"deployment.desif.war:main\" from Service Module Loader]"}, "WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.deployment.default-server.default-host./desif.UndertowDeploymentInfoService"], "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined }Servidor é Wildfly.Arquivo pom <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>br.com.netsoft</groupId> <artifactId>desif</artifactId> <version>1.0.0-SNAPSHOT</version> <packaging>war</packaging> <build> <finalName>desif</finalName> </build> <properties> <failOnMissingWebXml>false</failOnMissingWebXml> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <failOnMissingWebXml>false</failOnMissingWebXml> <java-version>1.8</java-version> <spring.version>5.0.0.RELEASE</spring.version> <org.aspectj-version>1.8.1</org.aspectj-version> <org.slf4j-version>1.6.6</org.slf4j-version> <!-- false - não precisa de XML --> <failOnMissingWebXml>false</failOnMissingWebXml> <!-- Thymeleaf --> <thymeleaf.version>3.0.3.RELEASE</thymeleaf.version> <!-- Thymeleaf - Layout Dialect --> <thymeleaf-layout-dialect.version>2.1.2</thymeleaf-layout-dialect.version> </properties> <repositories> <repository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>https://repo.spring.io/libs-milestone</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <dependencies> <!-- Métodos uteis para manipulação de String, métodos e etc --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.4</version> </dependency> <!-- Thymeleaf - Layout Dialect --> <dependency> <groupId>nz.net.ultraq.thymeleaf</groupId> <artifactId>thymeleaf-layout-dialect</artifactId> <version>${thymeleaf-layout-dialect.version}</version> </dependency> <!-- Thymeleaf - extras --> <dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-springsecurity4</artifactId> <version>3.0.1.RELEASE</version> </dependency> <!-- Thymeleaf --> <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf</artifactId> <version>${thymeleaf.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf-spring4</artifactId> <version>${thymeleaf.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <!-- Spring início --> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> <version>5.0.0.M4</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>2.0.0.M3</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.version}</version> </dependency> <!-- Spring fim --> <!-- <dependency> --> <!-- <groupId>javax</groupId> --> <!-- <artifactId>javaee-api</artifactId> --> <!-- <scope>provided</scope> --> <!-- </dependency> --> <!-- AspectJ --> <!-- <dependency> --> <!-- <groupId>org.aspectj</groupId> --> <!-- <artifactId>aspectjrt</artifactId> --> <!-- <version>${org.aspectj-version}</version> --> <!-- </dependency> --> <!-- Logging início --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${org.slf4j-version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>${org.slf4j-version}</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${org.slf4j-version}</version> <scope>runtime</scope> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.15</version> <exclusions> <exclusion> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> </exclusion> <exclusion> <groupId>javax.jms</groupId> <artifactId>jms</artifactId> </exclusion> <exclusion> <groupId>com.sun.jdmk</groupId> <artifactId>jmxtools</artifactId> </exclusion> <exclusion> <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId> </exclusion> </exclusions> <scope>runtime</scope> </dependency> <!-- Logging fim --> <!-- @Inject --> <!-- <dependency> --> <!-- <groupId>javax.inject</groupId> --> <!-- <artifactId>javax.inject</artifactId> --> <!-- <version>1</version> --> <!-- </dependency> --> <!-- <dependency> --> <!-- <groupId>commons-dbcp</groupId> --> <!-- <artifactId>commons-dbcp</artifactId> --> <!-- <version>1.2.2</version> --> <!-- </dependency> --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.6.0.Final</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.1.0.Final</version> </dependency> <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>1.0.0.GA</version> </dependency> <!-- Test --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.7</version> <scope>test</scope> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> </dependencies> </dependencyManagement> </project>
  3. Netsoft

    Campo Lista

    Este campo é preenchido corretamente por uma consulta feita no DAO. O problema é que não está aceitando o objeto como nulo ou como o valor pelo ID. O campo da entidade é @ManyToOne @JoinColumn(name = "cos_id_id") public CosifEntity getCosif() { return cosif; } public void setCosif(CosifEntity cosif) { this.cosif = cosif; } Estou com este erro do log do eclipse. Field error in object 'cosifEntity' on field 'cosif': rejected value []; codes [typeMismatch.cosifEntity.cosif,typeMismatch.cosif,typeMismatch.br.com.netsoft.desif.model.desif.federal.CosifEntity,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [cosifEntity.cosif,cosif]; arguments []; default message [cosif]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'br.com.netsoft.desif.model.desif.federal.CosifEntity' for property 'cosif'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [br.com.netsoft.desif.model.desif.federal.CosifEntity] for property 'cosif': no matching editors or conversion strategy found] O jsp está assim para este campo: <select class="chosen-select form-control" id="cosif" name="cosif" data-placeholder="Selecione uma COSIF"> <option value=""></option> <c:forEach var="contaSuperior" items="${listaContaSuperior}"> <option value="${contaSuperior.id}"> ${contaSuperior.numeroNome}</option> </c:forEach> </select> O que pode ser ?
  4. Baixei o Spring MVC pelo Spring Tool Suite do link http://spring.io/tools/sts. Quando clico para executar o STS.exe, ele mostra o erro: http://prntscr.com/dvhkpx Clico em OK e não acontece nada. Falta alguma configuração ?
×
×
  • Criar Novo...