How to put dynamic content into portlet. - Oracle Application Server Portal

I had created an application using BC4J which consist of dynamic
jsp pages. May I know how to put the jsp pages into a portlet?
Any tools that I can use to do it? Thanks.

Have a look at
There are examples on how to use your JSPs (including BC4J,
JavaBeans, etc) as portlets. Basically, the conversion to a
portlet takes three lines of code for a JSP. The rest is
tweaking for look-and-feel and security.
I'd recommend looking up the code for the Hello World JSP in the
samples that ship w/ the PDK-Java.


Using a template engine in a portlet, possible?

Hi there,
When developing servlets I've always used webmacro as a template engine,
separating the code (java) from the layout (html). With Portlets it seems
that people put their html within the java code.
Are there any template engine solutions available for portlets, besides
jsp ofcourse. I'm not really familiar with jsp, and also isn't jsp doing the
same thing, putting java code within the html?
I read it was possible to use webmacro without a servlet container, so
perhaps this is the way to go using it with portlets. But are there also
any integrated solutions.
Does anybody have any experience separating their code and layout using a
template engine? eg webmacro, velocity
How do other developers do this, do you use jsp, or put your html directly
into your code?
kind regards
Hi Ido,
If you can do it in a servlet, then you should be able to do it in the portlet too. You need to specify the servlet for the showpage information in your provider.xml file.
As long as all the HTMl is getting generated upfront (at the Servlet side) then you should not have any issues.
Let me know if you have issues doing it this way.

Calling struts application within a portlet

Can anyone explain step wise procedure to call struts application within a portlet.or refer any tutorial for this. 
A Struts Application is just another J2EE Web Application - any Struts application has an entry point ( a Servlet, JSP, etc. ). You just need to use the URL of the Servlet or JSP & call the application. If you are using a HTML portlet, you could even try IFRAMES.
Are you facing any errors / exceptions when you are trying to achieve this ?
Do you want to call the application home page from a portlet or you want to deploy the struts application to the portal server.
If you want to call from portlet then you can call from a portlet.
If you want to deploy then you have to create your application into ear file and deploy that into the portal server.
If you need more info reply back.
I have successfully deployed a simple customer registeration struts application to Portal Server and able to see default JSP form page in a portlet-area.
But on clicking submit button - the required result page getters full browser-page area. I want this output to be displayed within that portlet area where default page was displayed.
Thanks in advance.
Reply Soon. 
Hi Amir,
If it's a search result, one solution I can think of is to use some kind of custom pagination in your code & limit the results.
this might be because you are using the plain struts taglibs. you should use the pdk-struts taglibs. more specifically, you should use the pdk-struts-html taglib instead of the struts-html lib, as the latter renders URLs for a struts application whereas you need portal-enabled urls, which are provided by the pdk-struts-html lib.
You can either change the taglib reference in your web.xml file to map the plain sruts-html.tld to the pdk-struts-html.tld (don't forget to include it and its jarfile in your deployment file), or you can add the library to every jsp page and replace the <html:whatever> tags by <pdk-html:whatever> tags. (or your other favourite prefix).

JSF using javascript

I have a JSF portlet running on WLP 10.3.2. is it possible to embed javascript in the portlets JSP? I can add javascript in the portlets dependenices file, but I need to run some javascript from within the jsp directly. When I add javascript directly in the JSP it does not get called.
You can add javascript within JSP or dependencies, but make to sure to give functions to use the name space. You go through the following white paper for best practices.


Hi All!
I just want to clarify one thing regards building portlets using web existing application or java components. When you say that it is possible to build a portlet based on a web application, it does not mean to run the application inside the portlet,does it? I ask this because Portal hasn't have form inline submission feature yet, as the majority of web applications is form submission based, I can't have my existing apps running inside portlets, I mean, when the user submit the form he goes out of portal. Am I right?
I also need suggestion. I have java web applications that have jsp pages and classes developed based on MVC pattern. I've already known that forward tag doesn't work in this PDK v2, even if I use the next_page parameter, so I don't know how to have these application running inside portlets. Running inside the portlet is a requirement and I'd like not to change the codes already developed to adapter portal environment.
Thanks in advance. 
One solution could be using IFrame portlet, if we are not concerned
about the browser version limitation.
Are my conclusions about the inline rendering of web existing application rigth?
I can't use iframe because it is a internet portal, so my users can use different browsers.
Thanks anyway!
You are correct to certain extent on inline rendering. You can definitely do form inline submission. There is a sample available on PDK that uses private portlet parameters, for form inline submission. You can develop your own portlets having form inline rendering feature.
Regarding, IFrame Portlet you are correct as there are many users who may use different browsers which may/may not support iFrame.

Navigation inside portlets

I'm from Brazil and I'd like to know if you could help me with integration of jsp applications on Oracle Portal.
My problem is: I have jsp applications that calls others jsp pages or new browsers windows (i.e. Lov windows). I'd like to publish these applications by using a portlet with a menu of links to these
applications. However, I need that the navigation inside these pages be
inside the same portlet, or better, inside another portlet. It means I don't want to lose the navigation for my Portal page, because the user can't feel it is external from my intranet. Is it possible?
Thanks in advance for the attention!
You can use the multipage example in the PDK technical library as a reference for this. 
Sorry Steven, but I couldn't find this example, neither this library. Would you mind if you send me a link to them?
Caroline, I just looked at PDK May and the multipage sample steve refers to is included in pdk/jpdk/provider/sample/provider.xml
This sample demonstrates an easy way of displaying multiple pages within the same portlet using a pre-defined parameter name.
links in your initial 'page' include this parameter with the value set to the name of the JSP that should be rendered when that link is clicked.
If this is too restrictive, you could create a single 'master' jsp that reads one or more parameters. Based on those parameters you could conditionally include other JSPs (using the JSP include tag) in your 'master' to render the different pages you need.
Hope this helps