Using arrays in forms

Hi All!
Anybody know how to use Arrays in Forms 6?
Best regards.

Hello,
have you tried collections ?
Declare
   TYPE  TYP_NUM_ARRAY IS TABLE OF NUMBER INDEX BY BINARY_INTEGER ;
   mytab TYP_NUM_ARRAY ;
Begin
   For i IN 1..10 Loop
      mytab(i) := i ;
   End loop ;
End ;Francois

Similar Messages

  • Use of multi-dimensional arrays in forms - forms debugger crash

    Hello All readers,
    have an issue with use of multi-dimensional arrays in forms when debugging and/or calling another form post array-population.
    USING VERSIONS: oracle forms 9.0.4, Jinitiator 1.3.1.17, oracle db 10.1
    the following code snippet works from a when-button-pressed trigger when called without the debugger. when called with the debugger it crashes when any element of the multi-dimensional associative array is accessed/populated/read. In addition, if i populate the multi-dimensional array then call a form (a msgbox form to display the arrays content as a string) it crashes too.
    declare
    type datasource_rec is record (field varchar2(32), val varchar2(3999));
    type datasource_arr is table of datasource_rec index by binary_integer;
    type datasource_arr_arr is table of datasource_arr index by binary_integer;
         l_arr datasource_arr_arr;
         procedure poparr(i_arr out datasource_arr_arr) is
              idx binary_integer := 1;
              iidx binary_integer := 1;
         begin
              while (idx <= 10) loop
                   iidx := 1;
                   while (iidx <= 10) loop     
                        i_arr(idx)(iidx).field := 'field'||to_char(iidx)||':'||to_char(idx); --# debugger crashes here with JVM aborting... message (which crashes forms builder too)
    i_arr(idx)(iidx).val := 'test value';
                   iidx := iidx+1;     
                   end loop;
              idx := idx+1;
              end loop;
         end;
         procedure printarr is
              idx binary_integer := l_arr.first;
              iidx binary_integer;
              l_msg varchar2(4000);
              l_response pls_integer;
         begin
              while (idx is NOT null) loop
                   iidx := l_arr(idx).first;
                   while (iidx is NOT null) loop
                        l_msg := l_msg||chr(10)||l_arr(iidx)(idx).field||' = '||l_arr(iidx)(idx).val;
                   iidx := l_arr(idx).next(iidx);
                   end loop;
              idx := l_arr.next(idx);
              end loop;
              alerts.info('see console for full printout: '||chr(10)||l_msg);
    --l_response := msgbox.show(l_msg); --calls another modal form to display a long message, which crashes the runtime with a java console message*
         r$debug.print(l_msg);
         end;
    begin
         poparr(l_arr);
         printarr;
    end;
    The java console does not print anything useful when both forms builder and the runtime crash/hangs as a result of the debugger being attached (except displaying a "JVM aborting" message) but when the runtime alone crashes as a result of calling another form after popping the MD array it prints:
    oracle.forms.net.ConnectionException: Forms session <28> aborted: unable to communicate with runtime process.
         at oracle.forms.net.ConnectionException.createConnectionException(Unknown Source)
         at oracle.forms.net.HTTPNStream.getResponse(Unknown Source)
         at oracle.forms.net.HTTPNStream.doFlush(Unknown Source)
         at oracle.forms.net.HTTPNStream.flush(Unknown Source)
         at java.io.DataOutputStream.flush(Unknown Source)
         at oracle.forms.net.StreamMessageWriter.run(Unknown Source)
    has anyone else encountered this problem and found a solution/workaround? is their some sort of memory limitation for forms-side handling of (multi-dimensional) arrays?+
    many thanks
    ps: i get similar problems when a) populating the array from a server/db-side packaged procedure (crashes with java console message as above even when not debugging) b) using server/db-side packaged types for the array.

    Hello All readers,
    have an issue with use of multi-dimensional arrays in forms when debugging and/or calling another form post array-population.
    USING VERSIONS: oracle forms 9.0.4, Jinitiator 1.3.1.17, oracle db 10.1
    the following code snippet works from a when-button-pressed trigger when called without the debugger. when called with the debugger it crashes when any element of the multi-dimensional associative array is accessed/populated/read. In addition, if i populate the multi-dimensional array then call a form (a msgbox form to display the arrays content as a string) it crashes too.
    declare
    type datasource_rec is record (field varchar2(32), val varchar2(3999));
    type datasource_arr is table of datasource_rec index by binary_integer;
    type datasource_arr_arr is table of datasource_arr index by binary_integer;
         l_arr datasource_arr_arr;
         procedure poparr(i_arr out datasource_arr_arr) is
              idx binary_integer := 1;
              iidx binary_integer := 1;
         begin
              while (idx <= 10) loop
                   iidx := 1;
                   while (iidx <= 10) loop     
                        i_arr(idx)(iidx).field := 'field'||to_char(iidx)||':'||to_char(idx); --# debugger crashes here with JVM aborting... message (which crashes forms builder too)
    i_arr(idx)(iidx).val := 'test value';
                   iidx := iidx+1;     
                   end loop;
              idx := idx+1;
              end loop;
         end;
         procedure printarr is
              idx binary_integer := l_arr.first;
              iidx binary_integer;
              l_msg varchar2(4000);
              l_response pls_integer;
         begin
              while (idx is NOT null) loop
                   iidx := l_arr(idx).first;
                   while (iidx is NOT null) loop
                        l_msg := l_msg||chr(10)||l_arr(iidx)(idx).field||' = '||l_arr(iidx)(idx).val;
                   iidx := l_arr(idx).next(iidx);
                   end loop;
              idx := l_arr.next(idx);
              end loop;
              alerts.info('see console for full printout: '||chr(10)||l_msg);
    --l_response := msgbox.show(l_msg); --calls another modal form to display a long message, which crashes the runtime with a java console message*
         r$debug.print(l_msg);
         end;
    begin
         poparr(l_arr);
         printarr;
    end;
    The java console does not print anything useful when both forms builder and the runtime crash/hangs as a result of the debugger being attached (except displaying a "JVM aborting" message) but when the runtime alone crashes as a result of calling another form after popping the MD array it prints:
    oracle.forms.net.ConnectionException: Forms session <28> aborted: unable to communicate with runtime process.
         at oracle.forms.net.ConnectionException.createConnectionException(Unknown Source)
         at oracle.forms.net.HTTPNStream.getResponse(Unknown Source)
         at oracle.forms.net.HTTPNStream.doFlush(Unknown Source)
         at oracle.forms.net.HTTPNStream.flush(Unknown Source)
         at java.io.DataOutputStream.flush(Unknown Source)
         at oracle.forms.net.StreamMessageWriter.run(Unknown Source)
    has anyone else encountered this problem and found a solution/workaround? is their some sort of memory limitation for forms-side handling of (multi-dimensional) arrays?+
    many thanks
    ps: i get similar problems when a) populating the array from a server/db-side packaged procedure (crashes with java console message as above even when not debugging) b) using server/db-side packaged types for the array.

  • Using Arrays in a program

    First, I would like to thank everyone in this forum for all the help they have given me over the past few weeks. With that said, I am currently trying to alter the following code to accept and use arrays to end to produce three seperate results. The program now as three hard coded variables which are
    Amount = 200000.00;
    Term = 30;
    InterestRate = .0575;
    I need to have the program work the same, but produce results for three different Terms and Three different periods. Below is the code the I am working on, I have added two arrays containing the required information. I am having a hard time coming up with a for statment to move the program through the two arrays. Any pushes in the right direction would be great. I left the hard code variable in place, I know that I do need to remove them and alter the equations. I just thought it would be easier for everyone to understand if I left the code in working form.
    import java.math.*;
    import java.text.*;
    import java.util.*;
    // The Payment class displays a predetermined monthly mortgage payment
    public class Payment
         public static void main(String[]arguments)
              //Creates Two Arrays for InterestRates and Terms
              double[] InterestRates = {.0535, .055, .0575};
              int[] Terms = {7, 15, 30};
              //Creates variables
              double Amount;
              int Term;
              double InterestRate;
              //Assigns values to variables
              Amount = 200000.00;
              Term = 30;
              InterestRate = .0575;
              //Alters the display format of Amount variable
              NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US);
              String s = n.format(Amount);
              //Creates variables
              double MonthlyInterestRate;
              int TotalMonths;
              double Payment;
              //Assigns values to variables
              MonthlyInterestRate = InterestRate / 12;
              TotalMonths = Term * 12;
              Payment = Amount* MonthlyInterestRate / (1-(Math.pow((1+MonthlyInterestRate ),(-TotalMonths))));
              //Takes Payment variable and round answer to 2 decimal points
              BigDecimal bd = new BigDecimal(Payment);
    bd = bd.setScale(2, BigDecimal.ROUND_DOWN);
              //Instructions to display various varibles
              System.out.println("Cost of Mortgage "+ s);
              System.out.println("Length of Term " + Term);
              System.out.println("Interest Rate 5.75% ");
              System.out.println("The monthly payment of this loan is $" + bd);
              System.out.println();
              //Creates new set of variables
              double MonthlyInterest;
              double MonthlyPrincipal;
              double TotalInterestPaid;
              int NumberofPayments;
              //Creates Balance variable
              double Balance;
              //Initialization of Balance variable
              Balance = 200000;
              TotalInterestPaid = 0;
              NumberofPayments = 360;
              //Creates a loop that calculates the entire term of loan
              do
              MonthlyInterest = Balance * (InterestRate / 12);
              MonthlyPrincipal = Payment - MonthlyInterest;
              Balance = Balance - MonthlyPrincipal;
              TotalInterestPaid = TotalInterestPaid + MonthlyInterest;
              NumberofPayments = NumberofPayments - 1;
              //Takes current balance and rounds the answer to two digits
              BigDecimal bb = new BigDecimal(Balance);
    bb = bb.setScale(2, BigDecimal.ROUND_DOWN);
              BigDecimal tip = new BigDecimal(TotalInterestPaid);
                        tip = tip.setScale(2, BigDecimal.ROUND_UP);
              System.out.println("New Loan Balance " + bb);
              System.out.println();
              System.out.println("Total Interest Paid " + tip);
              System.out.println();
              System.out.println("Number of Payments remaining " + NumberofPayments);
              System.out.println();
              //The following lines of code pauses the loop to allow the user to read the output
              //The speed of th display can be adujusted to a wide variety of speeds
              try
                   Thread.sleep(400);
                   catch (InterruptedException exc)
              //Loop condition
              while (NumberofPayments > 0);
    //Ends Application

    Try this. It should give you some ideas. :)
    import java.math.BigDecimal;
    import java.text.NumberFormat;
    import java.util.Locale;
    // The Payment class displays a predetermined monthly mortgage payment
    public class Payment {
        public static final NumberFormat CURRENCY_FORMAT = NumberFormat.getCurrencyInstance(Locale.US);
        public static final double[] INTEREST_RATES = {.0535D, .055D, .0575D};
        public static final int[] TERMS = {7, 15, 30};
        public static final double AMOUNT = 200000.00;
        public static final int MONTHS_PER_YEAR = 12;
        public static void main(String[] arguments) {
            for (int t = 0; t < TERMS.length; t++) {
                for (int i = 0; i < INTEREST_RATES.length; i++) {
                    displayPayments(AMOUNT, INTEREST_RATES, TERMS[t]);
    private static void displayPayments(double amount, double interestRate, int term) {
    //Creates variables
    //Assigns values to variables
    double monthlyInterestRate = interestRate / MONTHS_PER_YEAR;
    int totalMonths = term * MONTHS_PER_YEAR;
    double payment = amount * monthlyInterestRate / (1 - Math.pow(1 + monthlyInterestRate, -totalMonths));
    //Instructions to display various varibles
    System.out.println("Cost of Mortgage " + CURRENCY_FORMAT.format(amount));
    System.out.println("Length of Term " + term);
    System.out.println("Interest Rate " + new BigDecimal(interestRate * 100).setScale(2, BigDecimal.ROUND_HALF_UP) + '%');
    System.out.println("The monthly payment of this loan is " + CURRENCY_FORMAT.format(payment));
    System.out.println();
    //Creates new set of variables
    double totalInterestPaid = 0.0D;
    //Creates balance variable, Initialization of balance variable
    double balance = amount;
    //Creates a loop that calculates the entire term of loan
    System.out.println("New Loan balance, Total Interest Paid, Number of Payments remaining");
    for (int numberofPayment = totalMonths; numberofPayment > 0; numberofPayment--) {
    double monthlyInterest = balance * monthlyInterestRate;
    double monthlyPrincipal = payment - monthlyInterest;
    balance -= monthlyPrincipal;
    totalInterestPaid += monthlyInterest;
    //Takes current balance and rounds the answer to two digits
    BigDecimal bb = new BigDecimal(balance);
    bb = bb.setScale(2, BigDecimal.ROUND_DOWN);
    BigDecimal tip = new BigDecimal(totalInterestPaid);
    tip = tip.setScale(2, BigDecimal.ROUND_UP);
    System.out.println(CURRENCY_FORMAT.format(bb.doubleValue()) + ", " +
    CURRENCY_FORMAT.format(tip.doubleValue()) + ", " +
    numberofPayment);
    System.out.println();
    //Ends Application

  • What is the use of this form?

    Hi all,
    What is the use of this form in include RV61B901?
    How does this code send any information to the program calling it? Is Sy-subrc global so that main program will know the reuslts?
    Code:
    FORM KOBED_901.
      DATA : l_anzpk LIKE likp-anzpk.
      SELECT SINGLE anzpk FROM likp
                          INTO l_anzpk
                          WHERE vbeln = komkbv2-vbeln.
      IF l_anzpk NE 0.
        sy-subrc = 4.
        exit.
      ENDIF.
      sy-subrc = 0.
    ENDFORM.
    Thanks,
    Charles.

    Hello,
    This form sets the value of sy-subrc(which is global) based
    on the value of l_anzpk.
    Regards
    Greg Kern

  • I am trying to use a interactive form and it says "If this message is not eventually replaced by the proper contents of the document, your PDF  viewer may not be able to display this type of document."  This is a IRS form and has worked before.

    I am trying to use a interactive form and it says "see below"  This is a IRS form and has worked before.
    is there a tech support phone number?
    Please wait...
    If this message is not eventually replaced by the proper contents of the document, your PDF
    viewer may not be able to display this type of document.
    You can upgrade to the latest version of Adobe Reader for Windows®, Mac, or Linux® by
    visiting http://www.adobe.com/go/reader_download.
    For more assistance with Adobe Reader visit http://www.adobe.com/go/acrreader.
    Windows is either a registered trademark or a trademark of Microsoft Corporation in the United States and/or other countries. Mac is a trademark
    of Apple Inc., registered in the United States and other countries. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries

    That means you are looking at the form online with a browser that uses its own (incompatible) PDF viewer, not the Adobe Reader plugin.
    Either
    download the form to your local disk and fill it from there
    use a browser that employs the Adobe Reader plugin
    configure your browser to use the Adobe Reader plugin: http://helpx.adobe.com/acrobat/kb/pdf-browser-plugin-configuration.html

  • Multi-language support for user-specified text strings used in the forms

    multi-language support for user-specified text strings used in the forms
    Instead of creating multiple forms, 1 in each different language, for the same service, is there any workaround?

    Hoan - is your question what are the considerations when creating multiligual catalogs? If so, I can tell you that at other clients I have seen them use a single catalog for one or two languages. For the two langugages, such as Spanish/English, you can create a single catalog with both of them. Once you get to more than two languages, the catalog would get unweildy and is therefore not suggested.

  • Questions about using a PDF form online

    I have a client who wants to create an online version of a PDF form that they are currently using. I am currently trying to explain to them that this would be best done as an HTML web form, but I may not win this argument. I have only used PDFs for printed forms (either hand-written or using form fields) so I am not familiar with any problems that converting the form for use online would entail.
    When the 'Submit' button is pressed on the form, is there a way to redirect to another web page after the data is submitted? (i.e. does the PDF have access to it's outer 'environment'?)
    Are there any security issues submitting data using the PDF form as opposed to using a standard web form? (There may be sensitive data being submitted)
    I'm not sure how they plan to handle the data that is submitted, but there are several options in the submitForm parameters - I am assuming that using the HTML option would submit the data in the same format as a web form would. Am I correct here?
    Can the PDF be prevented from being downloaded or printed? This form should only be used to submit data to their server, not as a printed form.
    Are there any other 'gotchas' that I need to look out for? Does anyone have a recommendation for a site which contains any tutorials or guidelines for using PDF forms online?

    Thanks for the information.
    Yes, I agree that there is less reason for it to be a PDF form (Actually, no real reason other than the original form already exists in PDF), but I am unfortunately in the position that my input in this project is not necessarily being considered (my company is following direct -and inconsistent- directions from the client, and I have no contact with the client to ask questions about what their actual needs are). I have been told to give the client the 'Tomato' that they are asking for, even though they are describing an 'Apple'.
    The reason this form is not meant to be printed is that we have replaced the 'Signature' fields from the original form with checkboxes that the user must check to confirm they have 'signed' the document. If they are to print/fax/whatever the document, they should use the original form, not this one. And I am still trying to explain to them that this would be better served with an HTML web form, but I fear I am losing that battle.
    I have brought up the fact that it is not 100% guaranteed that Acrobat will be available in the browser, although I can only guess that it is less than likely that anyone will not have some sort of PDF viewer available to their browser.
    I will also mention that issues may arise if the file is not submitted from within the browser.

  • Using container managed form-based security in JSF

    h1. Using container managed, form-based security in a JSF web app.
    A Practical Solution
    h2. {color:#993300}*But first, some background on the problem*{color}
    The Form components available in JSF will not let you specify the target action, everything is a post-back. When using container security, however, you have to specifically submit to the magic action j_security_check to trigger authentication. This means that the only way to do this in a JSF page is to use an HTML form tag enclosed in verbatim tags. This has the side effect that the post is not handled by JSF at all meaning you can't take advantage of normal JSF functionality such as validators, plus you have a horrible chimera of a page containing both markup and components. This screws up things like skinning. ([credit to Duncan Mills in this 2 years old article|http://groundside.com/blog/DuncanMills.php?title=j2ee_security_a_jsf_based_login_form&more=1&c=1&tb=1&pb=1]).
    In this solution, I will use a pure JSF page as the login page that the end user interacts with. This page will simply gather the input for the username and password and pass that on to a plain old jsp proxy to do the actual submit. This will avoid the whole problem of having to use verbatim tags or a mixture of JSF and JSP in the user view.
    h2. {color:#993300}*Step 1: Configure the Security Realm in the Web App Container*{color}
    What is a container? A container is basically a security framework that is implemented directly by whatever app server you are running, in my case Glassfish v2ur2 that comes with Netbeans 6.1. Your container can have multiple security realms. Each realm manages a definition of the security "*principles*" that are defined to interact with your application. A security principle is basically just a user of the system that is defined by three fields:
    - Username
    - Group
    - Password
    The security realm can be set up to authenticate using a simple file, or through JDBC, or LDAP, and more. In my case, I am using a "file" based realm. The users are statically defined directly through the app server interface. Here's how to do it (on Glassfish):
    1. Start up your app server and log into the admin interface (http://localhost:4848)
    2. Drill down into Configuration > Security > Realms.
    3. Here you will see the default realms defined on the server. Drill down into the file realm.
    4. There is no need to change any of the default settings. Click the Manage Users button.
    5. Create a new user by entering username/password.
    Note: If you enter a group name then you will be able to define permissions based on group in your app, which is much more usefull in a real app.
    I entered a group named "Users" since my app will only have one set of permissions and all users should be authenticated and treated the same.
    That way I will be able to set permissions to resources for the "Users" group that will apply to all users that have this group assigned.
    TIP: After you get everything working, you can hook it all up to JDBC instead of "file" so that you can manage your users in a database.
    h2. {color:#993300}*Step 2: Create the project*{color}
    Since I'm a newbie to JSF, I am using Netbeans 6.1 so that I can play around with all of the fancy Visual Web JavaServer Faces components and the visual designer.
    1. Start by creating a new Visual Web JSF project.
    2. Next, create a new subfolder under your web root called "secure". This is the folder that we will define a Security Constraint for in a later step, so that any user trying to access any page in this folder will be redirected to a login page to sign in, if they haven't already.
    h2. {color:#993300}*Step 3: Create the JSF and JSP files*{color}
    In my very simple project I have 3 pages set up. Create the following files using the default templates in Netbeans 6.1:
    1. login.jsp (A Visual Web JSF file)
    2. loginproxy.jspx (A plain JSPX file)
    3. secure/securepage.jsp (A Visual Web JSF file... Note that it is in the sub-folder named secure)
    Code follows for each of the files:
    h3. {color:#ff6600}*First we need to add a navigation rule to faces-config.xml:*{color}
        <navigation-rule>
    <from-view-id>/login.jsp</from-view-id>
            <navigation-case>
    <from-outcome>loginproxy</from-outcome>
    <to-view-id>/loginproxy.jspx</to-view-id>
            </navigation-case>
        </navigation-rule>
    NOTE: This navigation rule simply forwards the request to loginproxy.jspx whenever the user clicks the submit button. The button1_action() method below returns the "loginproxy" case to make this happen.
    h3. {color:#ff6600}*login.jsp -- A very simple Visual Web JSF file with two input fields and a button:*{color}
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
        <jsp:directive.page
    contentType="text/html;charset=UTF-8"
    pageEncoding="UTF-8"/>
        <f:view>
            <webuijsf:page
    id="page1">
    <webuijsf:html id="html1">
    <webuijsf:head id="head1">
    <webuijsf:link id="link1"
    url="/resources/stylesheet.css"/>
    </webuijsf:head>
    <webuijsf:body id="body1" style="-rave-layout: grid">
    <webuijsf:form id="form1">
    <webuijsf:textField binding="#{login.username}"
    id="username" style="position: absolute; left: 216px; top:
    96px"/>
    <webuijsf:passwordField binding="#{login.password}" id="password"
    style="left: 216px; top: 144px; position: absolute"/>
    <webuijsf:button actionExpression="#{login.button1_action}"
    id="button1" style="position: absolute; left: 216px; top:
    216px" text="GO"/>
    </webuijsf:form>
    </webuijsf:body>
    </webuijsf:html>
            </webuijsf:page>
        </f:view>
    </jsp:root>h3. *login.java -- implent the
    button1_action() method in the login.java backing bean*
        public String button1_action() {
            setValue("#{requestScope.username}",
    (String)username.getValue());
    setValue("#{requestScope.password}", (String)password.getValue());
            return "loginproxy";
        }h3. {color:#ff6600}*loginproxy.jspx -- a login proxy that the user never sees. The onload="document.forms[0].submit()" automatically submits the form as soon as it is rendered in the browser.*{color}
    {code}
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    version="2.0">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
    doctype-system="http://www.w3.org/TR/html4/loose.dtd"
    doctype-public="-W3CDTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html"
    pageEncoding="UTF-8"/>
    <html>
    <head> <meta
    http-equiv="Content-Type" content="text/html;
    charset=UTF-8"/>
    <title>Logging in...</title>
    </head>
    <body
    onload="document.forms[0].submit()">
    <form
    action="j_security_check" method="POST">
    <input type="hidden" name="j_username"
    value="${requestScope.username}" />
    <input type="hidden" name="j_password"
    value="${requestScope.password}" />
    </form>
    </body>
    </html>
    </jsp:root>
    {code}
    h3. {color:#ff6600}*secure/securepage.jsp -- A simple JSF{color}
    target page, placed in the secure folder to test access*
    {code}
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
    <jsp:directive.page
    contentType="text/html;charset=UTF-8"
    pageEncoding="UTF-8"/>
    <f:view>
    <webuijsf:page
    id="page1">
    <webuijsf:html id="html1">
    <webuijsf:head id="head1">
    <webuijsf:link id="link1"
    url="/resources/stylesheet.css"/>
    </webuijsf:head>
    <webuijsf:body id="body1" style="-rave-layout: grid">
    <webuijsf:form id="form1">
    <webuijsf:staticText id="staticText1" style="position:
    absolute; left: 168px; top: 144px" text="A Secure Page"/>
    </webuijsf:form>
    </webuijsf:body>
    </webuijsf:html>
    </webuijsf:page>
    </f:view>
    </jsp:root>
    {code}
    h2. {color:#993300}*_Step 4: Configure Declarative Security_*{color}
    This type of security is called +declarative+ because it is not configured programatically. It is configured by declaring all of the relevant parameters in the configuration files: *web.xml* and *sun-web.xml*. Once you have it configured, the container (application server and java framework) already have the implementation to make everything work for you.
    *web.xml will be used to define:*
    - Type of security - We will be using "form based". The loginpage.jsp we created will be set as both the login and error page.
    - Security Roles - The security role defined here will be mapped (in sun-web.xml) to users or groups.
    - Security Constraints - A security constraint defines the resource(s) that is being secured, and which Roles are able to authenticate to them.
    *sun-web.xml will be used to define:*
    - This is where you map a Role to the Users or Groups that are allowed to use it.
    +I know this is confusing the first time, but basically it works like this:+
    *Security Constraint for a URL* -> mapped to -> *Role* -> mapped to -> *Users & Groups*
    h3. {color:#ff6600}*web.xml -- here's the relevant section:*{color}
    {code}
    <security-constraint>
    <display-name>SecurityConstraint</display-name>
    <web-resource-collection>
    <web-resource-name>SecurePages</web-resource-name>
    <description/>
    <url-pattern>/faces/secure/*</url-pattern>
    <http-method>GET</http-method>
    <http-method>POST</http-method>
    <http-method>HEAD</http-method>
    <http-method>PUT</http-method>
    <http-method>OPTIONS</http-method>
    <http-method>TRACE</http-method>
    <http-method>DELETE</http-method>
    </web-resource-collection>
    <auth-constraint>
    <description/>
    <role-name>User</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>FORM</auth-method>
    <realm-name/>
    <form-login-config>
    <form-login-page>/faces/login.jsp</form-login-page>
    <form-error-page>/faces/login.jsp</form-error-page>
    </form-login-config>
    </login-config>
    <security-role>
    <description/>
    <role-name>User</role-name>
    </security-role>
    {code}
    h3. {color:#ff6600}*sun-web.xml -- here's the relevant section:*{color}
    {code}
    <security-role-mapping>
    <role-name>User</role-name>
    <group-name>Users</group-name>
    </security-role-mapping>
    {code}
    h3. {color:#ff6600}*Almost done!!!*{color}
    h2. {color:#993300}*_Step 5: A couple of minor "Gotcha's"_ *{color}
    h3. {color:#ff6600}*_Gotcha #1_*{color}
    You need to configure the "welcome page" in web.xml to point to faces/secure/securepage.jsp ... Note that there is *_no_* leading / ... If you put a / in there it will barf all over itself .
    h3. {color:#ff6600}*_Gotcha #2_*{color}
    Note that we set the <form-login-page> in web.xml to /faces/login.jsp ... Note the leading / ... This time, you NEED the leading slash, or the server will gag.
    *DONE!!!*
    h2. {color:#993300}*_Here's how it works:_*{color}
    1. The user requests the a page from your context (http://localhost/MyLogin/)
    2. The servlet forwards the request to the welcome page: faces/secure/securepage.jsp
    3. faces/secure/securepage.jsp has a security constraint defined, so the servlet checks to see if the user is authenticated for the session.
    4. Of course the user is not authenticated since this is the first request, so the servlet forwards the request to the login page we configured in web.xml (/faces/login.jsp).
    5. The user enters username and password and clicks a button to submit.
    6. The button's action method stores away the username and password in the request scope.
    7. The button returns "loginproxy" navigation case which tells the navigation handler to forward the request to loginproxy.jspx
    8. loginproxy.jspx renders a blank page to the user which has hidden username and password fields.
    9. The hidden username and password fields grab the username and password variables from the request scope.
    10. The loginproxy page is automatically submitted with the magic action "j_security_check"
    11. j_security_check notifies the container that authentication needs to be intercepted and handled.
    12. The container authenticates the user credentials.
    13. If the credentials fail, the container forwards the request to the login.jsp page.
    14. If the credentials pass, the container forwards the request to *+the last protected resource that was attempted.+*
    +Note the last point! I don't know how, but no matter how many times you fail authentication, the container remembers the last page that triggered authentication and once you finally succeed the container forwards your request there!!!!+
    +The user is now at the secure welcome page.+
    If you have read this far, I thank you for your time, and I seriously question your ability to ration your time pragmatically.
    Kerry Randolph

    If you want login security on your web app, this is one way to do it. (the easiest way i have seen).
    This method allows you to create a custom login form and error page using JSF.
    The container handles the actual authentication and protection of the resources based on what you declare in web.xml and sun-web.xml.
    This example uses a statically defined user/password, stored in a file, but you can also configure JDBC realm in Glassfish, so that that users can register for access and your program can store the username/passwrod in a database.
    I'm new to programming, so none of this may be a good practice, or may not be secure at all.
    I really don't know what I'm doing, but I'm learning, and this has been the easiest way that I have found to add authentication to a web app, without having to write the login modules yourself.
    Another benefit, and I think this is key ***You don't have to include any extra code in the pages that you want to protect*** The container manages this for you, based on the constraints you declare in web.xml.
    So basically you set it up to protect certain folders, then when any user tries to access pages in that folder, they are required to authenticate.
    --Kerry                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Unable to close browser when using Adobe Interactive Form

    Hello,
    I'm using an Interactive Form in my Web Dynpro application. Everything works fine, but when the view with the Interactive Form is active, I am not able to close the browser window anymore. Moving to another view is also not possible.
    I already changed all the options of the Interactive Form but always the same behaviour.
    I am developing on Web AS 6.40, Service Pack 11. ADS is installed also with Service Pack 11.
    Adobe Reader is Version 7.0 and Adobe Designer is Version 7.1
    Has anyone an idea what's wrong?
    Thanks for your help!
    Best regards
    Christian

    Hi,
    I am facing a problem with viewing SAP interactive forms.
    I have the SAPForms.api in Adobe reader plugins but is outdated (19th apr, 05). How do I get the new one and how do I register it ? This same scenario works on a colleague's machine with same config except the SAPForms.api which is latest. (Nov, 05)
    Any pointers will be highly appreciated.
    Thanks,
    Samar

  • How to use a SAME form between two JSP ?

    Hi,
    I have a JSP called jsp1 that use a form called form1.
    I use the next line in jsp1 to tell this :
    <jsp:useBean id="form1" class="Form" scope="request"/>
    In struts-config :
    <form-beans>
    <form-bean name="form1" type="Form"/>
    </form-beans>
    <action path="/jsp" type="Action" name="Form" scope="request">
    <forward name="success" path="jsp2.jsp"/>
    </action>
    In the action linked to this form, I populate my form.
    Next, I would like, in the second JSP jsp2, to USE THE SAME FORM form1, so that I can use some datas I have inserted in it after I have called the action of jsp1.
    I hope you will understand my BAD english :)
    HELP ME PLEASE, it is very urgent !

    Maybe it is not very clear... I am going to explain it in another way :
    I have one form that I use in JSP (init.jsp) thanks to this line :
    <jsp:useBean id=3D"Form" class=3D"com.form.MyForm" scope=3D"request"/>
    In my struts-config.xml :
    <action path=3D"/fastsearch"
         type=3D"com.action.MyAction"
         name=3D"Form"
         scope=3D"request">
         <forward name=3D"success" path=3D"success.jsp"/>
    </action>
    Thanks to MyAction, I populate the fields of my form. I can access to =
    this fields in success.jsp.
    Here the perform method of MyAction :=20
    public ActionForward perform(ActionMapping mapping,
                        ActionForm form,
                             HttpServletRequest req,
                             HttpServletResponse res) {
         (MyForm)form.populate();=09
         req.setAttribute("TempForm", ((MyForm)form));
         return mapping.findForward("success");
    Now, I would like that when I click on a link in success.jsp to go to =
    another JSP page (last.jsp), I can access to my populated form !=20
    At this moment, I have=20
    <jsp:useBean id=3D"TempForm" class=3D"com.form.MyForm" =
    scope=3D"request"/> at the beginning of last.jsp, but it does not =
    work...
    I hope you understand what I want to say ;)

  • Using DatePicker in forms 10g

    how can i use datepicker in forms 10g for date data type items.

    <p>Oracle Forms 11.1.2.0.0 Date Picker</p>

  • Using graph in forms 10g

    Hello,
    I am using FormsGraph in forms 10g.
    Now I need additional options - more visualized graph and dynamic graph - like in Flash.
    Is there a way to achieve that using a java bean?
    Is it possible to use flash inside a form window?
    Thank you,
    Nina

    Java Plug-in 1.6.0_14
    Using JRE version 1.6.0_14-b08 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\nina_n
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    p: reload proxy configuration
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    Reading certificates from 141303 http://pc10-060.jer.ad.malam.com:8889/forms/java/frmall.jar | C:\Documents and Settings\nina_n\Application Data\Sun\Java\Deployment\cache\6.0\25\373de359-57e5f745.idx
    load: class oracle.forms.webutil.common.RegisterWebUtil not found.
    java.lang.ClassNotFoundException: oracle.forms.webutil.common.RegisterWebUtil
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    proxyHost=null
    proxyPort=0
    connectMode=HTTP, native.
    Reading certificates from 141303 http://pc10-060.jer.ad.malam.com:8889/forms/java/frmall.jar | C:\Documents and Settings\nina_n\Application Data\Sun\Java\Deployment\cache\6.0\25\373de359-57e5f745.idx
    גרסת Forms Applet היא : 10.1.2.3
    Reading certificates from 1990 http://pc10-060.jer.ad.malam.com:8889/forms/java/eHTMLBrowser.jar | C:\Documents and Settings\nina_n\Application Data\Sun\Java\Deployment\cache\6.0\9\603b1b09-2844393f.idx
    Reading certificates from 6718 http://pc10-060.jer.ad.malam.com:8889/forms/java/jdic.jar | C:\Documents and Settings\nina_n\Application Data\Sun\Java\Deployment\cache\6.0\51\2a47f033-52581ebc.idx
    org.jdesktop.jdic.init.JdicInitException: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
         at org.jdesktop.jdic.init.JdicManager.initShareNative(Unknown Source)
         at org.jdesktop.jdic.browser.WebBrowser.<clinit>(Unknown Source)
         at oracle.forms.fd.EnhancedHTMLBrowser.<init>(EnhancedHTMLBrowser.java:56)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at oracle.forms.handler.UICommon.instantiate(Unknown Source)
         at oracle.forms.handler.UICommon.onCreate(Unknown Source)
         at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
         at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
         at oracle.forms.engine.Runform.startRunform(Unknown Source)
         at oracle.forms.engine.Main.createRunform(Unknown Source)
         at oracle.forms.engine.Main.start(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
         at java.io.WinNTFileSystem.canonicalize0(Native Method)
         at java.io.Win32FileSystem.canonicalize(Unknown Source)
         at java.io.File.getCanonicalPath(Unknown Source)
         ... 23 more
    ------> ExtendedFrame title : Enhanced Web Browser
    Set Border=false
    Reading certificates from 141303 http://pc10-060.jer.ad.malam.com:8889/forms/java/frmall.jar | C:\Documents and Settings\nina_n\Application Data\Sun\Java\Deployment\cache\6.0\25\373de359-57e5f745.idx

  • Creation of a portal page using XML web form

    Hi Experts,
    I want to know how to make a portal page using XML web forms... Please tell me the steps involved in doing the aforesaid.
    Thanks in advance...

    Hi
    You compose page using WPC(Web page Composer), this is a bussiness package, which you need to deploy it on portal server then will get a WPC role which you can assign the user and then user can start composing the using follwoing PDF
    To compose it chect this pdf
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2041eb17-6001-2b10-b08d-b95ce55fa9b7?overridelayout=true
    Thanks

  • How To Use Recursion In Forms?

    I have the following table
    Table name: Project_Details:
    Coulmns:
    Project_num Number(6) PK
    Project_Title
    Project_status
    Parent_project_Number Number(6) FK (It’s a foreign key for the project
    number in the same table)
    Am using the Oracle Forms Builder to develop the following screen with the following data
    Project Number: ……….
    Parent Project Number: ……..
    Childs Projects:
    I have the following case that I don’t know how to implement:
    Example:
    The user create the following Project Numbers
    Project number: 100 >>> Original or parent
    New project 105 >>> Child of 100
    New project 107 >>> Child of 105
    New project 109 >>> Child of 107
    So when the user re query 100 the Childs project filed should have 105,107 and 109 as a recursion of parents as shown below.
    Screen Result:
    Project Number: 100
    Parent Project Number :
    Childs Projects:
    105
    107
    109
    Another query with project number =107
    Screen Result:
    Project Number: 107
    Parent Project Number : 105
    Childs Projects:
    105
    100
    If any body has any idea in how to implement this idea using oracle forms and SQL please help me. Its urgent..
    Thanks in advanced..

    Hmmm, looks like you can't update a connect by prior view. That's a shame.
    Anyway, here's what you need:
    CREATE TABLE test
    (child number
    ,parent number);
    INSERT INTO test VALUES (1, null);
    INSERT INTO test VALUES (2, 1);
    INSERT INTO test VALUES (3, 1);
    INSERT INTO test VALUES (4, 2);
    INSERT INTO test VALUES (5, null);
    INSERT INTO test VALUES (6, 5);
    INSERT INTO test VALUES (7, 6);
    INSERT INTO test VALUES (8, 5);
    CREATE OR REPLACE VIEW test_hier_vw
    AS
    select lpad(' ',2*(level-1)) || to_char(child) hier
    from test
    start with parent is null
    connect by prior child = parent;
    SQL> select hier from test_hier_vw
    2 /
    HIER
    1
    2
    4
    3
    5
    6
    7
    8
    8 rows selected.

  • How to use bfile in forms

    Hi,
    I'm using webutil for viewing files(doc,pdf,txt).These files are stored in FTP server.
    But my requirement is i have to link that files with BFILE. means those file paths store in bfile. how to use bfile in forms.

    1. \forms\server\formsweb.cfg
    archive_jini=frmall_jinit.jar,FormsProperties.jar
    2. regedit
    HKEY_LOCAL_MACHINE => FORMS_BUILDER_CLASSPATH
    C:\DevSuiteHome_1\forms\java\frmbld.jar;C:\DevSuiteHome_1\jlib\importer.jar;
    C:\DevSuiteHome_1\jlib\debugger.jar;C:\DevSuiteHome_1\jlib\utj.jar;
    C:\DevSuiteHome_1\jlib\dfc.jar;C:\DevSuiteHome_1\jlib\help4.jar;
    C:\DevSuiteHome_1\jlib\oracle_ice.jar;C:\DevSuiteHome_1\jlib\jewt4.jar;
    C:\DevSuiteHome_1\jlib\ewt3.jar;C:\DevSuiteHome_1\jlib\share.jar;
    C:\DevSuiteHome_1\forms\java\frmwebutil.jar;C:\DevSuiteHome_1\forms\java\frmall.jar;
    C:\DevSuiteHome_1\forms\java\FormsProperties.jar;
    3. Untuk Jdev.. include..Libraries [THE WAY I AM CREATING A BEAN..NO NEED TO READ THIS]
    ORacle Forms
    C:\DevSuiteHome_1\jdev\lib\ext\frmjdev_pjc.jar

Maybe you are looking for

  • RMI & JDBC ResultSet

    I am developing a project The basic archeiecture is like this: a reporting tool a virtualDB a real DB the reporting tool request for data from virtualDB, the virtualDB actually fetch the result for it. The virtualDB is a remote object using RMI which

  • Where is the iak file defined in the project?

    I made changes to the *.iak file in MAX including the file name and now there are yellow bangs on the RT target and its subfolders in Project Explorer.  (The RT taget is a cFP-2110)  What is the best way to resolve this? Dave J.

  • Set the css style of text in a column according to the value of another col

    I'd like to set the css style of text in a column according to the value of another column. Each field may end up with a different style of text as a result, for instance. Any ideas? I looked thru the forums but couldn't find anything. Thanks, Linda

  • After an element in the array is removed, how to move the array up?

    Hi, My programs creates an array of strings. The user can choose to insert or delete a string. After a string has been deleted, I like to move the rest of the array up to fill up the space. For examples, String[] before={"This", "is", "a", "test"}; A

  • CATS Data Migration

    Hello , Re-organization activity is being carried out. And we are supposed to migrate CATS data for last seven years from one cost collector (WBS) to another. Has anyone worked on similar requirement in past? Request you to please share your experien