<%@ page import="org.apache.log4j.*" %>
<%@ page import="com.ecyrd.jspwiki.*" %>
<%@ page import="com.ecyrd.jspwiki.tags.WikiTagBase" %>
<%@ page errorPage="/Error.jsp" %>
<%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %>

<%! 
    public void jspInit()
    {
        wiki = WikiEngine.getInstance( getServletConfig() );
    }
    Category log = Category.getInstance("JSPWiki"); 
    WikiEngine wiki;
%>

<%
    String pagereq = wiki.safeGetParameter( request, "page" );
    String skin    = wiki.safeGetParameter( request, "skin" );

    if ( pagereq == null )
      pagereq = wiki.getFrontPage();

    if ( skin == null )
	  skin = wiki.getTemplateDir();

    NDC.push( wiki.getApplicationName()+":"+pagereq );

    log.info("Request for page '"+pagereq+"' from "+request.getRemoteHost()+" by "+request.getRemoteUser() );

    String specialpage = wiki.getSpecialPageReference( pagereq );

    if ( specialpage != null )
    {
        response.sendRedirect( specialpage );
        return;        
    }

    //
    //  Determine requested version.  If version == -1,
    //  then fetch current version.
    //
    int version          = -1;
    String rev           = request.getParameter("version");

    if ((rev != null))
    {
	  try
	  {
	    version = Integer.parseInt(rev);
	  }
	  catch (NumberFormatException e)
	  {
	    version = -1;
	  } 
    }

    WikiPage wikipage = wiki.getPage( pagereq, version );

    if ( wikipage == null )
    {
        wikipage = new WikiPage( pagereq );
    }

    WikiContext wikiContext = new WikiContext( wiki, wikipage );
    wikiContext.setRequestContext( WikiContext.VIEW );
    wikiContext.setHttpRequest( request );

    pageContext.setAttribute( WikiTagBase.ATTR_CONTEXT,
                              wikiContext,
                              PageContext.REQUEST_SCOPE );

    //
    //  Alright, then start responding.
    //

    response.setContentType("text/html; charset="+wiki.getContentEncoding() );

    String contentPage = "templates/"+skin+"/PrintTemplate.jsp";
%>

<wiki:Include page="<%=contentPage%>" />

<%
    NDC.pop();
    NDC.remove();
%>


Sorry new to java wiki , how do i get this print friendly format working i presume i need to edit the code mentioned here soemwhere within thw wiki but now clear where.

help appreciated

--AnonymousCoward, 08-Jun-2006

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-6) was last changed on 06-Jun-2007 16:41 by MurrayAltheim