| Question | How to change the home page destination when you enter http://localhost:8080/xwiki |
| Answer |
Since XE 1.5M2Using a Redirect on Main.WebHomeThis is the simplest of all. Edit Main.WebHome and type: $response.sendRedirect($xwiki.getURL('Space.Page')) where Space.Page is the page you wish to redirect to.Using the Redirect ServletEdit WEB-INF/web.xml, locate the section with the servlet responsible for the redirect (the one with the line <servlet-class>com.xpn.xwiki.web.HomePageRedirectServlet</servlet-class>), and change that section to contain something like:<servlet> <servlet-name>redirectHomeServlet</servlet-name> <servlet-class>com.xpn.xwiki.web.HomePageRedirectServlet</servlet-class> <init-param> <param-name>homePage</param-name> <param-value>bin/NewHomeSpace/NewHomePage</param-value> </init-param> </servlet> Before XE 1.5M2Since the above setting for the homepage redirect servlet was recently introduced, in older versions of XWiki you must alter the source code and recompile that class. For this, you must first checkout the sources, alter com.xpn.xwiki.web.HomePageRedirectServlet and build the modified classes, then copy the resulting class to your installation (in the WEB-INF/classes/com/xpn/xwiki/web/ directory). You only need to copy one class. It is better to checkout the sources for the exact version you are using, in order to ensure maximum compatibility, although any version should work fine. An easier way is to copy a recent trunk version of this class and then configure it as described above. This class does not have other dependencies on the XWiki platform code, so you don't have to upgrade the whole platform.The other alternativesUsing the redirect servlet is not the only way to accomplish this. You could also (in order of "cleanliness"):
|
Version 6.2 last modified by Vincent Massol on 01/12/2008 at 13:59
Document data
Attachments:
No attachments for this document
Comments: 1