O cen�rio � o seguinte:
O usu�rio acaba de se logar e logo ap�s visualiza a lista de clientes. Tudo bem.
Clica no bot�o Adicionar novo cliente e chama a p�gina com os campos para serem preenchidos. Tudo bem.
Clica no bot�o Gravar e retorna novamente pra lista de clientes com o novo cliente na tabela. Tudo bem.
 
Mas olha s�: no browse, continua com a URL /AddCliente.do, mas o usu�rio est� visualizado a lista dos clientes. O que deveria est� a� era /ClienteList.do, CERTO !!!! Como est� aparecendo o /AddCliente.do, se o usu�rio teclar F5(Refresh na p�gina) o sistema ir� incluir novamente o �ltimo cliente. Pronto ! A� est� meu problema.
 
Ser� que fui claro ? Mas abaixo est� alguns fragmentos:
 
1) Esta � a sequ�ncia(que extra� do meu log.txt) de execu��o das minhas Actions em quest�o:
 
LoginAction -->> usuario logado.
ClienteListAction.execute -->> lista montada(objeto serializado) dos clientes.
ClienteListAction -->> forward para success, path=/clientelist.jsp
AddClienteAction.execute -->> novo cliente inserido.
AddClienteAction -->> forward para success, path=/ClienteList.do
ClienteListAction.execute -->> lista montada(objeto serializado) dos clientes.
ClienteListAction -->> forward para success, path=/clientelist.jsp
 
2) O mapeamento das minhas principais actions:
 
<action-mappings>
  <action path="/Login" type="br.com.unilet.actions.authentication.LoginAction" validate="true" input="/login.jsp" name="loginForm" scope="request">
   <forward name="success" path="/principal.jsp" />
   <forward name="login" path="/login.jsp" />
  </action>

  <action path="/ClienteList" type="br.com.unilet.actions.cliente.ClienteListAction" scope="request"><set-property property="loginRequired" value="true" />
   <forward name="success" path="/clientelist.jsp" />
  </action>

  <action path="/GetCliente"
    type="br.com.unilet.actions.cliente.GetClienteAction"
    name="clienteForm"
    scope="request"
    validate="false">
    <forward name="success" path="/editcliente.jsp" redirect="false" />
  </action>
 
  <action path="/EditCliente"
    type="br.com.unilet.actions.cliente.EditClienteAction"
    name="clienteForm" scope="request" input="/editcliente.jsp">
    <set-property property="loginRequired" value="true" />
    <forward name="success" path="/ClienteList.do" redirect="false" />
    <forward name="login" path="/Login.do" redirect="false" />
  </action>
 
<action path="/AddCliente"
    type="br.com.unilet.actions.cliente.AddClienteAction"
    name="clienteForm" input="/addcliente.jsp" scope="request">
    <set-property property="loginRequired" value="true" />
    <forward name="success" path="/ClienteList.do" redirect="false" />
    <forward name="login" path="/Login.do" redirect="false" />
</action>
 
<action path="/DelCliente"
    type="br.com.unilet.actions.cliente.DelClienteAction">
    <set-property property="loginRequired" value="true" />
    <forward name="success" path="/ClienteList.do" redirect="false" />
    <forward name="login" path="/Login.do" redirect="false" />
</action>
</action-mappings>
   
3) Meu log.txt S� com chamadas em quest�o.
 
2003-12-15 08:57:53 WebappLoader[/labweb]: Deploying class repositories to work directory C:\jakarta-tomcat 4.1.29\work\Standalone\localhost\labweb
2003-12-15 08:57:53 WebappLoader[/labweb]: Deploy class files /WEB-INF/classes to D:\java\labweb\web\WEB-INF\classes
2003-12-15 08:57:53 WebappLoader[/labweb]: Deploy JAR /WEB-INF/lib/cf_struts-files.jar to D:\java\labweb\web\WEB-INF\lib\cf_struts-files.jar
2003-12-15 08:57:53 WebappLoader[/labweb]: Deploy JAR /WEB-INF/lib/classes12.jar to D:\java\labweb\web\WEB-INF\lib\classes12.jar
2003-12-15 08:57:53 WebappLoader[/labweb]: Deploy JAR /WEB-INF/lib/commons-beanutils.jar to D:\java\labweb\web\WEB-INF\lib\commons-beanutils.jar
2003-12-15 08:57:53 WebappLoader[/labweb]: Deploy JAR /WEB-INF/lib/commons-collections.jar to D:\java\labweb\web\WEB-INF\lib\commons-collections.jar
2003-12-15 08:57:53 WebappLoader[/labweb]: Deploy JAR /WEB-INF/lib/commons-digester.jar to D:\java\labweb\web\WEB-INF\lib\commons-digester.jar
2003-12-15 08:57:53 WebappLoader[/labweb]: Deploy JAR /WEB-INF/lib/commons-fileupload.jar to D:\java\labweb\web\WEB-INF\lib\commons-fileupload.jar
2003-12-15 08:57:53 WebappLoader[/labweb]: Deploy JAR /WEB-INF/lib/commons-lang.jar to D:\java\labweb\web\WEB-INF\lib\commons-lang.jar
2003-12-15 08:57:53 WebappLoader[/labweb]: Deploy JAR /WEB-INF/lib/commons-logging.jar to D:\java\labweb\web\WEB-INF\lib\commons-logging.jar
2003-12-15 08:57:54 WebappLoader[/labweb]: Deploy JAR /WEB-INF/lib/commons-validator.jar to D:\java\labweb\web\WEB-INF\lib\commons-validator.jar
2003-12-15 08:57:54 WebappLoader[/labweb]: Deploy JAR /WEB-INF/lib/struts-legacy.jar to D:\java\labweb\web\WEB-INF\lib\struts-legacy.jar
2003-12-15 08:57:54 WebappLoader[/labweb]: Deploy JAR /WEB-INF/lib/struts.jar to D:\java\labweb\web\WEB-INF\lib\struts.jar
2003-12-15 08:57:54 WebappLoader[/labweb]: Reloading checks are enabled for this Context
2003-12-15 08:57:55 StandardManager[/labweb]: Seeding random number generator class java.security.SecureRandom
2003-12-15 08:57:55 StandardManager[/labweb]: Seeding of random number generator has been completed
2003-12-15 08:58:02 15/12/2003 08:57:56 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
15/12/2003 08:57:56 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
15/12/2003 08:57:57 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='br.com.unilet.ApplicationResources', returnNull=true
15/12/2003 08:57:57 org.apache.struts.legacy.GenericDataSource createConnection
INFO:    createConnection()
 
2003-12-15 08:58:02 StandardWrapper[/labweb:default]: Loading container servlet default
2003-12-15 08:58:02 StandardWrapper[/labweb:invoker]: Loading container servlet invoker
2003-12-15 08:59:07 StandardContext[/labweb]: 15/12/2003 08:59:06 org.apache.struts.legacy.GenericDataSource getConnection
INFO:   getConnection()
15/12/2003 08:59:06 org.apache.struts.legacy.GenericDataSource getConnection
INFO:    Check for timeout, activeCount=1, useCount=0
15/12/2003 08:59:06 org.apache.struts.legacy.GenericDataSource getConnection
INFO:    Found available connection
15/12/2003 08:59:06 org.apache.struts.legacy.GenericDataSource getConnection
INFO:    Return allocated connection, activeCount=1, useCount=1
15/12/2003 08:59:07 org.apache.struts.legacy.GenericDataSource returnConnection
INFO:   releaseConnection(), activeCount=1, useCount=0
 
LoginAction -->> usuario logado.
15/12/2003 08:59:07 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.bean.LocalStrings', returnNull=true
15/12/2003 08:59:07 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
 
2003-12-15 08:59:27 StandardContext[/labweb]: 15/12/2003 08:59:27 org.apache.struts.legacy.GenericDataSource getConnection
INFO:   getConnection()
15/12/2003 08:59:27 org.apache.struts.legacy.GenericDataSource getConnection
INFO:    Check for timeout, activeCount=1, useCount=0
15/12/2003 08:59:27 org.apache.struts.legacy.GenericDataSource getConnection
INFO:    Found available connection
15/12/2003 08:59:27 org.apache.struts.legacy.GenericDataSource getConnection
INFO:    Return allocated connection, activeCount=1, useCount=1
 
ClienteListAction.execute -->> lista montada(objeto serializado) dos clientes.
15/12/2003 08:59:27 org.apache.struts.legacy.GenericDataSource returnConnection
INFO:   releaseConnection(), activeCount=1, useCount=0
 
ClienteListAction -->> forward para success, path=/clientelist.jsp
15/12/2003 08:59:27 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
15/12/2003 08:59:27 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
15/12/2003 08:59:27 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
15/12/2003 08:59:27 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.bean.LocalStrings', returnNull=true
 
2003-12-15 09:00:19 StandardContext[/labweb]: 15/12/2003 09:00:18 org.apache.struts.legacy.GenericDataSource getConnection
INFO:   getConnection()
15/12/2003 09:00:18 org.apache.struts.legacy.GenericDataSource getConnection
INFO:    Check for timeout, activeCount=1, useCount=0
15/12/2003 09:00:18 org.apache.struts.legacy.GenericDataSource getConnection
INFO:    Found available connection
15/12/2003 09:00:18 org.apache.struts.legacy.GenericDataSource getConnection
INFO:    Return allocated connection, activeCount=1, useCount=1
 
AddClienteAction.execute -->> novo cliente inserido.
15/12/2003 09:00:18 org.apache.struts.legacy.GenericDataSource returnConnection
INFO:   releaseConnection(), activeCount=1, useCount=0
 
AddClienteAction -->> forward para success, path=/ClienteList.do
15/12/2003 09:00:18 org.apache.struts.legacy.GenericDataSource getConnection
INFO:   getConnection()
15/12/2003 09:00:18 org.apache.struts.legacy.GenericDataSource getConnection
INFO:    Check for timeout, activeCount=1, useCount=0
15/12/2003 09:00:18 org.apache.struts.legacy.GenericDataSource getConnection
INFO:    Found available connection
15/12/2003 09:00:18 org.apache.struts.legacy.GenericDataSource getConnection
INFO:    Return allocated connection, activeCount=1, useCount=1
 
ClienteListAction.execute -->> lista montada(objeto serializado) dos clientes.
15/12/2003 09:00:19 org.apache.struts.legacy.GenericDataSource returnConnection
INFO:   releaseConnection(), activeCount=1, useCount=0
 
ClienteListAction -->> forward para success, path=/clientelist.jsp
 
Obrigado a todos !!!!
"As classes lutam, algumas triunfam, outras s�o eliminadas"
Mao Tse Tung
 
Jairo Soares
Sun Certified Programmer Java 2 Platform 1.4
[EMAIL PROTECTED]

Responder a