Erro Struts

Alguem poderia me dizer erro e esse.


No input attribute for mapping path /struts-test

description The server encountered an internal error (No input attribute for mapping path /struts-test) that prevented it from fulfilling this request

arquivo struts-config

<?xml version="1.0" encoding="ISO-8859-1" ?>

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

<!--
     This is a blank Struts configuration file with an example
     welcome action/page and other commented sample elements.

     Tiles and the Struts Validator are configured using the factory defaults
     and are ready-to-use.

     NOTE: If you have a generator tool to create the corresponding Java classes
     for you, you could include the details in the "form-bean" declarations.
     Otherwise, you would only define the "form-bean" element itself, with the
     corresponding "name" and "type" attributes, as shown here.
-->


<struts-config>

<!-- ============================================ Data Source Configuration -->
<!--
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
    <set-property
      property="driverClassName"
      value="org.postgresql.Driver" />
    <set-property
      property="url"
      value="jdbc:postgresql://localhost/mydatabase" />
    <set-property
      property="username"
      value="me" />
    <set-property
      property="password"
      value="test" />
    <set-property
      property="maxActive"
      value="10" />
    <set-property
      property="maxWait"
      value="5000" />
    <set-property
      property="defaultAutoCommit"
      value="false" />
    <set-property
      property="defaultReadOnly"
      value="false" />
    <set-property
      property="validationQuery"
      value="SELECT COUNT(*) FROM market" />
</data-source>
</data-sources>
-->

<!-- ================================================ Form Bean Definitions -->

    <form-beans>
    	<form-bean name="cadastrarUsuarioForm" type="jm.forms.CadastrarUsuarioForm" />
    <!-- sample form bean descriptor for an ActionForm
        <form-bean
            name="inputForm"
            type="app.InputForm"/>
    end sample -->

    <!-- sample form bean descriptor for a DynaActionForm
        <form-bean
            name="logonForm"
            type="org.apache.struts.action.DynaActionForm">
            <form-property
                name="username"
                type="java.lang.String"/>
            <form-property
                name="password"
                type="java.lang.String"/>
       </form-bean>
    end sample -->
    </form-beans>


<!-- ========================================= Global Exception Definitions -->

    <global-exceptions>
        <!-- sample exception handler
        <exception
            key="expired.password"
            type="app.ExpiredPasswordException"
            path="/changePassword.jsp"/>
        end sample -->
    </global-exceptions>


<!-- =========================================== Global Forward Definitions -->

    <global-forwards>
        <!-- Default forward to "Welcome" action -->
        <!-- Demonstrates using index.jsp to forward -->
        <forward
            name="welcome"
            path="/Welcome.do"/>
    </global-forwards>


<!-- =========================================== Action Mapping Definitions -->

    <action-mappings>
            <!-- Default "Welcome" action -->
            <!-- Forwards to Welcome.jsp -->
        
        <action path="/struts-test" type="jm.forms.CadastrarUsuarioAction" name="cadastrarUsuarioForm" />
        
        <action
            path="/Welcome"
            forward="/pages/Welcome.jsp"/>
															
    <!-- sample input and input submit actions

        <action
            path="/Input"
            type="org.apache.struts.actions.ForwardAction"
            parameter="/pages/Input.jsp"/>

        <action
            path="/InputSubmit"
            type="app.InputAction"
            name="inputForm"
            scope="request"
            validate="true"
            input="/pages/Input.jsp"/>

            <action
                path="/edit*"
                type="app.Edit{1}Action"
                name="inputForm"
                scope="request"
                validate="true"
                input="/pages/Edit{1}.jsp"/>

    end samples -->
    
    </action-mappings>


<!-- ============================================= Controller Configuration -->

    <controller
       processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>


<!-- ======================================== Message Resources Definitions -->

    <message-resources parameter="MessageResources" />


<!-- =============================================== Plug Ins Configuration -->

  <!-- ======================================================= 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" >

      <!-- Path to XML definition file -->
      <set-property property="definitions-config"
                       value="/WEB-INF/tiles-defs.xml" />
      <!-- Set Module-awareness to true -->
      <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>

arquivo validation.xml


<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE form-validation PUBLIC
          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
          "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">

<form-validation>

<!--
     This is a minimal Validator form file with a couple of examples.
-->

    <global>

        <!-- An example global constant
        <constant>
            <constant-name>postalCode</constant-name>
            <constant-value>^\d{5}\d*$</constant-value>
        </constant>
        end example-->

    </global>

    <formset>

        <!-- An example form -->
        <form name="logonForm">
            <field
                property="username"
                depends="required">
                    <arg key="logonForm.username"/>
            </field>
            <field
                property="password"
                depends="required,mask">
                    <arg key="logonForm.password"/>
                    <var>
                        <var-name>mask</var-name>
                        <var-value>^[0-9a-zA-Z]*$</var-value>
                    </var>
            </field>
        </form>

    </formset>

    <!-- An example formset for another locale -->
    <formset language="fr">

        <constant>
            <constant-name>postalCode</constant-name>
            <constant-value>^[0-9a-zA-Z]*$</constant-value>
        </constant>

        <!-- An example form -->
        <form name="logonForm">
            <field
                property="username"
                depends="required">
                    <arg key="logonForm.username"/>
            </field>
            <field
                property="password"
                depends="required,mask">
                    <arg key="logonForm.password"/>
                    <var>
                        <var-name>mask</var-name>
                        <var-value>^[0-9a-zA-Z]*$</var-value>
                    </var>
            </field>
        </form>

   </formset>
      
	<formset>
		<form name="cadastrarUsuarioForm">
			
			<field property="nome" depends="required">
				<arg0 key="cadastrarUsuarioForm.nome" />
			</field>
			
			<field property="telefone" depends="required,mask">
				<arg0 key="cadastrarUsuarioForm.telefone" />
				<var>
					<var-name>mask</var-name>
					<var-value>^\d{3,4}-\d{4}$</var-value>
				</var>
			</field>
			
			<field property="login" depends="required,mask">
				<arg0 key="cadastrarUsuarioForm.login" />
				<var>
					<var-name>mask</var-name>
					<var-value>^[a-zA-Z]*$</var-value>
				</var>
			</field>
			
			<field property="senha" depends="required">
				<arg0 key="cadastrarUsuarioForm.nome" />
			</field>
			
			<field property="email" depends="required,email">
				<arg0 key="cadastrarUsuarioForm.email" />
			</field>
															
		</form>			
	</formset>
	
</form-validation>

Em que momento aparece o erro? Na inicialização? Ao tentar executar a página?

quando clico no botao da pag jsp


&lt;%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %&gt;
&lt;%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %&gt;
&lt;%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %&gt;

&lt;html:form action="struts-test.do"&gt;
	
	Usuario &lt;html:text property="nome"/&gt;
	Email &lt;html:text property="email"/&gt; 
	Endereço &lt;html:text property="endereco"/&gt; 
	Telefone &lt;html:text property="telefone"/&gt; 
	Login &lt;html:text property="login"/&gt; 
	Senha &lt;html:text property="senha"/&gt; 
	
	&lt;html:submit value="cadastrar"/&gt;
	
	&lt;logic:messagesPresent&gt;
		&lt;bean:message key="errors.header" /&gt;
		<ul>
		&lt;html:messages id="error"&gt;
			<li>&lt;bean:write name="error" /&gt;<li>
		&lt;/html:messages&gt;
		</ul>&lt;hr&gt;
	&lt;/logic:messagesPresent&gt;
	
		
&lt;/html:form&gt;

inclua no action mappings a opção scope=“request”

ex .

&lt;action path="/action/teste" type="mainservlet.RegisterAction3" name="userFormBean" scope="request"&gt;

ja coloquei, mas n da certo. vc n tem uma aplicação básica como um formulario com dois campos tipo: nome e telefone. Que use o Validator para validar as entradas e tenha todos os arquivos de configuração p mim poder colocar p rodar aqui e ver o q estou errando na minha aplicação.

Se alguem tiver mandem p mim por favor.

Cara … eu declaro minhas actions mapping assim …
ex.

&lt;action-mappings&gt;
     &lt;action path="/action/teste" type="mainservlet.RegisterAction3" name="userFormBean" scope="request"&gt;
            &lt;forward name="sucess" path"/WEB-INF/results/result4.jsp"/&gt;
     &lt;/action&gt;
&lt;/action-mappings&gt;

é a unica diferenca que estou “vendo” pode ser q eu esteja errado.

outra coisa …

veja se os inputs estao corretos
input="/pages/Input.jsp"/>

pra q esaa tag input?

esse codigo é da java magazine ? qual numero ?

esse daí não e o da javamagazine, mas tentei rodar o codigo da edição 7, aquele q fala de validação com struts, mas n consegui. eu acho q estou me perdendo nesses arquivos de configurações. nos caminhos q tenho q colocar tipo &lt;html:form action="carlos.do"&gt; e os path no struts-config. Tentei baixar o código da edição 7, mas o arquivo ta conrropido.

Tenta colocar a definição da tua action com validate=“false”:

<action path="/struts-test" type="jm.forms.CadastrarUsuarioAction" name="cadastrarUsuarioForm" validate="false" />

Ou entao, caso for necessária a validação, defina o atributo input para sua action e defina validate=“true”:

<action path="/struts-test" type="jm.forms.CadastrarUsuarioAction" name="cadastrarUsuarioForm" validate="true" input="/minhaJspQueExibeOsErros.jsp" />

Quando o seu form nao passa na validação ele retorna para esse atributo (input).

Lembrando apenas que ele ainda nem foi na sua action.