在div中加载jsp文件

时间:2013-12-16 10:07:35

标签: jsp html iframe

目前我在iframe中加载了我的jsp页面,

但我想加载此页面不是在iframe中而是在div

这是我在iframe中加载jsp文件的代码

<html>
<head>
    <title>&#1605;&#1606;&#1592;&#1608;&#1605;&#1577; &#1585;&#1582;&#1589; &#1575;&#1604;&#1605;&#1581;&#1604;&#1575;&#1578;</title>
    <link rel="stylesheet" type="text/css" href="/extjs/resources/css/ext-all-neptune-rtl.css">
    <script type="text/javascript" src="/extjs/ext-all-rtl.js"></script>
    <script type='text/javascript' src='/dwr/engine.js'></script>
    <link rel="stylesheet" type="text/css" href="/theme/default.css">

     <script type="text/javascript"
    src="<c:url value='/extjs/jquery-latest.min.js'/>"></script>    
     <script type="text/javascript"
    src="<c:url value='/extjs/main.js'/>"></script> 
         <script>



    </script> 
 <style type="text/css">
    label.myBold
    {
       font-weight: bold;
       text-decoration: none;
        color: red;
    }

    .my-fieldset {
      background: #F1F3FB,
      border: 1px solid red
    }
    .my-fieldset .x-fieldset-header {
      color: red
    }





</style>  


</head>
<body dir="rtl"  >
        <script>



</script>




      <div id="wrapper">
        <div id="header">
            <div id="logo_left">
                <p>
                    <img src="/logo.png">
                </p>
            </div>
            <div id="logo">
                <h1><a href="./index.html"><img src="/logo.png"></a></h1>
            </div>


        </div>

<div id="page">
<table width="100%" height="100%">
 <tr>
 <td width="10%" height="100%"><div id='cssmenu'>
<ul id="idGmenu">
   <li style="display: none;><a href="#"><span>Home</span></a></li>
   <li><a href="#"><span>menu </span></a>
      <ul id="idSmenu">
        <li class="current"><a href="/test.htm" target="myframe">first link</a></li>

        <li class="current"><a href="/test2.htm" target="myframe">second link</a></li>

      </ul>

   </li>



</ul>
</div></td>
 <td  width="90%" height="100%"> 
 <iframe id="cmpframe" name="myframe" width="90%" height="100%" >

</iframe></td>
 </tr>
 </table>

        </div>

    </div> 
</body>
</html>

我没有成功从另一个代码加载我的jsp文件在div

<script type="text/javascript" src="<c:url value='/js/jquery.min.js'/>"> </script>

<div id="divpage"></div> 

<script type="text/javascript">
    $('#divpage').load('<%=url%>', function (responseText, statusText, xhr) {
    });
</script>

1 个答案:

答案 0 :(得分:1)

试试这个:

**<jsp:include page="WEB-INF/home.jsp" />**

检查您的文件是否在WEB-INF内,您可以通过以上方式进行

Replace home.jsp with your URL