Announcement Announcement Module
No announcement yet.
multiple views in single view Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • multiple views in single view

    hello all,

    i have been trying to get multiple views (.jsp) to display in one single view (.jsp)....each view having its own controller.

    in the part c:out, it does return the correct value (demo.jsp)....
    and when we hardcode the line <jsp:include page="demo.jsp"/> it DOES work....
    but the line <jsp:include page="${model.chooser.banner}"/> DOES NOT display demo.jsp.

    the file main.jsp is shown below:

    <%@ page import="bus.*"%>
    <%@ page import="web.*"%>
    <%@ include file="/WEB-INF/jsp/include.jsp" %>
    <pre><c:out value="${model.chooser.banner}"/></pre>
    <td> <jsp:include page="${model.chooser.banner}"/> </td>

    any help or ideas would be appreciated.

    thanks in advance,
    vincent disco

  • #2
    correction- c:out

    damn faces....

    correction: c : out


    • #3
      The jsp:include tag doesn't support JSTL expressions except in the latest servlet engines that support the JSP-2.0 spec.

      One solution is to hold the value of model.chooser.banner as a page script variable. For example:

      <% String banner = ( (YourModelClass) pageContext.findAttribute ( "model" ) )
               .getChooser ()
               .getBanner ();
      <jsp:include page="<%= banner %>" />
      I'm sure the first line can be done more elegantly but it being a Sunday morning...