2009-06-28 12 views
0

が示されていない私はこのような形を持っている、(Strutsの+タイルを使用して)の.jspページに:のStruts 1.xでは:フォームが

<%@ 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> 

問題は、フォームが表示されていないということですアクションを別のアクションに変更しない限り(action_EnviarMsgと呼ばれます)。なぜこれが起こっているのでしょうか?残りのコード(struts-config、tiles-defsなど)が必要な場合は、ここに入力してください。

ありがとう!

答えて

2

アクションのフォワードに問題があると思っているのであれば、あなたのアクションの前方がタイル定義にポイントしていることを確認する必要があります。

のstruts-config.xmlの

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

タイル-def.xmlの

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

希望これは

を支援
関連する問題