![]() |
|||||||
Homepage | SF Summary | Download | Mbuyu | ![]() |
||||||
![]() |
|||||||
PHPBB2servlet - Java J2EE forum intergrationWhat is this?What is the exact use for this? Is there an example available? What do I need to run the example? How do I use the servlet in my own application? What are the future plans? Why was this implemented? ![]() What is this?Phpbb2servlet integrates a PHPBB2 forum into a J2EE application or website. This means a bridge is being made between the PHP and Java world. What is the exact use for this?There are two possible uses for this (they can be combined of course)
For 2) The J2EE application needs to provide a top header and a footer (bottom) include. Typically, a lot of J2EE applications already make use of this kind of includes. If one or both of these make use of relative links, then they possibly don't work anymore when they are used for the path onto which this servlet is mapped. Many J2EE applications solve this problem, by setting their own base in the HTML head. However, when setting such a base the PHPBB2 links don't work anymore, since they won't be mapped to the servlet path anymore. E.g. When the base of a J2EE app is set to www.example.org and this servlet is mapped to /forum (so it becomes available at www.example.org/forum), then all PHPBB2 links (like showtopic), will wrongly point directly to www.example.org. Therefore, this servlet supports setting this base and adjusting it for PHPBB2. To aid in this, some example code has been provided that makes use of this feature. Is there an example available?The source code comes with a very basic J2EE 1.3 based web application. This web application demonstrates the user authentication and the J2EE 'frame' that surrounds the forum. As an example, the M4N forum (in Dutch) is chosen, but by changing the web.xml, any PHPBB2 forum can be used. What do I need to run the example?
We tested the code on Tomcat 5.5 and used the Eclipse/MyEclipse environment for development. If you use that same environment, you can simply extract the archive, import in into Eclipse and deploy it to Tomcat. Using MyEclipse you have to enter a deploy location. This is the location where the sample application is mounted on your website. You can enter /phpbb2servlet here. If that doesn't work, edit the .mymetadata file in your project root (use the resources perspectice) and add the following attribute: context-root="/phpbb2servlet" . After making this modification, you have to restart Eclipse.
How do I use the servlet in my own application?Simply download the .jar file in the download section without the _proj or _src suffixes. Put this somewhere in the classpath of your J2EE application. This is typically WEB-INF/lib. Look at the web.xml provided with the example application and copy the servlet and servlet-mapping tags (declarations) to your own web.xml file. Naturally, you may have to adjust certain parameters for your local situation. What are the future plans?
We intend to stabilize the code first. Initial testing confirms that it
worked on our own forum, but we need to test some more situations. Why was this implemented?Phpbb2servlet was originally implemented as part of the M4N product. For this J2EE web application, a forum was required that intergrated nicely with M4N, both visually as functionally. Since there are not a lot of J2EE fora available, we decided to adapt the excellent PHPBB2 forum. | |||||||
![]() |
|||||||
PHPBB2servlet - Java J2EE forum intergration
|