Taglib do struts

2 respostas
V
Fiz uma pagina jsp com o struts, descompactei o arquivo struts-blank.war em um diretório após criar minhas subclasses de ActionForm e Action criei o seguinte jsp
<%@taglib uri="/tags/struts-html" prefix="html" %>
<%@taglib uri="/tags/struts-bean " prifix="bean" %>

<html>
<head>
    <title>User Registration</title>
</head>
<body>
    <h1>User Registration</h1>
    <html:errors/>
    
    <table>
        <html:form action="userRegistration">
            <tr>
                <td>
                    <bean:message key="userRegistration.firstName"/>
                </td>
                <td>
                    <html:text property="firstName"/>
                </td>
            </tr>
            <tr>
                <td>
                    <bean:message key="userRegistration.lastName"/>
                </td>
                <td>
                    <html:text property="lastName"/>
                </td>
            </tr>
            <tr>
                <td>
                    <bean:message key="userRegistration.userName"/>
                </td>
                <td>
                    <html:text property="userName"/>
                </td>
            </tr>
            <tr>
                <td>
                    <bean:message key="userRegistration.email"/>
                </td>
                <td>
                    <html:text property="email"/>
                </td>
            </tr>
            <tr>
                <td>
                    <bean:message key="userRegistration.phone"/>
                </td>
                <td>
                    <html:text property="phone"/>
                </td>
            </tr>
            <tr>
                <td>
                    <bean:message key="userRegistration.fax"/>
                </td>
                <td>
                    <html:text property="fax"/>
                </td>
            </tr>
            <tr>
                <td>
                    <bean:message key="userRegistration.password"/>
                </td>
                <td>
                    <html:text property="password"/>
                </td>
            </tr>
            <tr>
                <td>
                    <bean:message key="userRegistration.password"/>
                </td>
                <td>
                    <html:text property="passwordCheck"/>
                </td>
            </tr>
            <tr>
                <td>
                    <html:submit />
                </td>
            </tr>
            <tr>
                <td>
                    <html:cancel />
                </td>
            </tr>
        </html:form>
    </table>
</body>
</html>

Mas estou recebendo o seguinte erro:
org.apache.jasper.JasperException: /userRegistration.jsp(2,0) Taglib directive: Mandatory attribute prefix missing

O erro só ocorre quando utilizo os taglibs do struts, pois a minha classe Action está funcionando direito.

2 Respostas

J

fala viniciusprd, blz…

cara, acho q talves seja isso e vc tbém provavelmente já tenha achado o erro mas qualquer coisa vamos lá…

cara, o erro é simples, vc estreveu >> prifix=“bean” << vc cometeu um erro de digitação, é >> prefix=“bean”, ok.

espero ter ajudado…

inté…

F

a action tb está errada… <html:form action=“userRegistration”>

vc tem colocar uma barra antes… assim

<html:form action="/userRegistration">

e

no cabeçalho…

<%@taglib uri="/tags/struts-html.tld" prefix=“html” %>
<%@taglib uri="/tags/struts-bean.tld" prefix=“bean” %>

Abraço,

fvilella

Criado 15 de janeiro de 2005
Ultima resposta 17 de jan. de 2005
Respostas 2
Participantes 3