JSP

 

html 제거

동영상, 이미지 태그들 제거

1. <c:set value='${row.content.replaceAll("\\\<.*?\\\>","")}' var="rm" />

 

2.  

   	<c:choose>
           <c:when test="${fn:length(rm) > 201}">
            <c:out value="${fn:substring(rm,0,200)}"  escapeXml="false" />....
           </c:when>
           <c:otherwise>
            <c:out value="${rm}" escapeXml="false"/>
           </c:otherwise> 
          </c:choose>

 

    

 		<div class="row">
 		<div class="row">
 
          <div class="widget-content nopadding">

     			 <div class="col-lg-12 text-center">
 			
			 	<div id="test-list">
			    <input type="text" class="search" id="search" style="display: none;"/>			    		    			    
						    <ul class="list text-left">          
                                   
           <c:forEach items="${boardList }" var="row" varStatus="status">

     	<li>
  <div class="bs-callout bs-callout-info">
     <h4 class="name"><a href="/users/board/community/read/${row.bno}">${row.rownum}. ${row.title}</a></h4>  
    	<p class="address" style="font-size: 16px;"  onclick="moveRead('${row.bno}')">
    	<c:set value='${row.content.replaceAll("\\\<.*?\\\>","")}'    var="rm" />
    	
    	<c:choose>
           <c:when test="${fn:length(rm) > 201}">
            <c:out value="${fn:substring(rm,0,200)}"  escapeXml="false" />....
           </c:when>
           <c:otherwise>
            <c:out value="${rm}" escapeXml="false"/>
           </c:otherwise> 
          </c:choose>
    	</p>
    	<p style="float:right; color: #000000; font-size: 13px;">
    	 ${row.name}&nbsp;
    	<i class="item-icon fa fa-eye" style="color:green"></i>&nbsp;${row.viewcnt}&nbsp;&nbsp;
    	 <c:if test="${row.replyCount >0}" >    	
        			&nbsp;&nbsp;<i class="nav-icon fa fa-comments" style="color:orange"></i>&nbsp;${row.replyCount}        			      			          			
        			 &nbsp;&nbsp;
	     </c:if>        			 
        			 <c:if test="${row.attachCount >0}" >
        			 <i class="nav-icon fa fa-paperclip" style="color:red"></i>&nbsp;${row.attachCount}&nbsp;&nbsp;
        			 </c:if>         			 		
		    <fmt:formatDate  pattern="yyyy-MM-dd HH:mm"  value="${row.regdate}" />  
    	</p>	        
  </div>	
</li>			
     				   
     	  </c:forEach>	

 

jsp

 

about author

PHRASE

Level 60  라이트

그 지위에 있지 않으면 그 정사(政事)를 논하지 말아라. -공자

댓글 ( 4)

댓글 남기기

작성

JSP 목록    more