在 psp 和 html 页面之间传递参数

发布于 2024-11-01 18:07:55 字数 2909 浏览 1 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日记撕了你也走了 2024-11-08 18:07:55

我以前从未使用过 PSP,但是从查看一些相关文档来看,这不应该在 html 文件中工作吗?:

<%= p_user %>

否则,我认为您可能需要编写一个 javascript 方法来查找要放置的位置内容。因此,如果 html 文件中有一个元素,例如 ,那么您可以执行以下操作:

<script language="Javascript">
document.getElementById('p_user_id').innerHTML = '<%= p_user %>';
</script>

I've never used PSP before, but from looking at some of the documentation for this, shouldn't this work in the html files?:

<%= p_user %>

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:

<script language="Javascript">
document.getElementById('p_user_id').innerHTML = '<%= p_user %>';
</script>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文