连代码也一起显示出来了,还有不能显示图片,只显示的是链接地址

解决方案 »

  1.   

    把jsp代码贴上来,一般是你jsp里面代码的引号写得有问题。
      

  2.   

    这个是我的页面代码
    <%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
    <%@include file="/common/common.jsp"%>
    <%@include file="/common/skins/skin0/component.jsp" %><%
    String webContextRoot = request.getContextPath();
    %>
    <link href="<%=webContextRoot%>/common/css/style.css" rel="stylesheet" type="text/css" />
    <html> 
    <head> 
    <title><b:write property="article/title"/></title> </head>  <body>
     <e:datasource name="article" type="entity" path="com.primeton.cms.dataset.article.Article" />
     <h:form>
     <dataform id="preview">
    <table width="960" height="30" border="0" align="center" cellpadding="0" cellspacing="0"> 
      <tr> 
        <td width="682" valign="top">
    <table width="98%" border="0" cellspacing="0" cellpadding="0"> 
        </table>
    </td> 
      </tr> 
    </table> <table width="960" border="0" align="center" cellpadding="0" cellspacing="0"> 
      <tr> 
        <td valign="top">
    <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#C5D1E5"> 
          <tr> 
            <td width="100%" valign="top" bgcolor="#FFFFFF" class="list_top_b"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 
                <tr> 
                  <td width="96%" height="60" valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
                    <tr> 
                      <td height="40" align="center" class="article_title">
                       <b:write property="article/title" />
                    </td> 
                    </tr> 
     
                    <tr> 
                      <td height="30" align="center" class="time">
                       <l:notEqual property="author"  targetValue="empty">
     作者:<b:write property="article/author"/>&nbsp;&nbsp;&nbsp;&nbsp;
      </l:notEqual>
      <l:notEqual property="source"  targetValue="empty">
      文章来源:<d:write dictTypeId="CMS_ARTICLE_SOURCE" property="article/source"/>&nbsp;&nbsp;&nbsp;&nbsp;
      </l:notEqual>
      更新时间:<b:write property="article/saveDate" formatPattern="yyyy-MM-dd"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      </td> 
                    </tr> 
                  </table>
      </td> 
                </tr> 
                <tr> 
                  <td height="1" colspan="3" bgcolor="#D1DDED"></td> 
                </tr> 
        </table> 
                
    <table width="100%" border="0" align="center" cellpadding="20" cellspacing="0"> 
                  <tr> 
                    <td valign="top">
    <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
                        <tr> 
                           <td align="center"> 
    </td> 
                        </tr> 
                      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="10"> 
                      <tr> 
                        <td class="article_content">
    <b:write property="article/content" filter="false"/>
    </td> 
                      </tr> 
                      <tr> 
                        <td align="center" bgcolor="#F7F7F7"></td> 
                      </tr> 
                      <tr> 
                        <td align="center" class="list"> <style type="text/css"> 
    .form-buttun {
    BORDER-RIGHT: #002D96 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #002D96 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr=#9DBCEA); BORDER-LEFT: #002D96 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #002D96 1px solid
    }
    </style> 
    </td> 
                      </tr> 
                      <tr> 
                        <td align="right" class="list_14"><font color="#999999">[编辑:<b:write property="article/addUser" /> ]</font></td> 
                      </tr> 
                      
                    </table> 
                      <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
                        <tr> 
                          <td height="10" background="images/xian.gif"></td> 
                        </tr> 
                      </table></td> 
                  </tr> 
              </table></td> 
          </tr> 
        </table> 
    <!--添加附件区-->    
                    <table id="filetable" width="100%" border="0" cellpadding="1" cellspacing="1" align="center" class="form_table">
                    <l:iterate id="myid" property="article/atFileuploads">
                      <tr>
                      <td width="10%">
                      附件
                      </td>
                      <td width="90%">
                      <b:set name="tmpfileName" iterateId='myid' property='fileName'/>
                       <l:in iterateId="myid" property="fileType" targetValue="application/x-jpg,application/x-img,application/x-bmp,application/x-png">
                      <!--<h:img iterateId="myid" property="fullnampath" height="50" width="50"/>-->
                       <a href="#" onclick="viewPic('<b:write iterateId="myid" property="fullnampath" />')"><img src='/default/<b:write iterateId="myid" property="fullnampath" />' height="50" width="50" /></a>
                      </l:in>
                      <l:notIn iterateId="myid" property="fileType" targetValue="application/x-jpg,application/x-img,application/x-bmp,application/x-png">
                      
                       <%try{%>
              <h:download iterateId="myid" property="filePath" outputFileName="@tmpfileName"><b:write iterateId="myid" property="fileName" /></h:download>
      <%}catch(Exception e){%><span style="color:red">附件不存在</span><%}%>
      </l:notIn>        
              </tr>  
                    </l:iterate>
                        </table>
          </td> 
            <tr class="form_bottom">
                  <td colspan="4">
                   <input type="button" value="关闭" onclick="javascript:window.close();" class="button">
                  </td>
                </tr>
     </dataform>
    </h:form>
    </body> 
    </html> 
    <script>
      function viewPic(filePath) {  
        var path="/default"+filePath;
        var sUrl="com.oloa.portal.showPic.flow?_eosFlowAction=action0&picpath="+filePath;
        sUrl +='&_ts='+(new Date()).getTime();   //防止IE缓存,在每次打开时加个时间差的参数,并且作为判断是否弹出窗口的标志
        
        //window.open(sUrl);
        showModalCenter(sUrl,null,null,600,500,"图片显示");
        //window.showModalDialog(sUrl,,"dialogWidth=500px,dialogHeight=400px");
      }
    </script>
     
      

  3.   

    你是不是用了什么标签库没在页面上引用?
    比如你的标签:
    e:datasource
    h:form
    b:write
    l:notEqual
    等等。
      

  4.   

    是这么个问题,
    <p style="font-family: 宋体; word-wrap: break-word; color: #000000; font-size: 13px; font-weight: normal"><span style="font-size: small">公司有资源都可以推荐。</span></p>
    <p style="font-family: 宋体; word-wrap: break-word; color: #000000; font-size: 13px; font-weight: normal"><span style="font-size: small">文件详情及图纸相关见附件。</span></p>
    在是在数据库中的content内容,
    而我在页面修改,点击保存后,数据库的content的内容就变成了这样&lt;p style="font-family: 宋体; word-wrap: break-word; color: #000000; font-size: 13px; font-weight: normal"&gt;
     &lt;span style="font-size: small"&gt;公司有资源都可以推荐。&lt;/span&gt;&lt;/p&gt;
    &lt;p style="font-family: 宋体; word-wrap: break-word; color: #000000; font-size: 13px; font-weight: normal"&gt;
     &lt;span style="font-size: small"&gt;文件详情及图纸相关见附件。&lt;/span&gt;&lt;/p&gt;
    然后在页面上点击查看的时候显示内容是这样<p style="font-family: 宋体; word-wrap: break-word; color: #000000; font-size: 13px; font-weight: normal"> <span style="font-size: small">公司有资源都可以推荐。</span></p> <p style="font-family: 宋体; word-wrap: break-word; color: #000000; font-size: 13px; font-weight: normal"> <span style="font-size: small">文件详情及图纸相关见附件。</span></p>  
      

  5.   

    原来数据库的内容可以正常显示,但是我只要在页面上点击修改,保存后,再浏览页面,页面上显示的就是这样的
    <p style="font-family: 宋体; word-wrap: break-word; color: #000000; font-size: 13px; font-weight: normal"><span style="font-size: small">公司有资源都可以推荐。</span></p>
    <p style="font-family: 宋体; word……
      

  6.   

    哦,你意思是它以文本方式显示出来了,你想以html方式显示?
      

  7.   

    就是我说的那个意思嘛。
    你的内容在这里显示的吧<b:write property="article/content" filter="false"/>你页面也没引入标签库,我也不知道你用的什么标签库,反正你看看b:write有没有一个可以把内容转换成HTML格式的属性,如果有就直接引用。
    给你看另一个连接:
    http://topic.csdn.net/u/20120321/09/1cc37205-5f1b-473c-810d-9721f7317df5.html
      

  8.   

    filter="false" 这个属性就是去除的,如果是<p>这样子的就没问题,,但是&lt:P&gt;这样子的就不行。
      

  9.   

    整好了,,多谢你了 这一下午
    是我的文本编辑框里 config.js 开了html输出。。到数据库里 就变了