FranklinPJ 25 de abr. de 2006
Olá,
cola o seu dwr.xml aqui para podermos ajudar.
Você tem certeza que está usando o creator=“spring” ?
joaodavidPJ 25 de abr. de 2006
OK
aproveitando segue todos os arquivos de configuração:
web.xml
& lt ; ? xml version = "1.0" encoding = "UTF-8" ? & gt ;
& lt ; web - app id = "WebApp_ID" version = "2.4" xmlns = "http://java.sun.com/xml/ns/j2ee" xmlns & #58;xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
& lt ; display - name & gt ; ExemploSpring & lt ; / display - name & gt ;
& lt ; servlet & gt ;
& lt ; servlet - name & gt ; dwr - invoker & lt ; / servlet - name & gt ;
& lt ; servlet - class & gt ; uk . ltd . getahead . dwr . DWRServlet & lt ; / servlet - class & gt ;
& lt ; init - param & gt ;
& lt ; param - name & gt ; debug & lt ; / param - name & gt ;
& lt ; param - value & gt ; true & lt ; / param - value & gt ;
& lt ; / init - param & gt ;
& lt ; / servlet & gt ;
& lt ; servlet - mapping & gt ;
& lt ; servlet - name & gt ; dwr - invoker & lt ; / servlet - name & gt ;
& lt ; url - pattern & gt ; / dwr /*& lt ; / url - pattern & gt ;
& lt ; / servlet - mapping & gt ;
& lt ; servlet & gt ;
& lt ; servlet - name & gt ; faculdade & lt ; / servlet - name & gt ;
& lt ; servlet - class & gt ; org . springframework . web . servlet . DispatcherServlet & lt ; / servlet - class & gt ;
& lt ; load - on - startup & gt ; 1 & lt ; / load - on - startup & gt ;
& lt ; / servlet & gt ;
& lt ; servlet - mapping & gt ;
& lt ; servlet - name & gt ; faculdade & lt ; / servlet - name & gt ;
& lt ; url - pattern & gt ; *. serpro & lt ; / url - pattern & gt ;
& lt ; / servlet - mapping & gt ;
& lt ; welcome - file - list & gt ;
& lt ; welcome - file & gt ; index . html & lt ; / welcome - file & gt ;
& lt ; welcome - file & gt ; index . htm & lt ; / welcome - file & gt ;
& lt ; welcome - file & gt ; index . jsp & lt ; / welcome - file & gt ;
& lt ; welcome - file & gt ; default . html & lt ; / welcome - file & gt ;
& lt ; welcome - file & gt ; default . htm & lt ; / welcome - file & gt ;
& lt ; welcome - file & gt ; default . jsp & lt ; / welcome - file & gt ;
& lt ; / welcome - file - list & gt ;
& lt ; filter & gt ;
& lt ; filter - name & gt ; filter & lt ; / filter - name & gt ;
& lt ; filter - class & gt ;
org . springframework . web . filter . CharacterEncodingFilter
& lt ; / filter - class & gt ;
& lt ; init - param & gt ;
& lt ; param - name & gt ; encoding & lt ; / param - name & gt ;
& lt ; param - value & gt ; utf - 8 & lt ; / param - value & gt ;
& lt ; / init - param & gt ;
& lt ; / filter & gt ;
& lt ; filter - mapping & gt ;
& lt ; filter - name & gt ; filter & lt ; / filter - name & gt ;
& lt ; url - pattern & gt ; /*& lt ; / url - pattern & gt ;
& lt ; / filter - mapping & gt ;
& lt ; context - param & gt ;
& lt ; param - name & gt ; contextConfigLocation & lt ; / param - name & gt ;
& lt ; param - value & gt ; / WEB - INF / faculdade - servlet . xml & lt ; / param - value & gt ;
& lt ; / context - param & gt ;
& lt ; listener & gt ;
& lt ; listener - class & gt ;
org . springframework . web . context . ContextLoaderListener
& lt ; / listener - class & gt ;
& lt ; / listener & gt ;
& lt ; / web - app & gt ;
joaodavidPJ 25 de abr. de 2006
dwr.xml
Abaixo “javascript” esta escrito com “z” “javazscript”, somente para o forum aceitar o post.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<dwr>
<allow>
<convert converter="bean" match="br.gov.serpro.modelo.pojo.Aluno"/>
<create creator="spring" javazcript="teste">
<param name="beanName" value="alunoServicoImpl" />
</create>
</allow>
</dwr>
joaodavidPJ 25 de abr. de 2006
faculdade-servlet.xml
& lt ;? xml version = "1.0" encoding = "UTF-8" ? & gt ;
& lt ;! DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd" & gt ;
& lt ; beans & gt ;
& lt ; bean id = "simpleUrlHandlerMapping"
class = "org.springframework.web.servlet.handler.SimpleUrlHandlerMapping" & gt ;
& lt ; property name = "mappings" & gt ;
& lt ; props & gt ;
& lt ; prop key = "/alunoListagem.serpro" & gt ; alunoListagem & lt ; / prop & gt ;
& lt ; prop key = "/alunoListagemPorCurso.serpro*" & gt ; alunoListagem & lt ; / prop & gt ;
& lt ; prop key = "/alunoFormulario.serpro*" & gt ; alunoFormulario & lt ; / prop & gt ;
& lt ; prop key = "/cursoListagem.serpro" & gt ; cursoListagem & lt ; / prop & gt ;
& lt ; prop key = "/cursoFormulario.serpro*" & gt ; cursoFormulario & lt ; / prop & gt ;
& lt ; / props & gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ; bean id = "internalResourceViewResolver" class = "org.springframework.web.servlet.view.InternalResourceViewResolver" & gt ;
& lt ; property name = "viewClass" & gt ;
& lt ; value & gt ; org . springframework . web . servlet . view . JstlView & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; property name = "prefix" & gt ;
& lt ; value & gt ; / WEB - INF / visao /& lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; property name = "suffix" & gt ;
& lt ; value & gt ;. jsp & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ;! -- ########## i18n ########## --& gt ;
& lt ; bean id = "messageSource" class = "org.springframework.context.support.ResourceBundleMessageSource" & gt ;
& lt ; property name = "basename" & gt ;
& lt ; value & gt ; / msg / mensagens & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ;! -- ########## CONTROLE - ALUNO ########## --& gt ;
& lt ; bean id = "alunoFormulario" class = "br.gov.serpro.controle.aluno.AlunoFormulario" & gt ;
& lt ; property name = "alunoServico" & gt ;
& lt ; ref bean = "alunoServicoImpl" /& gt ;
& lt ; / property & gt ;
& lt ; property name = "cursoServico" & gt ;
& lt ; ref bean = "cursoServicoImpl" /& gt ;
& lt ; / property & gt ;
& lt ; property name = "validator" & gt ;
& lt ; ref bean = "alunoValidacao" /& gt ;
& lt ; / property & gt ;
& lt ; property name = "commandName" & gt ;
& lt ; value & gt ; aluno & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; property name = "commandClass" & gt ;
& lt ; value & gt ; br . gov . serpro . modelo . pojo . Aluno & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; property name = "sessionForm" & gt ;
& lt ; value & gt ; true & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; property name = "formView" & gt ;
& lt ; value & gt ; alunoFormulario & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; property name = "successView" & gt ;
& lt ; value & gt ; redirect & # 58 ; alunoListagem . serpro & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ; bean id = "alunoValidacao" class = "br.gov.serpro.controle.aluno.AlunoValidacao" /& gt ;
& lt ; bean id = "alunoListagem" class = "br.gov.serpro.controle.aluno.AlunoListagem" & gt ;
& lt ; property name = "alunoServico" & gt ;
& lt ; ref bean = "alunoServicoImpl" /& gt ;
& lt ; / property & gt ;
& lt ; property name = "cursoServico" & gt ;
& lt ; ref bean = "cursoServicoImpl" /& gt ;
& lt ; / property & gt ;
& lt ; property name = "methodNameResolver" & gt ;
& lt ; ref bean = "alunoListagemMethodNameResolver" /& gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ; bean id = "alunoListagemMethodNameResolver"
class = "org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver" & gt ;
& lt ; property name = "mappings" & gt ;
& lt ; props & gt ;
& lt ; prop key = "/alunoListagem.serpro" & gt ;
handleAlunoListagem
& lt ; / prop & gt ;
& lt ; prop key = "/alunoListagemPorCurso.serpro*" & gt ;
handleAlunoListagemPorCurso
& lt ; / prop & gt ;
& lt ; / props & gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ;! -- ########## CONTROLE - CURSO ########## --& gt ;
& lt ; bean id = "cursoFormulario" class = "br.gov.serpro.controle.curso.CursoFormulario" & gt ;
& lt ; property name = "cursoServico" & gt ;
& lt ; ref bean = "cursoServicoImpl" /& gt ;
& lt ; / property & gt ;
& lt ; property name = "validator" & gt ;
& lt ; ref bean = "cursoValidacao" /& gt ;
& lt ; / property & gt ;
& lt ; property name = "commandName" & gt ;
& lt ; value & gt ; curso & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; property name = "commandClass" & gt ;
& lt ; value & gt ; br . gov . serpro . modelo . pojo . Curso & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; property name = "sessionForm" & gt ;
& lt ; value & gt ; true & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; property name = "formView" & gt ;
& lt ; value & gt ; cursoFormulario & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; property name = "successView" & gt ;
& lt ; value & gt ; redirect & # 58 ; cursoListagem . serpro & lt ; / value & gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ; bean id = "cursoValidacao" class = "br.gov.serpro.controle.curso.CursoValidacao" /& gt ;
& lt ; bean id = "cursoListagem" class = "br.gov.serpro.controle.curso.CursoListagem" & gt ;
& lt ; property name = "cursoServico" & gt ;
& lt ; ref bean = "cursoServicoImpl" /& gt ;
& lt ; / property & gt ;
& lt ; property name = "methodNameResolver" & gt ;
& lt ; ref bean = "cursoListagemMethodNameResolver" /& gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ; bean id = "cursoListagemMethodNameResolver"
class = "org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver" & gt ;
& lt ; property name = "mappings" & gt ;
& lt ; props & gt ;
& lt ; prop key = "/cursoListagem.serpro" & gt ;
handleCursoListagem
& lt ; / prop & gt ;
& lt ; / props & gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ;! -- ########## MODELO - SERVICO ########## --& gt ;
& lt ; bean id = "cursoServicoImpl"
class = "br.gov.serpro.modelo.servico.CursoServicoImpl" & gt ;
& lt ; property name = "cursoDao" & gt ;
& lt ; ref bean = "cursoDaoHibernate" /& gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ; bean id = "alunoServicoImpl"
class = "br.gov.serpro.modelo.servico.AlunoServicoImpl" & gt ;
& lt ; property name = "alunoDao" & gt ;
& lt ; ref bean = "alunoDaoHibernate" /& gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ;! -- ########## MODELO - DAO ########## --& gt ;
& lt ; bean id = "alunoDaoHibernate" class = "br.gov.serpro.modelo.dao.AlunoDaoHibernate" & gt ;
& lt ; property name = "hibernateTemplate" & gt ;
& lt ; ref bean = "hibernateTemplate" /& gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ; bean id = "cursoDaoHibernate" class = "br.gov.serpro.modelo.dao.CursoDaoHibernate" & gt ;
& lt ; property name = "hibernateTemplate" & gt ;
& lt ; ref bean = "hibernateTemplate" /& gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ; bean id = "hibernateTemplate"
class = "org.springframework.orm.hibernate3.HibernateTemplate" & gt ;
& lt ; property name = "sessionFactory" & gt ;
& lt ; ref bean = "sessionFactory" /& gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ; bean id = "sessionFactory"
class = "org.springframework.orm.hibernate3.LocalSessionFactoryBean" & gt ;
& lt ; property name = "dataSource" & gt ;
& lt ; ref bean = "dataSource" /& gt ;
& lt ; / property & gt ;
& lt ; property name = "hibernateProperties" & gt ;
& lt ; props & gt ;
& lt ; prop key = "hibernate.dialect" & gt ;
org . hibernate . dialect . MySQLDialect
& lt ; / prop & gt ;
& lt ; / props & gt ;
& lt ; / property & gt ;
& lt ; property name = "mappingLocations" & gt ;
& lt ; list & gt ;
& lt ; value & gt ; / WEB - INF / hbm / Aluno . hbm . xml & lt ; / value & gt ;
& lt ; value & gt ; / WEB - INF / hbm / Curso . hbm . xml & lt ; / value & gt ;
& lt ; / list & gt ;
& lt ; / property & gt ;
& lt ; / bean & gt ;
& lt ; bean id = "dataSource"
class = "org.springframework.jdbc.datasource.DriverManagerDataSource" & gt ;
& lt ; property name = "driverClassName" value = "com.mysql.jdbc.Driver" /& gt ;
& lt ; property name = "url"
value = "jdbc:mysql://localhost/faculdade?autoReconnect=true" /& gt ;
& lt ; property name = "username" value = "root" /& gt ;
& lt ; property name = "password" value = "root" /& gt ;
& lt ; / bean & gt ;
& lt ; / beans & gt ;
joaodavidPJ 3 de mai. de 2006