0

A. In my jsp file I'm using jstl code like this :

<c:if test="${SURVEY_Q_LIST.IMG_FILE_SEQ != null && SURVEY_Q_LIST.IMG_FILE_SEQ != ''}">
  <div class="survey-question-img">
    <img src="${SURVEY_Q_LIST.FILE_PATH}" alt="">
  </div>
</c:if>

B. It works like this :

<div class="survey-question-img">
   <img src="https://test.com/resources/test.jpg" alt="">
</div>

I input A code in database and I select database and call it using el tag

${jspCode}   

 /*
  jspCode = 
  <c:if test="${SURVEY_Q_LIST.IMG_FILE_SEQ != null && SURVEY_Q_LIST.IMG_FILE_SEQ != ''}">
    <div class="survey-question-img">
       <img src="${SURVEY_Q_LIST.FILE_PATH}" alt="">
    </div>
 </c:if>
 */ 

But my Website read that code as text.(jstl and el tag is not working) Like this

enter image description here

please help It works like B

1 Answers1

0

JSP is normally translated to Java code by your servlet container. Your ${jspCode} will be translated to something that looks like out.write(jspCode). The contents of jspCode will be printed as-is. (simply like System.out.print(jspCode) in Java)

If you need dynamic JSP you have to play around with a JSP compiler and do the work yourself.

grubi
  • 155
  • 2
  • 16