|
jforum example source code file (Wiki.jsp)
The jforum Wiki.jsp source code
<%@ page import="org.apache.log4j.*" %>
<%@ page import="com.ecyrd.jspwiki.*" %>
<%@ page import="org.apache.commons.lang.time.StopWatch" %>
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>
<%!
public void jspInit()
{
wiki = WikiEngine.getInstance( getServletConfig() );
}
Logger log = Logger.getLogger("JSPWiki");
WikiEngine wiki;
%>
<%
// Create wiki context and check for authorization
WikiContext wikiContext = wiki.createContext( request, WikiContext.VIEW );
if(!wikiContext.hasAccess( response )) return;
String pagereq = wikiContext.getName();
// Redirect if the request was for a 'special page'
String redirect = wiki.getRedirectURL( wikiContext );
if( redirect != null )
{
response.sendRedirect( redirect );
return;
}
StopWatch sw = new StopWatch();
sw.start();
// Set the content type and include the response content
response.setContentType("text/html; charset="+wiki.getContentEncoding() );
String contentPage = wiki.getTemplateManager().findJSP( pageContext,
wikiContext.getTemplate(),
"ViewTemplate.jsp" );
%><wiki:Include page="<%=contentPage%>" /><%
sw.stop();
if( log.isDebugEnabled() ) log.debug("Total response time from server on page "+pagereq+": "+sw);
%>
Other jforum examples (source code examples)Here is a short list of links related to this jforum Wiki.jsp source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.