Table of Contents

Administration/install/configuration#

How to stop guests from editing (only "logged in" editing)?#

In your $JSPWiki_Home/WEB-INF/jspwiki.policy file, remove the two lines containing "edit" and "createPages" as shown below:
grant principal com.ecyrd.jspwiki.auth.authorize.Role "Anonymous" {
    permission com.ecyrd.jspwiki.auth.permissions.PagePermission "*:*", "edit";
    permission com.ecyrd.jspwiki.auth.permissions.WikiPermission "*", "createPages";
};

How could I declare my new users?#

After installation , I don't know how to administrer my JSPWiki , it doesn't have a space for admin.

And what is the default user ?? and configuration file for user/pass?

I have Login.jsp but no idea how to manipulate. Plz help.

What are the hardware requirements for JSPWiki?#

JSPWiki is really quite modest for a Java-based server. JSPWiki.org is running several wiki instances with a 266 MHz Pentium II with 512 MB of memory. The runtime memory consumption is between 80 to 200 MB (Tomcat 4), and CPU utilization is rarely above 15%. This depends heavily on your choice of JVM and ServletContainer, as well as the JVM options.

The most CPU-intensive part is the initial scan of all pages, which is done only once during startup. With a slow CPU this can take a while (even minutes) for a large Wiki site.

How are Bread Crumbs enabled?#

According to the release notes, bread crumbs (a.k.a. Your Trail) functionality was added? However the "PageHeader.jsp" (template) doesn't include the snippet of code to enable this functionality.

Bread crumbs are displayed only in webdocs\template\default\ViewTemplate.jsp. It was done this way so the bread crumbs only work when you are viewing a page. Are you sure you have the latest CVS code? -- KenLiu

Actually there isn't anything special required to enable the bread crumbs. They are enabled by default. My problem was that the new template (jsp) wasn't being picked up by tomcat. When I updated the timestamp on the jsp file, the jsp was recompiled and everything works. -- Niel Eyde

If however in a fresh installation (under Tomcat 5) the breadcrumbs fail to show, where should one look for the cause and solution of this problem? Could it be cookie- or baseurl related? -- Bart Breeschoten !!Why is there a noticeable delay when you first start JSPWiki up? This is because the ReferenceManager (the piece of software that is responsible for creating the "Referenced by" -list which you can see in the [left menu footer, the unused pages -list and undefined pages -list, scans all wiki pages on your hard drive for links. For a large Wiki on a slow machine, this initialization can take a long time.

How do I change the colour of the edit screen to something other than pink?#

The background color is determined in three locations:

  1. Edit the CSS files (jspwiki_ie.css, jspwiki_ns.css, and jspwiki_mac.css) and change the "BODY.edit" color
  2. Edit the "Edit.jsp" file (or in case of JSPWiki 1.9.x, EditTemplate.jsp)
  3. Make your own stylesheet, and redefine "BODY.edit" in it, then use your browser's facilities to force that stylesheet.

Besides, it's not pink. :-) And it was changed to light blue in 1.9.2something....

--JanneJalkanen

Since version 1.9.x, all pages are now templates, which the administrator can change at will. The display of many page elements can be modified via the style sheets.

-- JanneJalkanen

I've written (a new plugin|bug fixes|new functionality)! How do I contribute it to JSPWiki?#

Please see ContributingChanges.

My Wiki does not start!#

Are you absolutely sure that you have edited the config file as instructed by the README in the download archive, and JSPWikiDownload?

JSPWiki needs to know where to put all wiki and log files first, before you can start it. The configuration file is called "jspwiki.properties" and it can be found in the WEB-INF directory of the WAR.

Changes do not appear to pagehistory or to RecentChanges#

The probable reason for this is that you have changed the user id under which JSPWiki was running, AND you're using RCSFileProvider. RCS locks all files it checks out under the current user id, and does not allow any other user to do a checking. See RCSFileProviderIssues for more information.

$~Id$ gets always expanded#

I'm using Id in $ symbols on a Wiki page for explaining a CVS/RCS feature. How can I prevent that this gets expanded by your RCS call? Even triple { don't help.

JanneJalkanen: First of all, this is only a RCSFileProvider specific issue. Other providers (like VersioningFileProvider) do not have this problem. I think you would need to put the following in your jspwiki.properties file:

jspwiki.rcsFileProvider.checkoutCommand = co -kk -l %s
jspwiki.rcsFileProvider.checkoutVersionCommand = co -kk -p -r1.%v %s

You can also put a '' before the keyword, which stops the expansion. However, this may be a bit problematic if you do a cut-n-paste of source code.

For more information about the RCSFileProvider, check RCSFileProviderIssues.

Also, you can use $ to represent the dollar sign. -JK

Any modification to the CSS files is ignored?#

Q: The stylesheet files (jspwiki_ie.css) are loaded from the default template directory even if a different template directory was set. What is going on?

A: The cssinclude.js script in the default template is template-specific - you can't just copy it. You will need to modify (or discard) it, since it always points to the templates/default-directory. (2.0 branch (stable), this is no longer true for 2.1.x)

This is documented more extensively in JSPWikiTemplates.

Is there a way I can dump all the pages to HTML#

I would like to set up a Wiki internally but would like to periodically publish its contents on to the Web as plain old HTML pages. Any thoughts on the best approach ?

Two possible solutions come to mind:

  • Have a spider crawl it all and publish it (for example wget might work well)
  • Use Hula by MahlenMorris to fetch the contents of all pages using XML-RPC, then apply them in your own templates.

-- JanneJalkanen

How to avoid the port number in the URL?#

What is one (are some) way(s) to install JSPWiki so that the Tomcat port # doesn't show in the URL? Specifically, I'm looking for the way to do this so that the jsp is called right after the domain (e.g.localsite.org/Wiki.jsp?page=Example) just like it is here.
Edit Tomcat's conf/server.xml file and replace port 8080 with port 80 and restart Tomcat. Note: If you are on Unix, this is a restricted port and you'll have run Tomcat as root. Also, if you have a web server running, this will produce a conflict. If you are running Apache, get the Tomcat module for it and configure it and then use Apache to talk to Tomcat to run your JSP applications. --MichaelGentry
Thank you. How do I do that? --MatthewSimpson
Check out ApacheTomcatConnection --JanneJalkanen
Check out ProxyPass
Would making an alias that would include the path and go to the directory beyond the port so that it would mask the port number... Would such a thing work? --MatthewSimpson
I got JSPwiki to respond simple http://localsite.org/ requests this way: --Timo
  1. Changed Apache's port to 8008
  2. Edited server.xml to use port 80 (DON'T add empty lines in the beginning of this file!)
  3. Now http://localsite.org/MyWiki works. Finally I made a symbolic link in $CATALINA_ROOT/webapps: ROOT -> MyWiki

How to make JSPWiki faster?#

Well, there's always a bit of a penalty when using Java technology, though the modern virtual machines are getting really good. However, you can use OSCache to cache some of the JSPWiki output: Check out UsingOSCacheWithJSPWiki for more info.

Bad question: What do you need to be faster? Most performance problems are caused by bad configuration. See my comments on SavingAnEditedPageNeedsMinutesToShowNewPage for example. --OlafKock

How to turn the edit ability off or only to a restricted number of people?#

For 2.0 or earlier versions:

  • Uncomment the <security-constraint> and <login-config> -sections from web.xml.
  • Check that the <url-pattern> -field within the <security-constraint> contains "Edit.jsp". You should consider adding Upload.jsp as well.
  • Put in those roles that you want to access the Edit.jsp in the <auth-constraint> -section.
  • Add those roles to usernames. Unfortunately, this depends on the servlet container you're using, so we cannot give more specific information.
  • Restart your server.

Can I rename the Wiki.jsp as index.jsp and will it work fine?#

>No.

>However, you can set the welcome-file-list in web.xml to make Wiki.jsp behave like "index.jsp", i.e. serve as >the default application. Make sure that your web.xml contains the following: > > <welcome-file-list> > <welcome-file>Wiki.jsp</welcome-file> > </welcome-file-list> >

But the internal wiki reference will still refer Wiki.jsp right?. for e.g If i renamed the file Wiki.jsp as index.jsp and I am editing that page. After edited, it gives me error like Wiki.jsp. Similar error i am getting in sys info, recent changes, full recent changes files. I can have internal wiki reference with my file name. So I have modified WikiEngine.java file to accept the index file name from jspwiki.properties file. If the jspwiki.indexPage is not defined in the properties file, the default will be Wiki.jsp. Its working fine now and thanks for your reply. - RK.

I wouldn't recommend this practice (it will make upgrading more difficult), but yes, it's possible to do this kind of a patch.

-- JanneJalkanen

I concur with Janne. What's the motivation for renaming Wiki.jsp? The only one I can think of is political. If that is the case, you probably have bigger issues.

-- MichaelGentry

See.. its very simple we have already having the site with index.jsp and its released. Now we want to enhance the things by using wiki in the index page. Now its very impossible for us to rename all the links and the references pages to Wiki.jsp. Thats the only reason I queried about renaming issue.. nothing political reason involved in it... if it seems i am really sorry about it.. Even in our page we have stated as powered by JSPWiki..

-RK

Hmmm ... if you are worried about links to your index.jsp page, you could make a simple index.jsp page that does a redirect to Wiki.jsp and that should solve that problem. Bookmarks/etc still work and you don't have to "fix" things whenever you upgrade to a new version of JSPWiki.

-- MichaelGentry

I propose adding RK's patch (or something like it) to the main code branch. I think it's reasonable for the sysadmin to want to control what kind of URLs JSPWiki generates. In combination with UrlRewrite the Wiki might be accessible at all sorts of URLs. In my case I'd like to have the Wiki be at domain.org/wiki/pagename rather than domain.org/wiki/Wiki.jsp?page=pagename. Some motivations for this:

  1. It keeps the URLS cleaner
  2. By making it less obvious that the content is dynamically generated, encourages search engines to index it.
  3. It allows migration from existing Wiki Engines to JSPWiki without breaking old bookmarks

I imagine there would be a set of properties for viewing a page, editing a page, etc. that default to something like $hostname/$baseuri/Wiki.jsp?page=$pagename that you can modify as needed.

--LorrinNelson

What is this XML-RPC thingy?#

XML-RPC stands for "XML- Remote Procedure Call". It basically allows you to make calls to the Wiki API from remote servers, without resorting to HTTP and having to deal with HTML formatting. See WikiRPCInterface, JSPWiki:NotificationList, and JSPWiki:Hula for examples.

How do I rename/delete a page?#

This is an included feature certainly from version 2.8.1. It seems already from version 2.3.

Go to the page in question, and click on the Info tab. If you have the privilege to rename/delete (usually only for role Admin), you will see two buttons like "Rename Page" and "Delete complete Page". Use them.

If you don't have sufficient privileges, there will be statements explaining this to you.

For history of this feature see RenamePagePatch.
--Christoph Knabe, 2010-01-08

Is there a way to add a favicon per Wiki?#

I'd like to add a favicon to my Wiki without making sidewide changes in the template as it's done in the BrushedTemplate. Any idea how to do it?

--ChristophGrimmer

Can you put a favicon.ico in the website root? That works with IE, not sure about other browsers though. It's certainly not the proper way. -- KieronWilkinson

That works with Firefox, too. But only if you're going through apache. When putting favicon.ico in tomcat/ROOT/ the browser doesn't take it because you're on port 8080 and not 80... Also I can't put it in the page header inside some <link rel="shortcut icon" href="favicon.ico"> tag for obvious reasons without changing the template. This works with my port-80-homepage but not with JSPWiki.

--ChristophGrimmer

Can I block WikiSpam?#

Q: I've been getting some WikiSpam on my wiki. Is there any way to prevent this or at least block based on IP address? See here for an example. --DaveBrondsema

A: Yep, I wrote a TextContentVerifier (patch) to help solve this problem.

Category driven left menu?#

Q: Is there a setting indicating which section of a website a page is in, and is it possible to change the left menu based on the section of a website the user is visiting? e.g. The Apache website - has a distinct left menus for the main pages (section 1), Apache HTTP Server pages (section 2), Ant pages (section 3), etc.

A: Check the InsertLeftMenuTag tag. That tag allows you to dynamically use page specific Left Menu(s). Rolf Mueller

Restarting the servlet container?#

Q: I installed JSPWiki. It's exciting. But, I don't konw how I can apply modified jskwiki.properties without restarting servlet container. Shoud I do?

A: You did not state what your servlet container is. For Tomcat there's the manager application that enables you to restart a single web application. Depending on the configuration of tomcat it might restart a context when its web.xml is touched. --OlafKock

Default Page?#

Q: After installing JSPWiki in Debian, I copied and unzipped JSPWiki-samplepages.zip to /usr/share/tomcat4/webapps/JSPWiki/pagedata. After restarting Tomcat4, the default page loaded by Tomcat4 at http://localhost:8180/JSPWiki/ is always blank. I can see the files listing at http://localhost:8180/JSPWiki/pagedata/, but not the default page as described in the Document section in this website. What have done wrong? Thank you.

A:It's most likely a setting in your jspwiki.properties file. Pay particular attention to getting the paths for .pageDir and .storageDir correct for your config. Also, watch for extra spaces at the ends of the lines in the jspwiki.properties file. Depending on which version of the wiki you're running, spaces padding the ends of lines causes exactly what you describe. To set the default page to something other than 'Main', change the jspwiki.frontPage property. --Scott Hurlbert

Also it's a bad idea to place pagedata within a webapp subdirectory. Whenever the application is redeployed - e.g. when a new war-file is detected and the context is redeployed - it will be deleted and the content is lost. --OlafKock

Placing pageDir below WEB-INF#

Q: Is there a way to provide a context relative path to the content and attachment directories in the preferences file? I would like to be able to freely move my wiki from machine to machine without having to change the configuration. I have seen programs that can expand expressions in properties files as shown below:

A:do not put your files into the web application path. While administering the application there could be a reason to reinstall the application. Then all the wiki contents could get lost. --SebastianPetzelberger

Older discussion for this question - I'd prefer to delete it because it's really dangerous to place content within the web application: --OlafKock

A: jspwiki.fileSystemProvider.pageDir = ${context.realPath}/WEB-INF/content

where the ${context.realPath} expression is automatically replaced by the result of context.getRealPath("/"). Is anything like this supported for JSPWiki?

--JTB

The problem is that the Servlet API is broken, and the context.getRealPath("/") may well return null. So we can't rely on it. Any good suggestions on how to handle this problem are appreciated.

-- JanneJalkanen

A:What about using the {CATALINA.HOME} system property and add "../webapps/{WEB-APP-NAME}" to the string ?

-- MadsSkagen

Unfortunately, a lot of people are using WebSphere or WebLogic, or Resin, or some other servlet container...

Besides, it is possible for the user to redefine the location of an webapp in server.xml, so this wouldn't be very reliable for Tomcat either. In fact, there might not even be a webapps/blah directory.

-- JanneJalkanen

Perhaps it would be enough to treat any value specified for .pageDir as a path relative to the webapp, using that Servlet API - and if that fails (eg because we are within a WAR) thentry again, treating the value as an absolute pathname? Sure - this may not always work - but it seems that at least Tomcat and Resin both expand WAR archives before actually using them - so the getRealPath() call should work...

-- MoiLejter

How to I enable support for multibytes characters?#

Q: I did add jspwiki.encoding = UTF-8 in jspwiki.properties, but this does not see to have any effect. When I type Japanese in the Edit window, and preview the page, the multibytes characters display as question marks. If I commit my changes, the page itself (and the underlying data file) also contains question marks. I checked that it works OK on JSPWiki.org, so I believe there is a setting I missed. I am using Tomcat 4.1.27 and JSPWiki 2.0.50, by the way. Any idea?...

--JC

A: I think your browser is broken... You just destroyed all the non-ASCII characters on this page, for example :-).

See JSPWikiBrowserCompatibility for more information.

-- JanneJalkanen

Ooops, sorry about that :( I was using Opera 6.x, I'll try other browsers, and post results in the above page if they are interesting.

--JC

Why can I not view my rss.rdf file from the server#

Q: I configured RSS and used the default file name of rss.rdf. It generates the file OK but when I try to access it in the browser it does not render (the current page does not change). I changed my configuration and set the file name to rss.xml and things worked OK.

A: Your web server is probably not configured to return the correct MIME type for the .rdf -extension. The correct mime type for RDF files is "application/rdf+xml", methinks. I think you can also configure it to "text/xml" or "text/xml" if you really want to.

RFC 3870 is rather new so "application/rdf+xml" isn't understood by Mozilla, for instance. http://www.jspwiki.org/rss.rdf uses "application/xml".

-- Per

War file?#

Q: Does anyone know of a way to nicely package a wiki in a war so I can move it from one machine to another without having to tweak the property file? It would be great if I could make the dir references in the prop file relative to the wiki's webapp dir. So far from what I've discovered is the relative dirs are relative to the working dir when you start tomcat.

My goal is to lower the barrier to the wiki's use by making the wiki portable so I can send it to someone and they can drop the war in their env and it works without tweaks. Thanks,

AlexSoto - Sept 8, 2003

A: I think the trouble is that if a webapp has been put in a WAR file, it is nigh impossible to figure out where it has been physically located on-disk using the Servlet API. I would love to add such a feature, but so far I haven't been able to find an easy way to do it.

-- JanneJalkanen

Have you tried to get a physical dir of a known resource path via ServletContext then based off that path tack on a relative dir as specified in the properties file? I would have mentioned this before, but I was hoping to find out if someone had an idea that wouldn't require any code changes :)

-- AlexSoto - Sept 19, 2003

Well, yes, but the problem is that getRealPath() will return null if the application is in a WAR file... Which sucks seriously and makes it completely unsuitable to your purpose :-(.

-- JanneJalkanen

Ahh, didn't know that. Since tomcat expands my wars I didn't even think about that. Thanks anyway Janne. -- AlexSoto

One workaround (that should work on most platform and JVM's) is to use one of the pre-defined system properties of the JVM as the base for the Wiki files (such as used.home or java.io.tmpdir). This would require some kind of "start-up procedure" that would copy the default set of pages to this location when starting JSPWiki for the first time.

-- AndersEngström

WAR file?#

Q: Are we supposed to be able to install JSPwiki without unpacking the WAR file? How do you do that?

A: You can do that. See MultipleWikis for a hint, but it really won't answer your question.

Upgrading to new version?#

Q: How do I upgrade to 2.0.49 from 2.0.45? The instructions only account for manual update from 2.0.39 and earlier.

A: See UpgradingJSPWiki

Q: Are the instructions for moving from 2.2.x to 2.2.x the same as for 2.0.x to 2.0.x?

A: Yes, follow the 2.0.x to 2.0.x instructions in UpgradingJSPWiki.

NDC (Nested Diagnostic Context)#

Q: What the heck does the variable NDC on Wiki.jsp reference? That is a new one on me.

A: It is a "Nested Diagnostic Context". In effect, it's a way to tell Log4j which page is currently under handling, and it would allow us to do stuff like write a separate log for each page, or just a subset of pages. See Log4j documentation for more info.

Loading time?#

Q: I've seen it written that JSPWiki takes some time to initially load, but that once it does it runs pretty fast. What does this mean? What is loading? Where is it loading? --MatthewSimpson
A: JSPWiki uses most of the startup time to go through all of the pages and builds a list of all the links on those pages. This allows the BackLinks feature to work, since then we know which pages link where. It also allows us to build the UndefinedPages and UnusedPages. Another thing is that Java and the servlet container (like Tomcat) take a bit of time to start up, too.
Q: After doing this once, what would cause this list to be lost? Does it need to be rebuilt? How often? Why?
A: The rebuilding of the list only happens when the web server is started (or restarted). After that, we just track changes to all pages, so things are pretty fast. BTW, if you're using Tomcat, then it is possible to start just JSPWiki without starting the whole web server, which is a bit faster. See the manager app documentation. The list is lost when the server is shut down because the current implementation does not save the index. Saving would require a consistency check on restart, otherwise possible manual additions/removals of pages would confuse the indexing.
Q: Does all this happen on the server? (i.e. index is maintained on the server?
A: Yes.
Q: Why is the indexing information not persisted?
A: It's on my To Do list, but not at high priority right now. --ebu

Backup?#

Q: I'm running on Linux with Tomcat as the servlet container. If I want to backup my Wiki do I just backup my Wiki directory tree and the Wiki page store? Do I have to backup anything RCS-wise to preserve the integrity of the site if it has to be restored. (I really know nothing about RCS right now and am operating on faith that it is there and doing what its supposed to do.)

A: Yes, just back up all the contents of the page store. If you want to have a backup copy of the JSPWiki code and your settings, then back up your webapps/<your wiki name> directory as well.

RecentChanges?#

Q: I'm experiencing unexpected behaviour from RecentChanges. It appears that changes to UserPages are not listed there. E.g. in my case, changes to KarelVervaeke would not be listed there. Specific details: I'm using RCS, the 'modified' times on the system match those of the last changes). --KarelVervaeke

A: This is probably a problem due to RCS locking. Please see RCSFileProviderIssues.

Q: Hi... I'm trying to password-protect a interalpage in Wiki. I have read the FAQ's and HowTo's but I havn't seen anything about how to password-protect a particular page. So I tried to change the .../WEB-INF/web.xml:

   <security-constraint>
       <web-resource-collection>
           <web-resource-name>Protected Area</web-resource-name>
           <url-pattern>*Secure_*</url-pattern>
           <http-method>DELETE</http-method>
           <http-method>GET</http-method>
           <http-method>POST</http-method>
           <http-method>PUT</http-method>
       </web-resource-collection>
In this case I want all pages that starts with Secure_ to be password-protected. But it doesn't seem to work. What is the correct url-pattern syntax??? --krille.com

A: The url-pattern defined in the servlet specification is... well, exceedingly simple. I've cursed it more than a few times, myself. A quick google produced a page that presents the facts simply enough: http://www.roguewave.com/support/docs/leif/leif/html/bobcatug/7-3.html. To quote:

URL patterns use an extremely simple syntax. Every character in a pattern must match the corresponding character in the URL path exactly, with two exceptions. At the end of a pattern, /* matches any sequence of characters from that point forward. The pattern *.extension matches any file name ending with extension. No other wildcards are supported, and an asterisk at any other position in the pattern is not a wildcard.

So: sorry, web.xml security constraints won't help you with per-page access restrictions. --ebu

krille.com -- Ok, damn shame. It would be nice to have :)

Yes. The latest 2.1.x does support this with a little twiddling and custom providers; if you can spare the effort and know what you're doing, it's doable. You will risk extra work once 2.1.x becomes stable, though. --ebu

Variables inside templates call and wikitags#

To construct the current page adress and pass it to a cookie, I need the jsp context (edit, view, attach,...), and load it into a variable:

      <wiki:CheckRequestContext context="view">
         <% String monContext="Helloview2"; %>
      </wiki:CheckRequestContext>
Of course, it's seems I cannot use a <% String ...%> inside a <wiki:xx ..> Can someone tell me how to do it ?

--FrancoisParlant

Yes, you should be able to use <%...%> inside other tags. See templates/default/FindContent.jsp for an example. Though if I am guessing correctly what you are trying to do... Wouldn't it be much easier to do in JavaScript?

--JanneJalkanen

With the default filesystem provider JSPWiki translates German characters, e.g. ä ö ... into a %CF or similar sequence when it comes to filenames.

On Windows systems, when you have two of those chars in the filename and with some processing off the record of JSPWiki all characters between the two percent signs can be lost because Windows regards the chars in between as a name of an environment variable that it won't find.

jspWiki on Netware #

I'm trying to run this cool webapp on a Netware 6.0 Server with Tomcat 3.3.
Everything works fine except the edit page function. I get an 'ERROR com.ecyrd.jspwiki.tags.WikiTagBase IT-WIKI:Main - Tag failed' error in the log file. The error page shows: Tag failed, check logs: current thread not owner. I use the VersioningFileProvider. I also mentioned, that in the System the pages i've tried to edit are marked as currently edited.

-- RomanGrossmann

A:Please check the netware and jspwiki logs - there should be additional information there. Add to your question, and we can get a bit closer to the cause. Also, just a hunch - see the next question. --ebu

A:Thanks for your response. I have solved the problem by instaling Tomcat 4.1.27. I have copied the webapp to the 4.1.27 webapps and now it is running. Seems that the interaction between the standard Tomcat shipped with Netware 6 (Tomcat 3.3) and jspWiki triggered the problems.

-- RomanGrossmann

"Tag failed, check logs: ..." error in the browser#

Q: I edited jspwiki.properties, changed the settings for the page provider/attachment provider/something else, but now I just get an error page (Tag failed, check logs: ...).

A: Check your jspwiki.properties settings again, and read the log file (defined at the end of jspwiki.properties). This should elucidate matters. A rather common error is to give a mistyped or plain wrong class name for a provider.

One particular source of confusion is the jspwiki.attachmentProvider setting commentation. The choice of words can be interpreted to mean that you should set the value to nothing, when what you really want is to leave the value empty (or comment the whole line). (This wording is fixed in future versions.) --ebu

EditPageHelp?#

Q: where to find a template for EditPageHelp.jsp to copy it into my tree?

A:It's not a JSP page, it's a page called EditPageHelp in the jspwiki_samplepages.zip.

Problems setting up a hosted JSPWiki site#

Q: I'm having some trouble getting a new wiki up and running at http://www.hydraphonic.info/GrooveWiki/Wiki.jsp As you can see, there is no left menu, and when you select edit, there is no EditPageHelp (it says "Ho hum, it seems that the EditPageHelp? page is missing. Someone must've done something to the installation... ".

Furthermore, the contents of Main.txt are not displayed! It seems as if the application cannot locate my jspwiki.fileSystemProvider.pageDir setting. If I want to set a relative path, where is it relative from? The Wiki.asp or the location of the jspwiki.properties file? If tried it relative from both places (and others) with no joy.

Can anyone tell me what I've done wrong? --Rob

A: ;:Umm, why are you specifying it as a relative path and not an absolute? I don't think using relative paths is a good idea even if it might work in theory. -Killer

Initially because I'm on a hosted server, I thought it might be easier. Since then I've tried various absolute paths also with no success. Has anyone got this wiki working on a hosted server?

Is there a JSP script/page I can run that shows the path. I'm guessing that the path looks different to Tomcat than it does to me.

Also, I've changed the path to be all lower case, in case that was an issue.... --Rob

The server seems to be Linux running Apache and Tomcat. This would mean that the server administrators should be able to tell you the correct absolute path as seen by Tomcat. They might have some chroot-environment set up so that you and Tomcat see the paths differently. Also, Tomcat does not by default like symbolic links, this might also be a problem. -Killer

Hey Killer - it's up and running now. I'm using a path that I'm sure I tried before. I still think the mixed case path may have been a factor. Anyway, thanks for your help. --Rob

Editing on Mozilla?#

Q: Problem Editing a page in Mozilla 1.6b
I'm not able to search a string inside any jspwiki-editing window. I've got no problem doing so with MS IE5.5.
os: w2k, jspwiki: 2.1.87-cvs

-- 16.01.04 rsc

A: This sounds like a bug in Mozilla... Can't do much about it, I'm afraid.

Edit lockouts#

Q: I'm using JSPWiki v2.0.52. *Every* time I edit a page then Save it I get this error "Oops! Someone modified the page while you were editing it!...". What the heck have I misconfigured? When I added this Q to this page, no problems!

FileSystemProvider#

Q: Our admin started wiki with FileSystemProvider, which doesn't seem to do versioning or latch the username. I understand VersioningFileProvider is the best one to use for versioning. We have already put a bunch of pages on, and obviously we don't want to retype them in. Is there a way to retrofit versioning to pages already generated by FileSystemProvider?

A: Yes. Just switch the provider into VersioningFileProvider, and it will automatically use any pages already put there by the FileSystemProvider. No need for any retrofitting.

Building with unit tests using Ant?#

Q: I just downloaded the source code for JSPWiki, and tried 'ant tests'. It failed on four tests:

  • com.ecyrd.jspwiki.providers.FileSystemProviderTest
  • com.ecyrd.jspwiki.TranslatorReaderTest
  • com.ecyrd.jspwiki.FileUtilTest
  • com.ecyrd.jspwiki.WikiEngineTest

Should I be worried about these failures?

A: Um, no. They are actually mistakes in the original source code - if your platform standard encoding is something else than ISO-Latin1, then these tests will fail. They are being repaired in the CVS version.

Apache settings?#

Q: I'm running with a hosted provider who won't let me access my Apache settings. If they aren't running the Tomcat container, is there any way I can use jspWiki? I could probably install Tomcat, but again, I can configure ONLY Tomcat, not Apache.

A: It depends. My ISP runs Apache, and it sends the request to a Resin application server. They configure Apache, I configure Resin. I'd suggest talk/e-mails with the ISP and tell them what you want to do and how they can help set you up. Most system admins are pretty sharp, they should be able to get you going. I'm assuming that someone before you has asked for Tomcat before. If they can't help you out (plug for my ISP 20after4.net) there are other ISP's out there. -- FosterSchucker

Comment: Hi and Thanks, Foster. I'm looking into Astrahosting, which if you sign up for 1 year is $4/month and supports Tomcat. I haven't signed up yet, so I can't comment on their support. They say they only have telnet, no SSH, which doesn't seem right.

Comment2: I've signed up at astrahosting for other reason than JSP. Then I discovered that they were running tomcat 4.1.3. I decided to test JSPWiki on it. First they say the system deploy file.war every JVM restart : false. Then they map any servlet to yourdomain.com/servlet/YOURSERVLET which lead you to web.xml editing (after deploying JSPWiki by hand on the server). At last the context of you JSP/Servlet are different than php/ftp. i.e : You upload a file to /var/www/html then you refer to it through /var/www/html in you servlet but the path is wrong. As if the virtual server you are into while executing ftp, php etc... is not setup correctly while in tomcat. So You can see the whole redhat server filesystem !!! The thing is their support think I'm a newbie (which by the way is not wrong for JSP/Servlet) but their system doesn't work !!!! that's for sure...

Website section setting#

Q: Is there a setting indicating which section of a website a page is in, and is it possible to change the left menu based on the section of a website the user is visiting? e.g. The Apache website - has a distinct left menus for the main pages (section 1), Apache HTTP Server pages (section 2), Ant pages (section 3), etc.

Bulk populate wiki pages#

Q:Is there an easy way to bulk populate the Wiki with the samplepages found in the binary zip file? - AlexMcLintock

A - Yes. Just unzip the zip file contents directly into your page repository and restart the web server or the context.

Modifying wspwiki.properties without restarting container#

Q: I installed JSPWiki. It's exciting. But, I don't konw how I can apply modified jskwiki.properties without restarting servlet container. Shoud I do?

Customising wiki?#

Q: I want to tweak my wiki page for it to work more the way I want it to. I have password restricted the edit page but i want to be able to remove the upload a file link from the view page and add it to the edit page. Also is there any way of removing the paper clip from next to an attachment?
--JC

Yes, replace the images/attachment_small.png with a transparent 1x1 png :-). You can modify the templates at will, I just recommend that you make your own copy of the "default" template and modify that.

-- JanneJalkanen

Portable war file#

Q: Does anyone know of a way to nicely package a wiki in a war so I can move it from one machine to another without having to tweak the property file? It would be great if I could make the dir references in the prop file relative to the wiki's webapp dir. So far from what I've discovered is the relative dirs are relative to the working dir when you start tomcat.

My goal is to lower the barrier to the wiki's use by making the wiki portable so I can send it to someone and they can drop the war in their env and it works without tweaks. Thanks,

AlexSoto - Sept 8, 2003

Does anyone out there have an idea? AlexSoto - Sept 17, 2003

I think the trouble is that if a webapp has been put in a WAR file, it is nigh impossible to figure out where it has been physically located on-disk using the Servlet API. I would love to add such a feature, but so far I haven't been able to find an easy way to do it.

-- JanneJalkanen

Have you tried to get a physical dir of a known resource path via ServletContext then based off that path tack on a relative dir as specified in the properties file? I would have mentioned this before, but I was hoping to find out if someone had an idea that wouldn't require any code changes :)

-- AlexSoto - Sept 19, 2003

Well, yes, but the problem is that getRealPath() will return null if the application is in a WAR file... Which sucks seriously and makes it completely unsuitable to your purpose :-(.

-- JanneJalkanen

Ahh, didn't know that. Since tomcat expands my wars I didn't even think about that. Thanks anyway Janne. -- AlexSoto

One workaround (that should work on most platform and JVM's) is to use one of the pre-defined system properties of the JVM as the base for the Wiki files (such as used.home or java.io.tmpdir). This would require some kind of "start-up procedure" that would copy the default set of pages to this location when starting JSPWiki for the first time.

-- AndersEngström

Unpacked war file installation#

Q - Are we supposed to be able to install JSPwiki without unpacking the WAR file? How do you do that?

A - You can do that. See MultipleWikis for a hint, but it really won't answer your question.

A - Using Tomcat 5, just copy the JSPWiki.war file into the webapps directory of Tomcat. Tomcat takes care of the rest (unpacking etc.). You have to set the path to your data though. -- ReinhardEngel

Password protect specific pages#

Q - Hi... I'm trying to password-protect an interal page in Wiki. I have read the FAQ's and HowTo's but I haven't seen anything about how to password-protect a particular page. So I tried to change the .../WEB-INF/web.xml:
   <security-constraint>
       <web-resource-collection>
           <web-resource-name>Protected Area</web-resource-name>
           <url-pattern>*Secure_*</url-pattern>
           <http-method>DELETE</http-method>
           <http-method>GET</http-method>
           <http-method>POST</http-method>
           <http-method>PUT</http-method>
       </web-resource-collection>
In this case I want all pages that starts with Secure_ to be password-protected. But it doesn't seem to work. What is the correct url-pattern syntax??? --krille.com

A - The url-pattern defined in the servlet specification is... well, exceedingly simple. I've cursed it more than a few times, myself. A quick google produced a page that presents the facts simply enough: http://www.roguewave.com/support/docs/leif/leif/html/bobcatug/7-3.html. To quote:

URL patterns use an extremely simple syntax. Every character in a pattern must match the corresponding character in the URL path exactly, with two exceptions. At the end of a pattern, /* matches any sequence of characters from that point forward. The pattern *.extension matches any file name ending with extension. No other wildcards are supported, and an asterisk at any other position in the pattern is not a wildcard.

So: sorry, web.xml security constraints won't help you with per-page access restrictions. --ebu

krille.com -- Ok, damn shame. It would be nice to have :)

Yes. The latest 2.1.x does support this with a little twiddling and custom providers; if you can spare the effort and know what you're doing, it's doable. You will risk extra work once 2.1.x becomes stable, though. --ebu

ISP with JSPWiki Experience#

Q: I'm using JSPWiki for many different things and I like it very much. Now I would like to use it for my personal website and therefor I'm looking for an ISP with JSPWiki experience. I have tried one, but there I had to configure so many things in a virtual hosting environment, that I finally didn't manage to run it. Unfortunatelly the ISP support didn't now JSPWiki at all and couldn't help me. Does anybody now an ISP with JSPWiki Experience and which isn't to expensive for a personal use?

-- Thanks in advance

I tried with JavaServletHosting.com and there I had to pay US$ 14.-/month. My main problem was, that my local JSPWiki didn't work on the virtual host at all. I got either a HTTP 404 or an 500 error. I had to setup some Apache HTTPD properties to allow the dynamic contant to be passed to Tomcat. Unfortunatly, even with the help of the support, it didn't work. After that the support suggested, that they will pass the user directly to www.mydomain.com/Wiki.jsp but then the page was empty. I also checked the FAQ on JSPWiki and I'm quite sure, that everything was ok with the configuration, for example the absolute path names for the content. Although the support tried to help me, quite fast I was suggested to contact the technical group and this would be very expensive. I think JSPWiki is a great application and I can't imagine, that it's impossible to run it on a regular virtual hoster. Therefor I would like to know, if someone can suggest a hoster, which has experience with JSPWiki, so I can chose this one. I don't want to pay more then 14 - 18 US$.

-- Thanks in advance

A: Details please: Where are you at, an how much are you willing to pay? I would think this is a custom solution, and you will have to pay something for the setup, also JSP-hosting is generally not cheap AFAIK.

~JSPWiki causing Tomcat hang?#

Q: I've been trying for some time to track down why our local wiki hangs almost every morning. And it brings down Tomcat with it. This is running Linux/Redhat 9 and Tomcat 5.0.25 and ~JSPWiki 2.0.52 and MySQL 3 with DatabaseProviderPatch. I tried adding lots of log.debug() calls to the PageProvider but it didn't seem to be hanging inside any of those calls. At one point, I turned off the CacheProvider, and the wiki stayed up for five days and appears to be hanging less frequently. Any ideas on what is going on? (BTW, when it hangs, it hangs badly. Even a tomcat shutdown won't stop the process. I have to "kill -9" as administrator to kill it.)

A: Following up to my own question, after upgrading the machine RAM from 512M to 1G, hangs occur less frequently. Perhaps something about the Linux JDK/Tomcat/JSPWiki combination is causing some memory-dependent resource to be consumed.


Can I redirect Wiki.jsp to a new website?#

Q: We have an active wiki that must be moved to a more stable platform. The new wiki is up and ready for action. However, I'm unsure how to redirect access from the old wiki to the new wiki.
Any suggestions?
-Jim

A: Jim - You might try DynDNS's webhop redirection service at http://www.dyndns.org/services/. I have been using it to simulate a static IP address and it works great....and they have a free version! - RogerPaskett

R: Thanks for the suggestion Roger. Since the wiki in question is on an intranet, I feel the powers that be would frown on my using an external server for redirection. I did have some success in hacking the Wiki.jsp to always resolve to a redirection page. It's not pretty but works pretty well. - Jim

A: In our company we had some static pages on an IIS which kind of served as an Intranet, accessed as http://intranet.companyname.com. So when I introduced some Tomcat-based stuff, like Jira and JSPWiki, I just added virtual directories, selected A redirection to a URL and set the redirect to http://host-running-tomcat:8080/jira$S$Q, http://another-host-running-tomcat:8080/jspwiki$S$Q, etc...
If you can train people to use http://intranet.companyname.com/jspwiki/... in their links and bookmarks, you can move the installations around without causing too much problems.
I'm guessing something similar could be done with Apache.
-- Tom Tréhout - 03/12/04

~JSPWiki disk space problem#

We have a second physical 80GB drive which stores the JSPwiki files of which are currently 1.5GB. The OS drive is 4GB in capacity. The problem is that the JSPWiki files on the data drive seem to be appearing in another form on the OSDrive under Administrator/LocalSettings/Temp. Therefore the OS drive has 1.5GB of JSPWiki files as well. If I delete them from the OS drive, they re-appear after the Wiki is next used. This is causing the OS drive to run out of space. Any ideas on why this is occuring and/or how to get around it?

Relative paths should they work?#

I have adjusted the paths including the pagedir path in my properties file. Still I must always type in a complete URL in order to get what I want. For instance this format: [Pic/update.png] does not work for me. The file is not found unless I put the complete URL inside the brackets. Is this expected? thank you VSvoboda

Moving a Wiki from one server to another#

I have just installed JSPWiki on another server (running oc4j) and i want to move my Wiki from my old server to my new server. I have copied over my files from the file store (as specified in the jspwiki.fileSystemProvider.pageDir setting in the jspwiki.properties file). However on my new server some of my links are broken. They are as if you have just created the links but not the file yet. There are 2 links which do work, these 2 have the page name and the file name actually specified i.e [Main Menu|mainmenu]. However i have a third one defined like this and it cant find the file. THe ones which are not defined like this i.e. [Notes] have the same filename as the display name so it should find the files. I have checked my page store and the relevant files are all there. Do i need to do anything different when moving a wiki from one server to another. Any advice would be greatly appreaciated.
Thanks, Saz

I am trying to setup a counter.#

I would like to set name of counter same as page name. I used following but it didn't work:
''The [{$pagename}] page has been accessed [{Counter name='[{$pagename}]'}] times.''\\

How can I make the URLs friendlier?#

My current wiki urls are like http://mysite/wiki/Wiki.jsp?page=PageName. How can I change this to be friendlier - the way this site is? I would like to able to access it as http://mysite/wiki/PageName. Any help is appreciated. Thanks. - SriramGopalan

A: You want to install ShortURLConstructor or ShortViewURLConstructor. Please see the documentation (2.2+) how to do that.

Jspwiki and tomcat running with security#

I am trying to run JSPWiki on an ISP which runs Tomcat with security manager enabled (-security flag). I get the error: "org.apache.jasper.JasperException: WikiEngine has not been properly started. It is likely that the configuration is faulty." On a local machine it works fine without the security manager but not with the security manager. Is there a configuration setting I can make to the web.xml to fix this (on the ISP there is no access to server.xml)

Login as administrator / Get administrative right#

Q: I'm running JSPWiki 2.4.87 on Tomcat 5.0. How do I log in as administrator? Is it simply a new user in a given role I must add to my tomcat users? If yes, which role must this user have?

A: You can but don't need to use Tomcat to support administrative logins. As you may know, in the $WIKI_HOME/WEB-INF/ directory there are a bunch of config files. In essence, if you use container-managed AAA (set in web.xml), the jspwiki.policy file establishes what rights the various roles have, "Admin" being one role. You need to create an Admin group and then make sure it has the members and the rights you want (the defaults are generally fine to start with) — after creation you'll find the group defined in the groupdatabase.xml file. All of this is described in greater detail on the Security page. Once you've established an Admin group and yourself as a member, you'll have administrator rights everytime you log in. -- MurrayAltheim

Q: Ive done the above, created an Admin group, but I dont get Admin rights and I cannot edit the Admin group although I am member. This is with version 2.6.4, using the default jspwiki.policy. I also created another group and I cannot edit that group either. Also I created a page and did allow edit this_new_group but then I could not edit the page any more.

A: Suggestions appreciated

JNDI Mail Configuration#

Q: I'm running JSPWiki 2.6.x and want to use its new support for container-managed e-mail factories. How to do that?

A: Go to JNDI Mail Configuration

How do I access files outside the Tomcat webapp container?#

Q: I've created a symlink within the JSPWiki container under Tomcat with Linux, which should allow me to create url's to my files outside the container. I can follow the symlink properly with ls, but Tomcat/jspWiki does not seem to resolve the urls and yet the Default Servlet logs that it has delivered the file? What is going wrong?

A: By default, Tomcat will not follow a symlink to a file outside the webapp container. You need to disable this Tomcat security feature for jspWiki


How do i allow anonymous user to add a comment to the page though not edit the page? Answer Me#

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-76) was last changed on 15-Nov-2011 11:51 by xiaochang619