How to "include" another page or servlet in a standard servlet
How can I achieve a "include" in a servlet?
From what I see... the include() method is on the PageContext class, which is in org.apache.somewhere... right??
Or am I missing something?
thanks
How can I achieve a "include" in a servlet?
From what I see... the include() method is on the
PageContext class, which is in org.apache.somewhere...
right??
Or am I missing something?
thankshttp://java.sun.com/webservices/docs/1.0/api/javax/servlet/RequestDispatcher.html#include(javax.servlet.ServletRequest,%20javax.servlet.ServletResponse)
Similar Messages
-
How to include html page or html code in adobeflex 4 web application please give me a solution.
Thank you
Chandra Sekharhi,
go thru this link, may be of some help for you
About IFrames
http://www.deitte.com/archives/2006/08/finally_updated.htm
IFrame Src
http://code.google.com/p/flex-iframe/
About the IFrame Approach
http://www.deitte.com/archives/2008/07/dont_use_iframe.htm -
How to include HTML page on a screen
Hi,
How to include HTML page on a module-pool screen. i want to handle hyperlinks on that page. how ca n i do that?....plz send me reply vvvery fastHi Amarnath,
1. RSDEMO_HTML_VIEWER
Check the above program.
Regards,
Amit M. -
In a jsp page how can i include another page from differenct web context
Hi,
i want to include a page from another web content to my page. How is it possible. For example in a jsp page i want to include "http://www.google.com". How is it possible. can i use <jsp:include tage for this purpose? any idea?
Edited by: JavaHeroPrince on Apr 2, 2009 12:05 AMI'm afraid you cannot do that using <jsp:include/> tag.
However, you can achive this using <c:import/> tag which comes with JSTL core tags.
Please find the below example of how to go about.
<%@ taglib uri = "http://java.sun.com/jstl/core" prefix = "c"%>
<c:import url = "http://www.google.com/search">
<c:param name="q" value="c%3Aimport+jstl"/>
<c:param name="rls" value="com.microsoft:en-us"/>
<c:param name="ie" value="UTF-8"/>
<c:param name="oe" value="UTF-8"/>
<c:param name="startIndex" value=""/>
<c:param name="startPage" value="1"/>
</c:import>
-------------------------------------------------------------------------for more info
[http://java.sun.com/developer/technicalArticles/javaserverpages/faster/]
Hope that helps :)
REGARDS,
RaHuL -
How to populate another page item based on cascading select lists?
Oracle 10gXE
APEX 3.2
I've created cascading select lists based on the examples (using Javascript and AJAX) that i've seen on this forum. Thanks for help on that!
Now that I have these LOV's being populated without needing to submit the page, how do I take the value that is presently in each LOV and concatenate them together to populate another page item? I'm trying to build the URL string that will execute an Oracle Report once the user clicks a button.
Previously, when I had multiple Select Lists with a submit, the URL was being put together using an After Submit Computation that would set the value for an item (P26_REPORT_URL) on the page. Notice that a report parameter (i.e. parameter name and Select List value) is only included if the user has provided a value. The page item that holds these values is then referenced by a button for URL redirect. The URL Target for the button currently is: javascript:popupURL('&P26_REPORT_URL.'), but will not work at the moment because P26_REPORT_URL page item is not changing based on what is selected in the LOVs. Since I'm not submitting anything (do I need to?), how do I put together the values needed?
Computation for P26_REPORT_URL:
DECLARE
l_param VARCHAR2(2000);
BEGIN
l_param := '&REPORTS_URL.&report=&P26_RPT_VIEW..rdf&desformat=&P26_DESFORMAT.&destype=cache';
IF REPLACE(:P26_OLO_CODE,'%'||'null%',NULL) IS NOT NULL THEN
l_param := l_param||'&p_olo_code=&P26_OLO_CODE.';
END IF;
IF REPLACE(:P26_BEG_DATE,'%'||'null%',NULL) IS NOT NULL THEN
l_param := l_param||'&p_start_dt=&P26_BEG_DATE.';
END IF;
IF REPLACE(:P26_END_DATE,'%'||'null%',NULL) IS NOT NULL THEN
l_param := l_param||'&p_end_dt=&P26_END_DATE.';
END IF;
IF REPLACE(:P26_ORG_CODE_2,'%'||'null%',NULL) IS NOT NULL THEN
l_param := l_param||'&p_org_code=&P26_ORG_CODE_2.';
END IF;
IF REPLACE(:P26_FLAIR_ORG_2,'%'||'null%',NULL) IS NOT NULL THEN
l_param := l_param||'&p_flair_org_code=&P26_FLAIR_ORG_2.';
END IF;
IF REPLACE(:P26_BUDGET_ENTITY_2,'%'||'null%',NULL) IS NOT NULL THEN
l_param := l_param||'&p_agy_code=&P26_BUDGET_ENTITY_2.';
END IF;
RETURN l_param;
END;Andy,
This is a great suggestion! After I posted, I started looking at a Javascript solution and figured it's probably what I had to do.
However, now the cascading select list no longer working for some reason after I added the function to concatenate the item values. When I remove the showReport() function the select list works again.
Here is what I have in the HTML Header portion of the page:
<script language="JavaScript" type="text/javascript">
function popupURL (url) {
w = open(url,"winLov","resizable=1,width=800,height=600");
if (w.opener == null)
w.opener = self;
w.focus();
function showReport()
var l_param = '&REPORTS_URL.&report=' + $v('P26_RPT_VIEW') + '.rdf&desformat=' + $v('P26_DESFORMAT') + '&destype=cache';
if ($v('P26_OLO_CODE' != '')
l_param += '&p_olo_code=' + $v('P26_OLO_CODE');
if ($v('P26_ORG_CODE_3' != '')
l_param += '&p_org_code=' + $v('P26_ORG_CODE_3');
popupURL(l_param);
function get_AJAX_SELECT_XML(pThis,pSelect){
var l_Return = null;
var l_Select = $x(pSelect);
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=ORG_SELECT_LIST',0);
get.add('TEMPORARY_ITEM',pThis.value);
gReturn = get.get('XML');
if(gReturn && l_Select){
var l_Count = gReturn.getElementsByTagName("option").length;
l_Select.length = 0;
for(var i=0;i<l_Count;i++){
var l_Opt_Xml = gReturn.getElementsByTagName("option");
appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue)
get = null;
function appendToSelect(pSelect, pValue, pContent) {
var l_Opt = document.createElement("option");
l_Opt.value = pValue;
if(document.all){
pSelect.options.add(l_Opt);
l_Opt.innerText = pContent;
}else{
l_Opt.appendChild(document.createTextNode(pContent));
pSelect.appendChild(l_Opt);
</script> -
Q: how to include a page in a region
Hi all,
i need some help
how to include the URL of a page in a region, my requirement is that i have some links in the page and i need when i press a link a region under it will be rendered below it not in another page
the links is ready and the pages is ready
just i want a the region to contain a url based on the selected link.
i know how to make a region rendered or not.
and i have tried to use URiInclude but i couldn't figure out exactly how to do it
i have also searched the forum and i couldn't find something about it.
so please if any one knows the solution or can provide me with a link, i will be very thankful
thanksuser604057,
Technically you can't add a page to another page. A page can have only one pagelayout region. So you will have to make a copy of those pages as regions without a pagelayout region and use.
--Shiv -
How to include images into a servlet
Hi guys,
I found out that I can't include both the "setContentType("image/gif")" and the "setContentType("text/html")" in a servlet. I've tried different methods, but I can't get it right.
Could anyone tell how to do that...?
Thanks...I beg your pardon? You want to send text and image in the same response? Can't be done. If you go and look at pretty much any HTML page on the web you will see how to include images in HTML.
-
How to include jsp page in jsf ???
Hi,
I use JDeveloper 11g and the framework ADF. I want to include a jsp page in another page ( jsf page).
In fact, I do this :
<f:view>
*<jsp:include page="/Menu/MenuGlobalDynamique.jsp"/>*
</f:view>
when i run my jsf page nothing is displayed and i have this error :
javax.servlet.ServletException: Erreur OracleJSP :
oracle.jsp.parse.JavaCodeException: Ligne n° 19, oracle.jsp.parse.JspParseTagDeclaration@cf767d <br>Erreur : Java code in jsp source files is not allowed in ojsp.next mode.
at oracle.jsp.runtimev2.JspReportUtil.reportException(JspReportUtil.java:180)
at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:692)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:379)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:722)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:646)
Have you an idea to help me and resolve my problem.
Thank you.Hi,
Can you post the source of the MenuGlobalDynamique.jsp page?
if MenuGlobalDynamique.jsp is a JSF page and you want to include it into other JSF page you must mark out (or delete) this parts from the MenuGlobalDynamique.jsp like here:
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces"
xmlns:afh="http://xmlns.oracle.com/adf/faces/html">
<jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<!--
<f:view>
<afh:html>
<afh:head title="impForm">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</afh:head>
<afh:body>
<af:messages/>
<af:form>
-->
<!--
</af:form>
</afh:body>
</afh:html>
</f:view>
-->
</jsp:root>regards,
Branislav -
Hi,
How an external jsp or html page can be included within a servlet.
like, One servlet is including different pages within it's body based
different condition and arggument passed to it.
Hope for your help.
Thank you.Thanks KP for your reply.
I dont want to jump to different page but wanted the same servlet
that could include different page on conditions.
Ex. if your logged in it will show your company details with the middle
of page with all the 'page-side' contents(menu , banners etc) around it.
Now this same servet will include the login page in the same middle of page, when you need to login.
Hope this could explain what i want not how i may make a login system.
Hope to hear you again.
~_~ -
Include jsp page within servlet
Hi,
How an external jsp or html page can be included within a servlet.
like, One servlet is including different pages within it's body based
different condition and arggument passed to it.
Hope for your help.
Thank you.Thank You for your help.
I have sucessfully slove the problem. I am awarding you full 10 duke
dollors for it. I have anthoer problem about applets is listed in
Applet devlopment under 'Applet to access html controll' title.Please
visit that if you like to participate.
For ee8prt, i had same problem as i was using jsdk2.0 which dont have the despatcher class. user higher jsdk.
Happy coding. -
How to include the page dynamically in JSF
Hi all
Below is static include
<jsp:include page="../inc/sideMenu.inc"/>
How to include the file dynamically
ThanksHi,
Though I have not tried it I think making use of a variable to hold the page name to be included should work. Could you try this and see if it works?
Cheers
Giri :-) -
How to include the pages dynamically in JSF
Hi all
Below is static include
<jsp:include page="../inc/sideMenu.inc"/>How to include the file dynamically
Thanks
SudhakarHi,
Though I have not tried it I think making use of a variable to hold the page name to be included should work. Could you try this and see if it works?
Cheers
Giri :-) -
How to include a page conditionally ?
Hi all !
I have a web page made of different sections. Every section is included in a separate page.
<f:view>
<h:form>
<%@ include file="filters.jsp" %>
<%@ include file="dataTableAdmin.jsp" %>
<%@ include file="modalPanel.jsp" %>
</h:form>
</f:view>Now I have the requirement that some sections should be visible only to the admin users.
The roles are referenced in a Bean registered in faces-config.xml.
How can I include a page depending on the value of the Bean ? I'd need something like the "rendered"
attribute on the "include" tag, but I'm afraid it doesn't exist......
Do you have any suggestion ?
Thanks alot
FrancescoPut the include into a panelgroup and use the rendered attribute...
-
How to load another page in a frame?
Hi!
I have a frame with a page where is a button. I need to load another page in the frame when I click the button. How can I make it on the ADF? I work on JDeveloper 10.1.3.4.I found example. Thank you for help. Refresh works very well! This code:
protected void refreshPage(String refreshpage) {
FacesContext fc = FacesContext.getCurrentInstance();
ViewHandler ViewH = fc.getApplication().getViewHandler();
UIViewRoot UIV = ViewH.createView(fc, refreshpage);
UIV.setViewId(refreshpage);
fc.setViewRoot(UIV);
refreshPage("/transfers/ClaimForm.jspx"); -
HOW TO CALL ANOTHER PAGE USING PL/SQL PDK?
Hi,
I am using pl/sql pdk to create portlets. When I need to call
another page I am using wwpob_page.show(p_pageid) but instead it
displays File Download wizard.
Anyone knows workaroud for this?
Are there any other ways to call other pages with portlets from
pl/sql portlets?
Thank you,
yaHello Yuri
If you want to call any component of an application from PL/SQL
you have to take a look to the manage of the component and then
to Call Interface (Show), There you can see the way to call the
component, but if you want to call a Page the way I found to do
it, even thought it is not the best, was put an url like
this /pls/portal30/url/page/PAGE_NAME on the link.
I hope this could help you, if you dont understand please let me
know and I'll give you a hand
Ana Maria
Maybe you are looking for
-
Urg: How to compare the no. of records of 2 fields in 2 different tables?
Hi, I have two internal tables namely itab_lqua and itab_z9snt. in itab_lqua I have a filed called lgpla. in itab_z9snt I have a field called srlnr. Now I want to compare the no. of records in itab_lqua-lgpla and itab_z9snt-srlnr. Please provide
-
How to transfer iPhoto library into another existing iPhoto library?
Hi. I need to transfer iPhoto (the whole library - created folders and the events the way they been downloaded from camera) from Imac iPphoto to an existing MacBook iPhoto library. I did find in here how to transfer the entire library to the new comp
-
Using Custom Converters with Custom Components?
Hi, I have written a Custom component. I wanted to attach Custom Converters and Custom Validators to this component. <custom:comp1 id="test" rendered="true" size="20" value="#{bean1.val}"/> I have written the following code in Custom Component class
-
Trying to print from my iPad. All other computers in the house are PC-based. Printer is an Ethernet connected and addressable HP multifunction printer. So how do I print from my iPad to a network printer? It takes less than a minute to enable this pr
-
When I place a FPO in CS2 & CS3 ver. 5.0.3, make postscript file, then distill to a pdf, the FPO becomes a lo-res 72x72 dpi image instead of it containing OPI information for it to swop out with the hi-res. It worked correctly in versions 5.0.0 & 5.0