0

私は Apache tiles2 フレームワークを使用している struts2 Web アプリに取り組んでいます。コードは localhost で正常に動作していますが、サーバーでコードを実行すると、タイル化されたページがプレーン テキストとしてレンダリングされます。誰でもどこに問題があるか教えてください。つまり、ページはブラウザ側でプレーンテキストとして表示されます。

これがブラウザでのレンダリング方法です。スクリーンショット - http://i42.tinypic.com/2vnj686.jpg

誰かが解決策を持っている場合は親切に助けてください....

ここに私の tiles.xml があります

    <?xml version="1.0" encoding="UTF-8" ?>

    <!DOCTYPE tiles-definitions PUBLIC
           "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
           "http://tiles.apache.org/dtds/tiles-config_2_1.dtd"  >
    <!--        "http://tiles.apache.org/dtds/tiles-config_2_1.dtd" -->
    <tiles-definitions>

        <definition name="BaseDef" template="/adminpanel/template/BaseLayout.jsp">

            <put-attribute name="title" value="Home Page" />
            <put-attribute name="css" value="/adminpanel/template/extracss.jsp" />
            <put-attribute name="js" value="/adminpanel/template/js.jsp" />
            <put-attribute name="header" value="/adminpanel/template/header.jsp" />
            <put-attribute name="body" value="/adminpanel/template/body.jsp" />
            <put-attribute name="footer" value="/adminpanel/template/footer.jsp" />

    </definition>

        <definition name="LatestMaterial" extends="BaseDef">
            <put-attribute name="title" value="Latest Exam Material " />
            <put-attribute name="css" value="/adminpanel/template/newtablecss2.jsp" />              
            <put-attribute name="body" value="/adminpanel/Pages/latestexammaterial.jsp" />
            </definition>
    </tiles-definitions>

ここに私の BaseLayout.jsp があります

        <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
            pageEncoding="ISO-8859-1"%>
        <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
        <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>

        <tiles:insertAttribute name="css"/>
        <tiles:insertAttribute name="js"/>
         <title><tiles:insertAttribute name="title" /></title>
        </head>
        <body>

            <div id="main">
                        <tiles:insertAttribute name="header"/>
                                        <div id="body">
                                                 <tiles:insertAttribute name="body"/>
                                        </div></div>
                        <tiles:insertAttribute name="footer"/>

        </body>
        </html>

これがstruts.xmlでの使用方法です

   <package name="wz.admin"  extends="struts-default,json-default,tiles-default">
      <action name="LatestMaterial" class="org.wz.admin.LatestMaterialAction">
        <result type="tiles">LatestMaterial</result>
    </action>
    </package>
4

1 に答える 1