Problemas com struts

6 respostas
almarti

alguem pode me dizer porque ocorre este erro?

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: Exception in JSP: /lancamentos/ocorrencia.jsp:9

6: 
7: </head>   
8: <body>   
9: <html:form action="cadastrarOcorrencia" focus="nome">   
10: <table>   
11: <tr>   
12:     <td >Nome:</td>

6 Respostas

ercardoso

Você mapeou o ActionForm ? se puder disponibilizar o struts-config irah ajudar!

C

6: 7: </head> 8: <body> 9: <html:form action="cadastrarOcorrencia" focus="nome"> 10: <table> 11: <tr> 12: <td >Nome:</td>

Cara ao meu ver o problema pode ser em dois lugares:

1º Deixar a linha 9 assim:

<html:form action="/cadastrarOcorrencias" focus="nome">

Salve e reinicie o Tomcat…

2º Se o erro ocorreu novamente, o problema está no focus, experimento deixar o focus sem nada.

focus=""

Abraços

almarti

segue código de struts-config

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">


<struts-config>
    <form-beans>
      <form-bean name="OcorrenciaForm" type="com.celulajava.palestradwr.bean.OcorrenciaForm"/>    
    </form-beans>
    
    <global-exceptions>
    
    </global-exceptions>

    <global-forwards>
        <forward name="welcome"  path="/Welcome.do"/>
    </global-forwards>

    <action-mappings>
        
        
        <action path="/iniciarOcorrenciaForm" forward="/lancamentos/ocorrencia.jsp"/>   
  
        <action path="/cadastrarOcorrencia"  
            type="com.celulajava.palestradwr.bean.CadastrarOcorrenciaAction"  
            name="ocorrenciaForm"  
            scope="request"  
            validate="false"  
            >   
            <forward   
                    name="sucesso"  
                    path="/confirmacao.jsp"/>   
        </action>
        
    </action-mappings>
    
    <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>

    <message-resources parameter="com/myapp/struts/ApplicationResource"/>    
    
    <!-- ========================= Tiles plugin ===============================-->
    <!--
    This plugin initialize Tiles definition factory. This later can takes some
    parameters explained here after. The plugin first read parameters from
    web.xml, thenoverload them with parameters defined here. All parameters
    are optional.
    The plugin should be declared in each struts-config file.
    - definitions-config: (optional)
    Specify configuration file names. There can be several comma
    separated file names (default: ?? )
    - moduleAware: (optional - struts1.1)
    Specify if the Tiles definition factory is module aware. If true
    (default), there will be one factory for each Struts module.
    If false, there will be one common factory for all module. In this
    later case, it is still needed to declare one plugin per module.
    The factory will be initialized with parameters found in the first
    initialized plugin (generally the one associated with the default
    module).
    true : One factory per module. (default)
    false : one single shared factory for all modules
    - definitions-parser-validate: (optional)
    Specify if xml parser should validate the Tiles configuration file.
    true : validate. DTD should be specified in file header (default)
    false : no validation

    Paths found in Tiles definitions are relative to the main context.
    -->
    <plug-in className="org.apache.struts.tiles.TilesPlugin" >
        <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />      
        <set-property property="moduleAware" value="true" />
    </plug-in>
    
    <!-- ========================= Validator plugin ================================= -->
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
        <set-property
            property="pathnames"
            value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
    </plug-in>
  
    
</struts-config>

Fiz a alteração sugerido por Caca, mas o erro permaneceu.

almarti

Alguem já passou por este problema?

vivi_grieco

declara os elementos do teu form no teu struts-config.
exemplo:

<form-bean name="loginForm" type="br.inf.portalfiscal.nfe.web.forms.LoginForm">
	<form-property name="login" type="java.lang.String" />
	<form-property name="senha" type="java.lang.String" />
</form-bean>
ercardoso

name=“ocorrenciaForm” seu ActionForm eh OcorrenciaForm

Criado 5 de fevereiro de 2007
Ultima resposta 9 de fev. de 2007
Respostas 6
Participantes 4