%@ page import="com.ecyrd.jspwiki.log.Logger" %>
<%@ page import="com.ecyrd.jspwiki.log.LoggerFactory" %>
<%@ page import="org.apache.commons.lang.*" %>
<%@ page import="com.ecyrd.jspwiki.*" %>
<%@ page import="com.ecyrd.jspwiki.ui.EditorManager" %>
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="http://jakarta.apache.org/jspwiki.tld" prefix="wiki" %>
<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="stripes" %>
<%@ page import="com.ecyrd.jspwiki.util.TextUtil" %>
<%!
Logger log = LoggerFactory.getLogger("JSPWiki");
%>
<%
WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
// Create wiki context and check for authorization
WikiContext wikiContext = wiki.createContext( request, WikiContext.CONFLICT );
String pagereq = wikiContext.getPage().getName();
String usertext = (String)session.getAttribute( EditorManager.REQ_EDITEDTEXT );
// Make the user and conflicting text presentable for display.
usertext = StringEscapeUtils.escapeXml( usertext );
usertext = TextUtil.replaceString( usertext, "\n", "
" );
String conflicttext = wiki.getText(pagereq);
conflicttext = StringEscapeUtils.escapeXml( conflicttext );
conflicttext = TextUtil.replaceString( conflicttext, "\n", "
" );
pageContext.setAttribute( "conflicttext",
conflicttext,
PageContext.REQUEST_SCOPE );
log.info("Page concurrently modified "+pagereq);
pageContext.setAttribute( "usertext",
usertext,
PageContext.REQUEST_SCOPE );
// 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" );
%>