I have been struggling while trying to integrate JForum with existing webapp.
I have tested some scenarios(which I'll describe), done a lot of google searches without success. I'll describe what I would like as final result, as well as what I have been doing in order to reach the goal.
The inmediate solution to my problem is the one that I will take as last solution, which is a link with target attribute to open in a new window.
n a v b a r
left content right
My goal is to display JForum content in content without Portlets.
My thoughs were:
1) Intercept all .page call. (implemet filter or extending from net.jforum.util.legacy.clickstream.ClickstreamFilter)
Inside Filter code and before calling chain.doFilter(...) or super.doFilter(...):
2) Store requested uri(eg. /forums/list.page) in request scope. Forward to (or Include) a .do struts action. Why? Because the app custom struts request processor makes db processing that will store dynamic data in request scope to be displayed in header, navbar, .....
3) At this point doFilter method hasn't been called yet.
struts processing takes place and all .jsp forwarding is OK. The forward is explicitely set to a .jsp page instead of a struts tiles definition entry.
.jsp page is itself a tiles definition similar to that one used by struts but content definition is always an include to "/WEB-INF/pages...../wrapper.jsp"
4) wrapper.jsp is a simple page that only includes the following code:
This approach was raising some page not found errors when using resin 2.1.16(Servlet 2.3/JSP 1.2 compliant) because filters cannot be applied to forwarded or included pages already called from inside a filter. But, good news, Servlet 2.4/JSP 2.0 specification does that and that is why I ported my app to tomcat 5.5.17.
So after 4) is executed the same filter is executed again, but with new param "wrapped" setted to 1. This is used to avoid a calling same flow.
5) Inside same Filter:
if wrapped parameter == "1"
Does never work, I'm able to see as result:
my app layout and
in content but no JForum result is displayed. I'm suspecting that Servlet controller for .page pattern is never called.
I also tried step 5)
5) if wrapped parameter == "1"
This makes another call to same Filter but with wrapped param setted to another value and then in 6)
Hello all of you!
I tried to find something that is fit well to my problem but I didn't find. This topic is almost what I need but I haven't any solution here.
So, what orly said is realizable but I don't understand if it's working or not. Additionally, this approach is not very nice because for each request you have to do 3 redirects which cost performance when this criteria is critical.
In my case I'm using JSF with some templateing system.
I have a layout like this:
.header, .left_menu. and .footer. are templates generated with JSF and in the main area I want to inject JForum.
I thing that the most suitable approach is to generate a response for JForum servlet and after that to put it in my templates (how orly creates).
The question is if this approach works and, if yes, why we need 2 redirects to receive the write page and it is not enough only one. [originally posted on jforum.net by istef]
I found a solution for this problem. Maybe someone will be interested about this or maybe you, Rafael will interest you because I modify a little bit the source code.
1. I put clickstream-jforum filter to point to .jpage (in web.xml).
2. I create a new filter that points to .jpage.
Filter method is
3. forum.jsp is something like this
forumBean is a small JSF bean that takes from request attribute "request.url" the link to the forum and puts in jsp. This may be done also through a scriptlet into JSP. After that this jsp will be rendered with the forum page inside it.
4. Modify in SystemGlobal.proerties servelet.extension = .jpage
5. Small tweak in JForum in ActionServletRequest. There you need the real suffix for servlet, with other words you need to put .page instead .jpage. In my site I created a new property in SystemGlobal.properties that take care only for that class.
That's my trick to put JForum into a template. I hope that will be usefull for others and I explained correctly.
@Rafael Maybe it will be usefull for the next version to make 2 properties in SystemGlobal.properties just for this case and to add some support for templateing stuff. Anyway thank you for this wonderful JForum. [originally posted on jforum.net by istef]
Although I haven't had time to implement SSO and some other details.
Custom app uses Struts
idea is to redirect .page calls to custom .do action that will execute my own request processor (and db calls to update header, left menu,...) then in content code for this custom .do action, it will include same .page request and this time .page request won't be intercepted by filter (the one that forward to custom .do action)
Hope this help,
Orlando [originally posted on jforum.net by orly]