Can I add a java portlet to an existing java Web App?
I'm building a webapp that uses jboss-seam with jsf, facelets and rich faces, running on top of jboss AS 5.1.
I would like to add a portlet area where I could add my own portlets, but from what 开发者_如何学运维I got (reading forums and documentation) I need to be running a portlet container/portal (something like liferay or gatein). But I don't want to be running a portal. I just want some kind of control where I can embed a portlet (something like an iFrame).
Is this true or I got it wrong?
If I'm wrong, how can I add an area to my webapp where I can add a portlet?
Thanks
Best regards.
If you are looking for a JSR 286 (Portlet 2) or JSR 168 (Portlet 1) compliant portlet, what you have read is correct. You need a portlet container. JBoss used to have JBoss Portal that should fit in your stack if you are focused on the JBoss products. In fact, you can find an entire bridge between JBoss Portal and the stack you are using. If you decide that you need a portal and want to look to other apps, I have successfully run Liferay on JBoss in the past.
At the same time, you can get something that looks and behaves like a portlet by using iframes or a div and JavaScript and back-end coding. With more specifics on what you want your pseudo-portlets to do, the community can more specifically help you figure out if wiring your own smaller framework within your existing code or attempting to have some sort of larger portlet container seems more reasonable. If you want to reproduce all of the Portlet 1 or 2 spec, I'd go with the container. If you want to reproduce a mini-iGoogle, you can probably do someting with JS and HTML.
EDIT: Looking through other questions with the same portlet tag, I found the jQuery UI Sortable - Portlets demo that might provide just the portlet-like features you are looking for without an entire Portal framework. It does, of course, pull in jQuery UI.
Frankly, if you're not going to go "whole hog" with portlets, or the portlet you wish to embed is particularly sophisticated, I don't think there is much value to switching over to a portlet container.
With JSF being a component framework, the difference between a "portlet" and a "JSF component" are really more ideological than actually technical (yes, the development model is different, but not dramatically). You likely be better off create a new, high level, JSF component to act as your portlet than bringing in the whole weight and complexity of a portlet container in to your app for a single service.
精彩评论