views:

73

answers:

1

Hi!

I have a form like this, in a .jsp page (using Struts + Tiles):

<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html:xhtml/>

<div id="content">

    <html:form action="action_newPost" method="post">
        <table>

            <tr>
                <td>Titulo (150 Caracteres Máximo)</td>
            </tr>
            <tr>
                <td><html:text property="titulo" size="45"/><br/>
                <html:errors property="tituloError"/></td>
            </tr>
            <tr>
                <td>Post (1000 Caracteres Máximo)</td>
            </tr>
            <tr>
                <td><html:textarea property="contenido" cols="80" rows="7"/><br/>
                <html:errors property="cuerpoError"/></td>
            </tr>
        </table>

        <input type="submit" value="Publicar"/>
    </html:form>

</div>

The problem is that the form isn't shown, unless I change the action to another (called action_EnviarMsg). Why could this be happening? If you need the rest of the code (struts-config, tiles-defs or something) tell me to put it here...

Thanks!

+2  A: 

I think for what you are saying that there could be a problem with the forward of your action, you should make sure that the forward of your action points to your tile definition it would be something like this.

struts-config.xml

<action path="/somepath" type="yourpackage.YourAction"><br/>
    <forward name="YourForward" path="tiledefinition" /><br/>
</action>

tiles-def.xml

<definition name="tiledefinition" ><br/>
    <put name="body" value="/jsp/your-form.jsp" /><br/>
</definition>

Hope this helps

chermosillo