Include dynamic pages
Hi i have a jsp page(page1) which includes another jsp file (page2), but the name of (page2) jsp file is dynamically generated. I tried using <jsp:include="<%= variable %>" />, but it's not including the page2, it's giving error.
Please check the below example
<%@ page language="java" %>
<%@ page import="oracle.apps.apt.aptWebHomeNews" %>
<%
aptWebHomeNews lHomeNewsObj = new aptWebHomeNews();
lHomeNewsObj.getBrandInfo(_connection,gBrandNameStr);
String lNewsPageStr="";
String lErrStr;
lNewsPageStr = lHomeNewsObj.getPageName();
lErrStr = lHomeNewsObj.getStatus();
lNewsPageStr = lNewsPageStr + ".jsp";
%>
<table >
<tr height="20" > <td> </td> </tr>
</table>
<table width="272" cellspacing="0" cellpadding="0" border="0">
<% out.println("lNewsPageStr is " + lNewsPageStr); %>
<jsp:include page="<%= lNewsPageStr %>" />
<%-- @ include file="aptFndIncNewsComm.jsp" --%>
<tr>
<td align="center" width="270">
<table width="270" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="270">
<%@ include file="aptFaqInccatsolnpop.jsp" %>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height=30>
</td>
</tr>
</table>
Could anyone let me know what is the issue.
Thanks,
Raj.
1. Please make sure that dynamically generate jsp is available in $OA_HTML
The <jsp:include> element allows you to include either a static or dynamic resource in a JSP page. The results of including static and dynamic resources are quite different. If the resource is static, its content is included in the calling JSP page. If the resource is dynamic, it acts on a request and sends back a result that is included in the JSP page. When the include action is finished, the JSP container continues processing the remainder of the JSP page
Hope this helps.
Thanks,
RK
Similar Messages
-
Including a form on a dynamic page (ORA-01036)
I created a form based on a proceedure. I also created a dynamic page which consists of:
DECLARE
BEGIN
PORTAL.wwa_app_module.new_instance('1235532770');
END;
When this dynamic page is run in development using the "Run" buttons, it works. When I include it on a portal page as a portlet, it errors with this error:
ORA-01036: illegal variable name/number
Does anyone have an idea as to why? I am sure it has something to do with context and/or the URL parameters, but don't know where to start.Using javascript, you could wrap the included page within a DIV tag or SPAN tag that is initially not visible. Then when the user clicks the button you would make the hidden DIV or SPAN visible.
The visibility attribute can be set to visible (to see it) or hidden (to not see it). Here's a page that might shed some light:
http://www.csctce.com/demos/dom_tutorial/
HTH -
Using .js file in dynamic page
In 9.02 i created a portal dynamic page. I would like to include .js file (overlib.js). Can you do this?
I have tried using the "src=" but it did not work.
If I try to include the .js code directly in the dynamic page, I get an error. I assume it is a size limitation.
Help.When you say "source=", are you talking about this usage for instance?
<script type="text/javascript" language="JavaScript1.2"
src="http://mysite.com/js/myjavascript.js">
</script>
Did you get a runtime error after putting that in the dynamic page? -
Form in Dynamic page not working when checkbox is used.
I have created a form using dynamic page. The form most have display fields and a checkbox field. When I check a box, it assigns 'Y' value and when unclick, it assign 'N' to the database field.
When I submit the form, the procedure which is supposed to save the form data never gets executed. Well, at least it says, page not found HTTP 404 error.
Interestingly if I make this field a text box and manually enter 'Y' or 'N', and then submit the form, the procedure is executed. Data gets saved.
Is the checkbox not supposed to be used for a database field because checkbox value can be assigned only using javascript and the procedure never get that value ?
Can you please tell me how to use a checkbox for a database field using dynamic page ?
thanks,
MainakSharmila,
When I said, the form does not get submitted, I meant that the procedure does not work. The form gets submitted but the procedure does not work. It gives HTTP 404 error. That is what perplexes me. I am unable to understand why the procedure does not work when I click a checkbox.
May be you can make this work. I am hopeless about this.
Here is the code for the procedure sumbit_form:
NOTE: I ADDED TWO FIELDS CALLED PROMOT VARCHAR2(1), PROMOTID NUMBER(4) TO THE EMP TABLE AND CREATED A NEW TABLE CALLED PROMOTEMP. THIS IS A TEST CASE.
create or replace procedure sumbit_form
(p_empno IN portal30.wwv_utl_api_types.vc_arr, p_promot IN portal30.wwv_utl_api_types.vc_arr, p_action IN VARCHAR2)
is
begin
if p_action = 'save' then
for i in 1..p_empno.count LOOP
update scott.promotemp
set promot = p_promot(i)
where empno = p_empno(i);
END LOOP;
end if;
commit;
htp.p('<b>Saved Successfully</b>');
htp.p('<table border=1 bordercolor="red">');
for c1 in (select * from promotemp where promot='Y')
LOOP
htp.p('<tr><td>');
htp.p(c1.ename);
htp.p('</td><td>');
htp.p(c1.job);
htp.p('</td><td>');
htp.p(c1.mgr);
htp.p('</td><td>');
htp.p(c1.sal);
htp.p('</td><td>');
htp.p(c1.deptno);
htp.p('</td></tr>');
end loop;
htp.p('</table>');
EXCEPTION
when others then
raise;
end;
Here is the code for the dynamic page.
<HTML>
<HEAD>
<TITLE>Promot Emp</TITLE>
<script language="JavaScript1.1">
function include(form) {
var thisform = form;
for (var i=0; i<thisform.length; i++) {
if (thisform.elements.type == 'checkbox') {
if (thisform.elements[i].checked) {
thisform.elements[i].value = 'Y'; }
else { thisform.elements[i].value = 'N'; }
form.submit();
function show(form) {
var thisform = form;
for (var i=0; i<thisform.length; i++) {
if (thisform.elements[i].type == 'checkbox') {
if (thisform.elements[i].value = 'Y') {
thisform.elements[i].checked = true; }
else { thisform.elements[i].checked = false; }
</script>
</HEAD>
<BODY>
<FORM action="scott.sumbit_form" method="post">
<table border=1 bordercolor="red">
<tr>
<td> </td>
<td>Name</td>
<td>Job</td>
<td>Manager</td>
<td>Hire Date</td>
<td>Commission</td>
<td>Department#</td>
<td>Include</td>
</tr>
<ORACLE>declare
i number;
begin
i := 0;
for c1 in (select * from scott.promotemp where promotid = :promotid)
loop
htp.p('<tr><td>');
htp.p('<input type="hidden" name="p_empno" value='||c1.empno||'>');
htp.p('</td><td>');
htp.p(c1.ename);
htp.p('</td><td>');
htp.p(c1.job);
htp.p('</td><td>');
htp.p(c1.mgr);
htp.p('</td><td>');
htp.p(c1.hiredate);
htp.p('</td><td>');
htp.p(c1.comm);
htp.p('</td><td>');
htp.p(c1.deptno);
htp.p('</td><td>');
if (c1.promot = 'Y') then
htp.p('<SELECT NAME="p_promot" SIZE="1">
<OPTION SELECTED VALUE="'||c1.promot||'">Yes
<OPTION VALUE="N">No
</SELECT>');
else
htp.p('<SELECT NAME="p_promot" SIZE="1">
<OPTION SELECTED VALUE="'||c1.promot||'">No
<OPTION VALUE="Y">Yes
</SELECT>');
end if;
htp.p('</td></tr>');
end loop;
htp.p('</table>');
htp.p('<input type="submit" value="save" name="p_action">');
end;
</ORACLE>
</form>
</BODY>
</HTML>
thanks,
Mainak -
Dynamic page in region as a portlet not displaying in portal template
As the title suggests I have a portal template that contains a region at the top . within this region i have included 2 portlets, first is a dynamic page (a simple banner title ) then a navigation page beneath them .
when I am logged in as a specific user it displays correctly , when I log onto the page without logging in - the dynamic page does not display ,yet the navigation page does . I have clicked on every display to public check box , assigned public user with view privilege and everything else along those lines . Any ideas ??
thanks in advance , ChrisHi Chris: Just to be specific, did you go to the providers tab in Navigator, the locally built providers link then the provider which contains your dynamic page and check the access set directly on that page? You can either set the dynamic page to have its own access (overriding that of the provider) or set the provider itself to be public.
Rgds/Mark M. -
Dynamic Page that calls DB procedure to update data gets PLS222 or PLS306
This seems a bit odd to me: I'm getting either "procedure no in scope" (when I call a procedure with the right args) or "wrong # or type of arguments" (when I call it with the wrong ones, so it is checking the procedure) in a dynamic page.<P>
I'm trying to build a dynamic page that will display data and checkboxes (basically to get around the multi-select limitations -- management has told me that the "fake" md form is not acceptable)<P>
So I build the page, it displays the data just fine exactly as we want it to:<P>
<HTML><FORM><ORACLE>declare
p_mdoc_user portal.wwv_utl_api_types.vc_arr;
p_mdoc_user_seq portal.wwv_utl_api_types.vc_arr;
p_seg_id portal.wwv_utl_api_types.vc_arr;
p_cb portal.wwv_utl_api_types.vc_arr;
p_action varchar2(20):='Save Changes';
begin
htp.p('Select your segments');
htp.p('< p>');
htp.p('<table border=2 cellpadding=2 cellspacing=0>');
htp.tablerowopen;
htp.tableheader('Seg#');
htp.tableheader('Included');
htp.tablerowclose;
for r1 in (select seg_id, build_seg
from web.mdoc_create_seg
where mdoc_user = :mdoc_user
and mdoc_user_seq = :mdoc_user_seq)
loop
htp.p('<input_type="hidden" name="p_mdoc_user" value='||:mdoc_user||'>');
htp.p('<input_type="hidden" name="p_mdoc_user_seq" value='||:mdoc_user_seq||'>');
htp.p('<input_type="hidden" name="p_seg_id" value='||to_char(r1.seg_id)||'>');
htp.p('<tr><td>');
htp.p(r1.seg_id);
htp.p('</td><td>');
if r1.build_seg='TRUE' then
htp.p('<input type="checkbox" name="p_cb" value="Y" checked>');
else
htp.p('<input type="checkbox" name="p_cb" value="Y">');
end if;
htp.p('</td></tr>');
end loop;
htp.p('</table>');
htp.p('< p>');
/*note, this is where I'm putting in a procedure call to update*/
end;
</ORACLE></FORM></HTML><P>
so then I try to add the procedure call (where the sql*plus comment is above)<P>
htp.p('<input type="button" value="Save Changes" onclick='||
mdoc_seg_create_choice_p(
p_mdoc_user,
p_mdoc_user_seq,
p_seg_id,
p_cb)
||'>');<P>
When I try to run as portlet, I get pls 222 not in scope. <but>
When I take a value out (say remove the last ",p_cb") - I get pls 306 wrong number or type of args to call.<P>
I've granted the procedure and its underlying tables to portal/public/and portal_public, even though I'm building the dynamic page under a DB provider that is the same as the schema I wrote the procedure in.<P>
I've tried specifying the schema, using a public synonym, and putting it in a package: same thing occurs, either I get pls 00222 not in scope when I call it with the right columns, or if I purposefully leave one out I get PLS 00306 wrong # or type of args.<P>
Any ideas?
-MikeHi guys
Check out the last 2 posts in this thread for ideas on how to implement 1.
Report on user data from LDAP
Varad -
Passing URL's as Parameters to Dynamic Pages
Hi Everyone,
I'm trying to pass a full URL (including protocol http:// or https://) to a dynamic page as a parameter. The problem is that when the customization form is submitted, the ":" character in the URL is changed to "*!" and the page won't display. I tried using "REPLACE" in my dynamic page PL/SQL code to change the "*!" back into a ":" but to no avail.
Any suggestions?
Thanks in advance,
WayneI have the same issue... Did you find a way to do this?
-
Why is the template not being used when dynamic page called ?
Hi,
I have created a dynamic page and assigned a template to it. When I call the dynamic page using the 'show' procedure from a form, I do not see the template.
Why is the template not being used ? How can I get the template working when I call the dynamic page ?
I even tried to show the page from the dynamic page's manage components tab and there is same problem. Template is not being used.
thanks,
MainakYou can alter the generated package body to include the following function in the header and footer sections.
Header:
PORTAL.wwv_headings.show_header(
p_template => 'PUBLIC.TEMPLATE_3',
p_heading => 'Dynamic Page',
p_help_link => 'PORTAL_DEMO.EXAMPLE_DYNAMIC_PAGE.help',
p_about_link => 'PORTAL_DEMO.EXAMPLE_DYNAMIC_PAGE.about');
Footer:
PORTAL.wwv_headings.show_footer(
p_template => 'PUBLIC.TEMPLATE_3',
p_help_link => 'PORTAL_DEMO.EXAMPLE_DYNAMIC_PAGE.help');
where
<PORTAL_DEMO> indicates application schema
<PORTAL> indicates the name of the portal (normally this will be portal30 by default). -
How do I store and retrieve variables end user enters in Dynamic Pages ?
I have 4 dynamic pages, a user enters in variables on first page. At the next 3 dynamic pages I send the user to I have to display the items they entered on the first page in text items.
How do I pass these variables ????
thanks!ok, so on my page 1 I have the parameter "name", if I use <ORACLE> tags on this first dynamic page they are executed upon entering the form. The user has to enter the data and if the <ORACLE> tags have already executed where do I store the value ?
So where do I issue the wwsto_api_session.load_session (in the second dynamic page or the first one) ?
I can see that I'll use the wwsto_api_session.get_attribute_as_varchar2 ('name') in the second dynamic page with the htp.p - is that right ?
You wouln't have an example you could share with us all do you ? Sure seems like this is confusing to a lot of people. Are there any useful examples of this in the PDK that show how to do this with the HTML included ?
thanks again -
Hi,
I have created a dynamic page(HTML) and published it as a portlet. I have included a call to display an image(say xyz.jpg) in the code. I have also published this dynamic page as a portlet and use it in a portal page. When I view the page it shows the image. When I change the underlying image(xyz.jpg), the new image(please note that that the images are different but the path and file name are the same) is not showing up in the portal page. Instead, the old image file is displayed. I have given Don't cache for the portal page. I also tried clearing cache for the page group, portal page and the dynamic page and it still displays the old image and not the new one. Is there a way to clear cache dynamically?
Thanks,
Manikandan VembuHi,
This is a known issue with the way Wordpress generates the URLs to included content:http://forums.adobe.com/message/4774943
Wordpress generates absolute URLs to content rather than relative URLs, so the current workaround is to either use relative URLs or, if that's not possible, modify the wordpress configuration to use the IP address instead of localhost.
Hope this helps,
Mark -
ORACLE tags in Templates vs Dynamic Pages
Hello all,
I have a procedure that prints the Portal version:
Create or Replace PROCEDURE MATSTESTSCHEMA.SHOW_PORTAL_VERSION
as
l_ver varchar2(20);
BEGIN
l_ver := portal30.wwctx_api.get_product_version();
htp.print(l_ver);
END;
I can call this procedure successfully from a Dynamic Page with
the following embedded syntax in the HTML code:
<ORACLE>
BEGIN
MATSTESTSCHEMA.SHOW_PORTAL_VERSION;
END;
</ORACLE>
I want to use some procedure calls in my templates as well.
Tried to use the same syntax as above but it does NOT work.
The whole code block between the <ORACLE>-tags seems to be
ignored as soon as a procedure call is included.
A simple syntax like this DOES work in a template:
<ORACLE>
BEGIN
htp.p('hello');
END;
</ORACLE>
Why doesn't it work to call procedures from the templates???
Has anyone alse run into this?
PS! I'm using Portal version 3.0.7.6.2
Will soon upgrade to the latest version...What I'm trying to do is to do a redirect of a page depending on
some conditions which my PL/SQL procedure can determine. So I
hoped that I could call my procedure from the page template
header and the procedure would print a redirect tag, if
appropriate. Something like this:
Page template (part of..)
<HTML>
<HEAD>
<ORACLE>
BEGIN
MYSCHEMA.DO_REDIRECT;
END;
</HEAD>
The DO_REDIRECT procedure prints the META tag for a redirect of
the browser if it finds it necessary. otherwise it would do
nothing..
<META HTTP-EQUIV="Refresh"
Content = "30;
URL=http://www.oracle.com">
But calling procedures from templates as described above does
not seem to work, at least in version 3.0.7.6.2.
(We're in the process of upgrading to the latest version)
Does this work in 3.0.9 ?
...or does anyone know a better way to do this?
Any advice is really apreciated. -
Color and Styles in Dynamic Page Portlets
How do you control the colors and fonts of Dynamic Page Portlets.
I am currently using simply syntax and let the Portlet do the rest.
<ORACLE>Select * from Emp</ORACLE>Did you try to use something like:
<head>
<LINK rel="stylesheet" href="estilos.css">
</head>
before the oracle tags and inside the file include the colors and all that things? -
Editing Local Dynamic Pages - How To?
I figure this should be something simple but I can't seem to figure out how to do it. In the past I believe this is something I was able to do in DW.
I've set up my website locally running off my local server and everything there seems to be working in DW. I can view the live page and live code. However, I can't view the live page and edit that page.
Does anyone have any recommendation on how I can best add some code into a dynamic page? I'm running CS5. Here's a screenshot of an example. Let's say I wanted to insert some simple code where the arrrow is.
I really need some help on this as it's something I was under the impression I could do. Thanks for any help you can give.When I turn off Live Code and leave Live View on the code displayed is just of index.php (no matter what live page I'm on). So I can't really edit anything.
That's right. Those files contain nothing to edit. It's all just PHP programming that the server parses into content from the database and countless other files (server-side includes).
A WordPress site really is a one page site -- index.php. That page is re-created on the fly each time someone clicks a link or uses the search bar.
If you have worked with WordPress before, you should know you cannot edit dynamic pages in DW. You can only edit the parts that make up those pages. Those parts are inside your Themes folder.
header.php
sidebar.php
footer.php
index.php
single.php
page.php
archive.php
category.php
tag.php
etc...
Design View is pretty much useless. You must be able to work with code.
Nancy O. -
Do not apply Templates for dynamic page
Hi,
When i add a tag <ORACLE> ...</ORACLE> then all code before this tag don't displate.(I have viewed source after apply template but did't see code before Oracle tag).
Could you tell me the way to sovle the problem.
thanks !
thangtkDear Candace ,
- I have a dynamic page that includes oracle tag (<oracle> </oracle>).Run it ok .
-When i apply my template(user template) then dynnamic don't display all component of Template.
-I had viwed source code (dynamic+template) .I only see componet code begin <oracle> to end. (contains HTML outside <oracle>..</oracle>) and all code before <oracle>..</oracle> to lose .
Ex:I have a code
<html>
<head>
<title>
</title>
</head>
<body>
<table>
</table>
<oracle>
begin
htp.init();
htp.p('..');
end;
</oracle>
</body>
</html>
run it anh view source then i only see:
<oracle>
begin
htp.init();
htp.p('..');
end;
</oracle>
</body>
</html>
I lose code.
<html>
<head>
<title>
</title>
</head>
<body>
<table>
</table>
I think that Templates don't display ,the same cause.
I hope you will reply quickly for you.
thanks very much !
(sorry ,I write very bad) -
I have a HTML form created as a dynamic page in portal
the structure is as below
<html>
<script>
some javascript ....for form validation
</script>
<body>
<form>
--form elements ..
</form>
</body>
</html>
When i have this dy page included in Portal page as portlet along with templates for the header foooter etc ..
I cannot get my form to submit or the javascript to work ..
as i think portal is putting the dynamic page code as is
and so the portal generated html has multiple html/body tags ..
whats is the right way to do this ..Hi,
You can see the html source of a form with javascript when put on a page. You should do something similar for the dynamic page you write.
-Sharmila
Maybe you are looking for
-
Quantity not updating in storage location
Dear one and all, For a Sales order and Delivery order , System has not reduced the entire qty from a storage location after making the invoice. System reduced only part qty. The balance qty is still remaining in the storage location. Plz guide wha
-
I am have problems with the ipad mini, it is a little crazy. It controls by itself, opens and closes application zooms in and out, end my facetime calls, Also Un certain part of the screen is no longer responsive to the touch, it Should be having so
-
!! Urgent Help Needed in Database Table Recovery !!
Hi, What happened is I add a new field to the table. It's a field which need reference but I didn't include it and proceed with table adjustment in under SE11->Utilities->Database Adjustment. I encountered an error during adjustment saying that the r
-
Need how to get the parent acount details in Trial balance report
Hi All, I have a requirement in which i need to print the details of the parent account details as the report wont print the parent a/c details by default. Can any one please let me know how can i achieve this? Thax in advance. Seshu
-
How do I move ITunes from my old PC to new laptop
I have a very old PC and want to move ITunes to a new laptop