Including portlet in jsp
Hi,
Is there any way through which I can include the porlet in an external JSP?
If yes then how.
Edited by: axeeeffect on May 14, 2009 12:45 AM
The easiest way is to use a URL item that points to a JSP and
displays it in the folder area. The JSP would run outside of
Portal in it's own servlet container.
You can use a Java Application item type, but you can't make it
display in the folder area.
In the next release of Portal, you'll be able to use JSP to
define a portal page. You will also be able to embed portlets
in a JSP.
Regards,
Jerry
Similar Messages
-
How to include portlet in .menu
HI,
I want to include portlet in .menu means i need to include that portlet to the jsp which is refered by .menu.
Can someone please guide me?
Thanks,
Sanjeev
Edited by: Sanjeev Kumar on Mar 6, 2012 3:02 AMHi..
If you can see some images on push buttons,
Try by checking the filenames with Upper/Lower case , bcos java is case-sensitive.
--DJ -
Dynamic include file in JSP page
<span class="value">Hi
i have index.jsp , this page can include jsp
pages dynamically by passing the name of the page to be included to the
index page with out .jsp , so if i want to include page "code.jsp" i
put: .../index.jsp?page=code , this have to include code.jsp page
i made the following code , but it did not find the file
so can any one help plz ?
String pg=request.getParameter("page");
if( pg!= null && ! "".equals(pg)){
File f=new File(request.getParameter("page")+".jsp");
if(f.exists()){
out.print("file exist");
%>
<jsp:include page="<%=request.getParameter("page")+".jsp" %>" />
<%
}else{
out.print("file not exist");
What does the file existing or not really have to do with it?
You can try it like this:
String pg=request.getParameter("page");
if( pg!= null && ! "".equals(pg)){
String webPath = pg + " .jsp";
String realPath = request.getRealPath(webPath);
File f=new File(realPath);
if(f.exists()){
out.print("file exist");
%>
<jsp:include page="<%= webPath %>" />
<%
}else{
out.print("file not exist");
}Alternatively you could try using a request dispatcher:
RequestDispatcher rd = request.getRequestDispatcher(webPath);
if (rd == null){
// doesn't exist
} -
Include file in jsp not working
Hi ,
I have an include file statement in my jsp file which is not working. Not getting any error message either only the page is displayed without the jsp file included.
My include code looks like this :
<%@ include file ="Includes/hello.jsp" %>Also i tried including an html file or an image in the same place neither of the two displayed.
<!--#include virtual="includes/footer.html" -->
My jsp file is hosted on IISnb123 wrote:My jsp file is hosted on IIS
Hi ,
I have an include file statement in my jsp file which is not working. Not getting any error message either only the page is displayed without the jsp file included.
My include code looks like this :
<%@ include file ="Includes/hello.jsp" %>Also i tried including an html file or an image in the same place neither of the two displayed.
<!--#include virtual="includes/footer.html" -->
My jsp file is hosted on IIS
Check the path you've specified. It may well be;
<%@include file="hello.jsp" %>or
<%@include file="/Includes/hello.jsp" %> -
It is possible to include a page .jsp in another page???
How??
thanksPerhaps you mean a page fragment (jspf)?
If so, see http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/pagefragments.html -
Error when using %@ include file="/test.jsp"%&
UsingNitrox version 2.1 M3 (build 419 06022005):
with jdk version: 1.5.0_03 and Tomcat 5.5.9
This is the error :cry: when using <%@ include file="/test.jsp"%> in jsp:
Severity 2
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files (test.jsp)
It used to work in previuos version of Nitrox. I can't use struts tiles because the tiles content is dynamic (run time) and I need it to be static (at compile time).
Have you encountered this problem? What is the fix? Nitrox bug?
I need your help please,
AlbertoM7,
I found the problem :wink: . In the java Build path having the default (ALL) is not picking up the content of the package. I had to use add multiple and include all the folders and subfolders (many L) in my packages. After that I added *.java and *.properties to select all the java files. Now it is working. I assume this is a bug in Nitrox. The default ALL should include the all the files in the path.
Thanks,
Alberto -
"include directive or jsp:include "
Hi,
Which amongst <%@ include file="header.jsp" %> and
<jsp:include page="header.jsp"/>to be used, when performance is taken into account.Code copy from serverside.com
Is it the same as --> jsp:include and %@ include directive.
Actually, <jsp:include> vs. <%@ include %> is a different story.
<%@ include %> is a "compile-time" include. The included file is inserted into the JSP when the JSP compiles.
<jsp:include> is a "run-time" include. If JSP-1 includes JSP-2, JSP-2 is invoked when JSP-1 executes, and the output of JSP-2 is inserted into the output stream of JSP-1.
The run-time include runs a bit slowly, but can save a lot of system memory, so in general, the run-time include is preferable. Only use the compile-time include if the include code must be in the same page.
For example, if you want to use an include that defines a bunch of tag libraries with the taglib directive, it will have to be a compile-time include. If you just want to insert a standard header and footer in your page, a run-time include will be more effecient.
I hope its enough for you to get an clear cut idea, -
My jsp pages use some endcoding as UTF-8.
When I use <%@ include file="myfile.jsp"%> endcoding lose format UTF-8. But
if I use <jsp:forward page="myfile.jsp"/> it work fine.
Pls tell me use <%@include %>
(I use Jbuilder 6 and weblogic server 6.1)
Thanks .
From http://java.sun.com/products/jsp/tags/12/syntaxref1214.html#8828 (emphasis mine):
page="{ relativeURL | <%= expression %> }"
The relative URL that locates the resource to be included, or an expression that evaluates to a String equivalent to the relative URL.
The relative URL looks like a pathname--it cannot contain a protocol name, port number, or domain name. The URL can be absolute or relative to the current JSP page. If it is absolute (beginning with a /), the pathname is resolved by your web or application server.
You could use a servlet in your "path" attribute and have that servlet read and return the page from a different server; there are ways to do what you want, but <jsp:include> isn't one of them. -
Problems with include where the include is a jsp
Hi ,
I have a typical problem. The iplanet server doesn't interpret the code
from a jsp which is included in another jsp. For eg.
code for main jsp
request.getParameter("username");
<%@ include file="/jsp/ui/left_nav.jsp" %>
processing code.
Now when I start the server and the first time I load this page I get a
dearranged page which has the code of the left_nav.jsp present in the html
output.
On opening this page to edit, when a small modification is made and the file
is saved, a reload of the same page gives the proper output with all the
jsp's interpreted.
Thanks to one and all,
Regards,
GurjitYou definitely want to use a jsp include action, not a directive. The directive
happens at translation time and does not process the requested page. An action
happens at request time and treats the requested page as a new request, thus
including the results of the invoked jsp.
BTW, the include action is the tags that looks line <jsp:inculde
page="included_page.jsp" flush="true"/> or something similar (parameters can
also be specified).
The JSP 1.1 spec has more details. See sections 2.7.5 & 2.7.6 (for the include
directive and a quick comparison of the directive vs the action) and 2.13.4 (for
the include action).
Matt
Gurjit wrote:
Hi ,
I have a typical problem. The iplanet server doesn't interpret the code
from a jsp which is included in another jsp. For eg.
code for main jsp
request.getParameter("username");
<%@ include file="/jsp/ui/left_nav.jsp" %>
processing code.
Now when I start the server and the first time I load this page I get a
dearranged page which has the code of the left_nav.jsp present in the html
output.
On opening this page to edit, when a small modification is made and the file
is saved, a reload of the same page gives the proper output with all the
jsp's interpreted.
Thanks to one and all,
Regards,
Gurjit -
Hide Ajax enabled portlet with jsp form loading
Hi All,
I seriously struck with this problem and any help is appreciated.
Functionality:-
I have 2 portlet in a page portletA(non ajax) and PortalB(ajax enabled and it will just handle the portletA events). For checkbox event on portletA i am submitting PortletB JSP Form through PortletA JavaScript.
PortletB jsp Form consists of only hidden variables, which will be set by PortletA JavaScript. All this is working fine.
Problem:-
My problem is I have to hide PortletB.For this i am using BackingFile preRender method. If I hide portletB then JSP Form is not loading and from PortletA iam unable to get the Form object of portletB to submit.
Even setVisible is not working.
Here is my PortletB jsp Form
<netui:form tagId="ajaxEnabledForm" action="deleteRSAandCMFProfile">
<netui:hidden dataSource="actionForm.userName" tagId="userName"></netui:hidden>
</netui:form>
How to make PortletB invisible with jsp form loading?
Thanks in advance.hi, i don't have the exact solution to your problem, but can suggest you work around.
in portlet b jsp, add <div> tag at the top, and use its style properties to hidden/visible as per your need. from the backing file you can set a request attribute which determines the hiding and showing in the div tag.
you may not be able to control the visibility of title bar. for this, there are two options.
1. you can try to use portlet backing context tile bar and hide title bar from backing file.
2. if this does not work, then define id attribute to div tag in title bar skeleton jsp, and access that div by using id from the portlet jsp and then hide that div tag.
thanks
sampath -
Hello,
We are trying to develop JSR286 portlets in JDev.
Question: Can we design/develop JSR286 Portlet UI in jsp with JQuery?yes ,you can develop JSR286 portlet in jsps but point is -
you need to specify the jquery path in hard coded way -means (absolute path ,not relative path)
jquery src="http://<server>:port/your portlet app context root/jquery path/jquery.js"
In that way jquery will work. -
Problem using custom tag library in portlet's jsp
Hi,
I created a custom portlet (a JSR 168 portlet) and I'm using a tag library that I previously developed. Normally it works fine, but sometimes I get a ClassCastException. Once I redeploy the portlet everything works again. This is Oracle Portal 10.1.4.
Has anybody encountered similar problems?
Here's the exception:
taglib exception:
java.lang.ClassCastException at timecardreminderportlet.html._view._jspService(_view.java:201) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121) at oracle.webdb.wsrp.server.RequestDispatcherImpl.include(Unknown Source) at org.mitre.isis.trs.reminder.portlet.TimecardReminderPortlet.doDispatch(TimecardReminderPortlet.java:108) at javax.portlet.GenericPortlet.render(Unknown Source) at oracle.webdb.wsrp.server.Server.getMarkup(Unknown Source) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.invoke_getMarkup(WSRP_v1_Markup_PortType_Tie.java:224) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.processingHook(WSRP_v1_Markup_PortType_Tie.java:499) at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:230) at com.sun.xml.rpc.server.http.ea.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate.java:153) at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:69) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.webdb.wsrp.server.ContextFilter.doFilter(Unknown Source) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)Hi,
I created a custom portlet (a JSR 168 portlet) and I'm using a tag library that I previously developed. Normally it works fine, but sometimes I get a ClassCastException. Once I redeploy the portlet everything works again. This is Oracle Portal 10.1.4.
Has anybody encountered similar problems?
Here's the exception:
taglib exception:
java.lang.ClassCastException at timecardreminderportlet.html._view._jspService(_view.java:201) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121) at oracle.webdb.wsrp.server.RequestDispatcherImpl.include(Unknown Source) at org.mitre.isis.trs.reminder.portlet.TimecardReminderPortlet.doDispatch(TimecardReminderPortlet.java:108) at javax.portlet.GenericPortlet.render(Unknown Source) at oracle.webdb.wsrp.server.Server.getMarkup(Unknown Source) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.invoke_getMarkup(WSRP_v1_Markup_PortType_Tie.java:224) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.processingHook(WSRP_v1_Markup_PortType_Tie.java:499) at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:230) at com.sun.xml.rpc.server.http.ea.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate.java:153) at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:69) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.webdb.wsrp.server.ContextFilter.doFilter(Unknown Source) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534) -
Changes not immediately viewable when updating portlet related jsps
Hello,
I recently installed the 4.0 portal server and I set up a new portal based on
the following doc:
http://edocs.bea.com/wlp/docs40/portal/devbasic.htm
When I modify one of the jsps that a portlet uses, the changes (when viewed in
a browser) will show up somewhere between immediately and 5 minutes later. I
thought this might have something to do with the "Reload Period" which is modifiable
within the server console, for my portal web application. So, I modified it from
300 to 0, but it still doesn't update right away. Is this "reload period" the
problem? Any other suggestions?
Thanks for any help,
KevinI would suggest that this be made a configuration parameter on the server console.
I would not expect to have to go rooting around in the xml config files for something
that (IMHO) as useful as this.
"Peter Laird" <[email protected]> wrote:
>
Kevin,
I'm glad you found your solution.
This is a common problem. People often wonder why it is not set to a
low number
after an install, since most people will go into development with it.
The problem
is that historically there have been a number of customers who downloaded
the
eval copy, ran huge load tests on the out-of-the-box sample, and then
concluded
the product was too slow. The reason was that the product was configured
for development
(so the server would check the file system for every JSP of every request)
and
thus would not perform well at all. Therefore around version 3.2, the
default
for all settings was switched to favor production and not development.
PJL
"Kevin" <[email protected]> wrote:
Problem solved...the weblogic.xml file has to be modified...look for:
pageCheckSeconds
I changed mine to 1...
"Kevin" <[email protected]> wrote:
Hello,
I recently installed the 4.0 portal server and I set up a new portal
based on
the following doc:
http://edocs.bea.com/wlp/docs40/portal/devbasic.htm
When I modify one of the jsps that a portlet uses, the changes (when
viewed in
a browser) will show up somewhere between immediately and 5 minuteslater.
I
thought this might have something to do with the "Reload Period" which
is modifiable
within the server console, for my portal web application. So, I modified
it from
300 to 0, but it still doesn't update right away. Is this "reload
period"
the
problem? Any other suggestions?
Thanks for any help,
Kevin -
Pass request parameter to portlet in jsp
Hi,
I wrote a simple PDK portlet that passes a request parameter to itself. Integrated in a portal page, the parameter passing works as intended.
Integrated in a jsp using the Oracle taglib, the parameter passing does not work. Here is the code I am using:
<portal:usePortal />
<html>
<head>
<title>Test-JSP</title>
</head>
<portal:showPortlet name="myPortlet" header="false"/>
</body>
</html>
(index.jsp)
<?xml version = '1.0' encoding = 'UTF-8'?>
<?providerDefinition version="3.1"?>
<provider class="oracle.portal.provider.v2.DefaultProviderDefinition">
<session>false</session>
<passAllUrlParams>false</passAllUrlParams>
<preferenceStore class="oracle.portal.provider.v2.preference.FilePreferenceStore">
<name>prefStore1</name>
<useHashing>true</useHashing>
</preferenceStore>
<portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
<id>1</id>
<name>MyPortlet</name>
<title>My Portlet</title>
<description>My Portlet</description>
<timeout>40</timeout>
<showEditToPublic>false</showEditToPublic>
<hasAbout>false</hasAbout>
<showEdit>false</showEdit>
<hasHelp>false</hasHelp>
<showEditDefault>true</showEditDefault>
<showDetails>false</showDetails>
<renderer class="oracle.portal.provider.v2.render.RenderManager">
<renderContainer>true</renderContainer>
<renderCustomize>true</renderCustomize>
<autoRedirect>true</autoRedirect>
<contentType>text/html</contentType>
<showPage>/jsp/show.jsp</showPage>
<editDefaultsPage>/jsp/editdefaults.jsp</editDefaultsPage>
</renderer>
<personalizationManager class="oracle.portal.provider.v2.personalize.PrefStorePersonalizationManager">
<dataClass>oracle.portal.provider.v2.personalize.NameValuePersonalizationObject</dataClass>
</personalizationManager>
</portlet>
</provider>
(provider.xml)
What did I do wrong?
Regards
ThomasI forgot to mention that the jsp is external and that I am using Portal 10.1.2.
With internal jsps the parameter passing works fine.
Amazingly portletRenderRequest.getRenderContext().getPageURL() contains the request parameter. It would be possible to extract it from the url. But I really don't want to do that. -
Hi,
I am trying to include a html file in a JSP using the tag...
<%@ include file="Header.html" %>
When I keep Header.html file in the Web Server root its not able to include the file and gives an error saying "unable to load the resource.... PropertyResourceBundel error". But when i copy the same html file on the the ApplicationServer root its picking it up and gives me no error.
Can any one help me out what could be the problem.
Thanks in advancehi
the path given in the include tag should be
relative to the JSP page from which you are
calling it. that means the mentioned thing
will work if both the files are in the same
directory. otherwise you have to give the
path where the included file resides.
About the webserver and App. server thing,
i am not sure. may be more information about
the same can help. like the servers which
you are using and all..
Paragk
Maybe you are looking for
-
I have a Mid 2009 15 inch MacBook Pro with 2.53 GHz Intel Core 2 Duo and 4 GB 1067 MHz DDR3. Can this MacBook be upgraded to 8GB? If so, what type would you recomended
-
How to pass variables between loaders
Hi, I am trying to load an image, with descriptive text and a back button on the click of a thumbnail of the image. I am using a MovieClipLoader instance to do this. Here are my problems: 1. I tried loading the image, with the text(which is within an
-
I just ran this program here: http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0604kesic/#java but my performance when generating a cypher is on avg. 2750 ms compared to 407 ms as listed on the web page. Can some else confirm that the
-
I'm trying to put these functions into a Loop to conserve space. Why won't this work? .
-
6.1 NPD - Project Name and Status not showing in the Project Header
I have this issue in 6.1 NPD - The NPD Project Name and Status is not showing in the Project header when opening a project. Any ideas? Thank you.