在 psp 和 html 页面之间传递参数
我有一个 psp(plsql 服务器页面),向其中传递一个名为 p_user_name 的参数,如下所示:
我在页面中创建了一个名为 p_user 的局部变量,如下所示:
<%@ plsql procedure="recon_portal" %>
<%@ plsql parameter="p_menu" type="varchar2" default="'home'" %>
<%@ plsql parameter="p_rpt_CI" type="varchar2" default="NULL" %>
<%@ plsql parameter="p_conv_CI" type="varchar2" default="NULL" %>
<%@ plsql parameter="p_rpt_CI_run" type="varchar2" default="NULL" %>
<%@ plsql parameter="p_conv_name" type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path1" type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path2" type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path3" type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path4" type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path5" type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path6" type="varchar2" default="NULL" %>
<%@ plsql parameter="conv" type="varchar2" default="NULL" %>
<%@ plsql parameter="p_pass_inst" type="varchar2" default="NULL" %>
<%@ plsql parameter="p_pass_dir" type="varchar2" default="NULL" %>
<%@ plsql parameter="p_user_name" type="varchar2" default="NULL" %>
<%!
lv_report_file_name ci_ref_list.report_file_name%TYPE;
lv_ci_desc_file_name ci_ref_list.ci_desc_file_name%TYPE;
file_path varchar(100);
file_path_master varchar(100);
file_path_linked varchar(100);
url_path varchar(100);
lv_conv varchar(100);
lv_ci_ref varchar(100);
lv_conv_name varchar(100);
lv_ci_run varchar(100);
lv_instance_name varchar(100);
lv_doc varchar(100);
lv_display_name varchar(200);
p_user varchar(100);
%>
在程序的某些部分,我从后端查询一个值并将其放入如下所示:
<%
BEGIN
select 'Super User'
into p_user
from fnd_user fndusr
where fndusr.user_id = fnd_global.user_id
and exists
(SELECT 1
FROM fnd_lookup_values flv
WHERE flv.lookup_type = 'IKN_RAC_RECON_SUPER_USERS'
AND flv.lookup_code = fndusr.user_name);
EXCEPTION
WHEN OTHERS THEN
p_user := 'Basic User';
END;
%>
在我的 psp 页面末尾包含一些 html 文件,如下所示:
<%ELSIF p_menu = 'conv' THEN %>
<%@ include file="recon_conversions.html" %>
<%ELSIF p_menu = 'rept' THEN %>
<%@ include file="recon_reports.html" %>
<%ELSE%>
<%@ include file="recon_docs.html" %>
<%END IF;%>
</body>
</html>
现在在这些 html 文件中,我需要使用参数 p_user 中的值。 有什么方法可以获取这些html文件中p_user的值吗?
i have a psp(plsql server page) to which a parameter called p_user_name is passed as shown below:
i have created a local variable called p_user in the page as shown below:
<%@ plsql procedure="recon_portal" %>
<%@ plsql parameter="p_menu" type="varchar2" default="'home'" %>
<%@ plsql parameter="p_rpt_CI" type="varchar2" default="NULL" %>
<%@ plsql parameter="p_conv_CI" type="varchar2" default="NULL" %>
<%@ plsql parameter="p_rpt_CI_run" type="varchar2" default="NULL" %>
<%@ plsql parameter="p_conv_name" type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path1" type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path2" type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path3" type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path4" type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path5" type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path6" type="varchar2" default="NULL" %>
<%@ plsql parameter="conv" type="varchar2" default="NULL" %>
<%@ plsql parameter="p_pass_inst" type="varchar2" default="NULL" %>
<%@ plsql parameter="p_pass_dir" type="varchar2" default="NULL" %>
<%@ plsql parameter="p_user_name" type="varchar2" default="NULL" %>
<%!
lv_report_file_name ci_ref_list.report_file_name%TYPE;
lv_ci_desc_file_name ci_ref_list.ci_desc_file_name%TYPE;
file_path varchar(100);
file_path_master varchar(100);
file_path_linked varchar(100);
url_path varchar(100);
lv_conv varchar(100);
lv_ci_ref varchar(100);
lv_conv_name varchar(100);
lv_ci_run varchar(100);
lv_instance_name varchar(100);
lv_doc varchar(100);
lv_display_name varchar(200);
p_user varchar(100);
%>
at some part of program i query a value from backend and put it into p_user as below:
<%
BEGIN
select 'Super User'
into p_user
from fnd_user fndusr
where fndusr.user_id = fnd_global.user_id
and exists
(SELECT 1
FROM fnd_lookup_values flv
WHERE flv.lookup_type = 'IKN_RAC_RECON_SUPER_USERS'
AND flv.lookup_code = fndusr.user_name);
EXCEPTION
WHEN OTHERS THEN
p_user := 'Basic User';
END;
%>
some html files are included at the end in my psp page as shown below:
<%ELSIF p_menu = 'conv' THEN %>
<%@ include file="recon_conversions.html" %>
<%ELSIF p_menu = 'rept' THEN %>
<%@ include file="recon_reports.html" %>
<%ELSE%>
<%@ include file="recon_docs.html" %>
<%END IF;%>
</body>
</html>
now in these html files i need to use the value which is in the parameter p_user.
is there any way to get the value of p_user in those html files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我以前从未使用过 PSP,但是从查看一些相关文档来看,这不应该在 html 文件中工作吗?:
否则,我认为您可能需要编写一个 javascript 方法来查找要放置的位置内容。因此,如果 html 文件中有一个元素,例如
,那么您可以执行以下操作:
I've never used PSP before, but from looking at some of the documentation for this, shouldn't this work in the html files?:
Otherwise, I think you might have to write a javascript method to find where you want to put the contents. So if you had an element in the html files like
<span id="p_user_id"></span>
, then you could do: