| 
 | 
jforum example source code file (DiffContent.jsp)
This example jforum source code file (DiffContent.jsp) is included in the DevDaily.com
"Java Source Code
Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM. 
 
 
The jforum DiffContent.jsp source code
<%@ page import="com.ecyrd.jspwiki.tags.InsertDiffTag" %>
<%@ page import="com.ecyrd.jspwiki.*" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
<div id="diffcontent" >
    <wiki:PageExists>
    <div class="diffnote">
    <form action="     
    Difference between version
    <select id="r1" name="r1" onchange="this.form.submit();" >
    <% 
       WikiContext c = WikiContext.findContext( pageContext );
       int latestVersion = c.getPage().getVersion();;
       int ii = 0;
       ii = ((Integer)pageContext.getAttribute(InsertDiffTag.ATTR_OLDVERSION, 
                                               PageContext.REQUEST_SCOPE)).intValue();
       if( ii == WikiProvider.LATEST_VERSION ) ii = latestVersion;
       for( int i = 1; i <= latestVersion; i++) 
       {
    %> 
       <option value="<%= i %>" <%= ((i==ii) ? "selected='selected'" : "") %> ><%= i %>
    <%
       }    
    %>
    </select>
    and version
    <select id="r2" name="r2" onchange="this.form.submit();" >
    <% 
       ii = ((Integer)pageContext.getAttribute(InsertDiffTag.ATTR_NEWVERSION, 
                                               PageContext.REQUEST_SCOPE)).intValue();
       for( int i = 1; i <= latestVersion; i++) 
       {
    %> 
       <option value="<%= i %>" <%= ((i==ii) ? "selected='selected'" : "") %> ><%= i %>
    <%
       }    
    %>
    </select>
        
    <a title="Go to first change in this document" 
       href="#change-1">View first change</a>»»
    </form>
    <br />
    Back to <wiki:LinkTo>, or
    <wiki:PageInfoLink> version history
    </div>
    <br />
    <wiki:InsertDiff>
      <i>No difference detected.
    </wiki:InsertDiff> 
    </wiki:PageExists>
    
    <wiki:NoSuchPage>
    <p>
    This page does not exist.  Why don't you go and <wiki:EditLink>create it?
    </p>
    </wiki:NoSuchPage>
</div>
Other jforum examples (source code examples)
Here is a short list of links related to this jforum DiffContent.jsp source code file: 
 
  |