JSF: Construct EL expression

I need to use a bean property as the key for the map for another property.
Something like that:
<c:forEach value="#{bean1.dataList}" var="data">
  <tr>
    <td>Input:</td>
    <td><h:inputText value="#{bean2.someMap[data.id]}/>
  </tr>
</c:forEach>
{code}
But this stuf not works :( What is the correct variant for this EL expression?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

I want to use ternary operator for h:datatable columnclasses attribute like as below
<h:datatable
columnClasses="#{booleanExpression ? style1,style2 : style3,style4}"
/>
But it's not working.Is there any other alternative to do this?

Similar Messages

  • How to find length of a string in JSF using EL expressions.

    I am doing it as below for finding string length
    <c:set var="test" value="#{myPageBean.myMethod.length()}" />
    While evaluating the above expression,it will call getMyMethod() which will return a String. On that it will call length().
    But it this throwing parsing error,
    Is it different in JSF?..Pls help.

    BabuKhan wrote:
    I have imported the taglib in th below 3 ways and tried
    1. <anyxmlelement xmlns:fn="http://java.sun.com/jsp/jstl/functions" />
    2. <anyxmlelement xmlns:fn="http://java.sun.com/jstl/functions" />
    3. <anyxmlelement xmlns:fn="http://java.sun.com/jsf/functions" />
    Literally? Do you understand the meaning of "anyxmlelement" ?

  • How to use ternary operator in JSF using EL expression

    how to use ternary operator in JSF using EL expression

    I want to use ternary operator for h:datatable columnclasses attribute like as below
    <h:datatable
    columnClasses="#{booleanExpression ? style1,style2 : style3,style4}"
    />
    But it's not working.Is there any other alternative to do this?

  • Customer JSF Component Value Expression not work

    why my customer tag not work,
    in my jsp
    <q:my formatString="yyyy/mm/dd" current="#{LoginBean.date}"></q:my>the isLiteralText() always return true, and I can't get the correct value, #{LoginBean.date} is returned.
    bellow is my tag source.
    can anyone help me.
    package jsf;
    import javax.el.ValueExpression;
    import javax.faces.component.UIComponent;
    import javax.faces.webapp.UIComponentELTag;
    public class MyCustomerTag extends UIComponentELTag {
        private String formatString;
        @Override
        public String getComponentType() {
            return "COMPONENT_TYPE";
        @Override
        public String getRendererType() {
            return "COMPONENT_TYPE";
        @Override
        public void release() {
            super.release();
            setFormatString(null);
        @Override
        protected void setProperties(UIComponent component)  {
            if (!(component instanceof UIDatePicker))
                throw new IllegalArgumentException("Component "+
                    component.getClass().getName() +" is no UIDatePicker");
            component.setValueExpression("current", current);
            System.out.println(current.getExpressionString());
            System.out.println(current.isLiteralText());
            System.out.println((String) component.getAttributes().get("current"));
         * @return the formatString
        public String getFormatString() {
            return formatString;
         * @param formatString the formatString to set
        public void setFormatString(String formatString) {
            this.formatString = formatString;
        private ValueExpression current;
         * @return the value
        public ValueExpression getCurrent() {
            return current;
         * @param value the value to set
        public void setCurrent(ValueExpression current) {
            this.current = current;
    }

    I do not know what your native is, but there's quite a huge difference between "custom" and "customer". Look it up in your dictionary.

  • Help constructing SOM Expression

    Hi,
    I've puzzled over this for many hours and decided I definitely am a fish out of whater. Could you please help?
    My problem: I need a way to substitue a string for the SOM Expression of certain fields without always having to write out the whole expression. Basically, I am trying to figure out if I know the location, can I pass a variable with that location's string into a function, and then have the function process several instructions, using the passed string as the SOM Expression?
    For example, if the SOM Expression for 2 fields are:
    Form1.Subform1.FieldA
    Form1.Subform2.FieldB
    If I know the string which is the exact location of FieldA and FieldB, can I somehow pass those strings into a script object so the same function can work with multiple fields. E.g. if I wanted to change the font size, bold the font, and font color of each field, could I pass the string of the SOM Expression into a script object method which would process these 3 properties, and then pass the string for the second field's location into the same function to process that field? The reason I want to do this is my form has about 50 such fields which have about 15 processes which are used for each form.
    I'm sorry if this isn't clear. I'd really appreciate any help someone might have to offer.
    Thanks,
    Jeff

    You can pass the object itself by using the somExpression. You do not need to pass a string in. So calling the script would be:
    ScriptObject.FunctionName(Form1.Subform1.FieldA)
    and in ths script object to recieve the object you would use:
    var myObj = Form1.Subform1.FieldA.nodes
    Or you can pass subform nodes and search the subform for fields. if you post your email I will send you a sample that shows how.

  • How to assign an expression to a statement Step in TestStand automatically?

    Hi,
    I am using VC++ and I am trying to create a statement step inside a SequenceFile already created. I can actually create my Statement type of step and insert it at the right place. Unfortunately, I can't find a way to set the Expression for this step. How can I do it?
    Here is what I tried:
    TS:tepPtr step = engine->NewStep(TS::NoneAdapterKeyName, TS:tepType_Statement);
    // Assign its name to the step
    _bstr_t calledName(stepName);
    step->put_Name(calledName);
    // Get all the sequence file variables into a PropertyObject
    // TS:ropertyObject variables = TS::Execution.GetFileGlobals ( seqFile );
    // Expression construction
    _bstr_t expression("resourceHeader=ResStr(");
    expression += _bstr_t(id_ptr) + ")";
    step->CustomActionExpression.Assign(expression);
    I get the expressions created but nothing in the Expression field.
    NB: I use TS 4.0
    Any hints are welcome.
    - Eric

    Works fine.
    But as you are looking familiar with the kind of programming I do, can I ask another question?
    There it is...
    I highly inspire myself from a solution found on a discussion. I would like to create SequenceFile Global variables for a SequenceFile object but can't get it to work. Here is the code that should do it:
    TS:equenceFilePtr CreateSeqFileGlobals(TS:equenceFilePtr seqFile) {
    TS:ropertyObjectPtr propObjPtr = seqFile->AsPropertyObject();
    propObjPtr->SetValString("Data.FileGlobalsDefaults.resourceHeader", 1 ,""); // resourceHeader
    propObjPtr->SetValString("Data.FileGlobalsDefaults.resourceFail", 1, ""); // resourceFail
    seqFile->IncChangeCount(); // Signify the file changed
    return(seqFile);
    Any idea why this doesn't do what I expect it to do?
    Regards,
    - Eric

  • Oracle Linux Exam Help!

    Hello!
    I will kindly ask for your honest opinions as I want to study for an Oracle Linux exam and I need to get the below indicated topics covered, but unfortunately I could not find a book to cover them all (as I did for Oracle 11g).
    Please help me locate a book, two or how many are necessary to help me study for the exam and cover the following topics:
    Thank you all!
    Installing Enterprise Linux
    Install Enterprise Linux on any supported architecture.
    Create partitions, software RAID and LVM storage configurations.
    Select Packages for Installation.
      PC Hardware & Linux
    Get detailed information about all PCI & USB devices that are connected to a Linux system
    Identify, load, unload and configure kernel modules
    Tune the running kernel using the /proc/ filesystem
      Post-Install System Configuration
    Set and maintain the system clock with date, hwclock and NTP
    Install, update and remove RPM packages with the rpm & yum commands
    Configure printers with CUPS
    Create and use Kickstart files for automated, hands-off installations
      Boot Process & SysV Init
    Configure the GRUB boot loader
    Manage SysV Init scripts, including customizing files under the /etc/sysconfig/ directory to tune SysV Init scripts
    Configure and use SysV runlevels
    Shutdown & reboot Linux systems
      User/Group Administration and NFS
    Describe and apply the User Private Group scheme
    Create, delete and configure user and system accounts
    Create, delete and configure groups
    Customize the PAM configuration
    Configure and control access to su and sudo
    Configure Linux systems to use centralized authentication and user information stores for system logins
    Implement a file server to share files with NFS v3 & v4
    Configure the automounter (autofs) allowing un-privileged users to mount filesystems on-demand
      Filesystem Administration
    Work with device nodes and udev
    Partition hard drives after installation
    Create and tune filesystems
    Mount filesystem, including persistent configuration in the /etc/fstab file
    Create, manage and tune swap devices
    Configure, manage, assign and maintain quotas on filesystems
    Create, use and remove File Access Control Lists (FACLs)
      LVM & Raid
    Configure Logical Volume Manager volume groups and logical volumes
    Create and use software RAID devices
    Grow and shrink logical volumes and the filesystems on them
    Use LVM snapshots to create consistent, reliable backups
      Task Automation & Process Accounting
    Use the at & batch facilities to run one-time tasks
    Manage cron jobs for recurring tasks, both system-wide and per-user
    Configure syslog for central system logging
    View, manage and kill running processes
    Monitor system and application logs on a daily basis with logwatch
    Configure process accounting and examine the resulting logs
    Limiting and measuring resource usage (ulimit, pam, sar, vmstat, iostat)
      Client Networking
    Configure TCP/IP networking on Linux systems
    Configure static routing on a Linux system
    Aggregate multiple network links into a single interface via the bonding driver's Etherchannel and 802.3ad support
    Configure a Linux system to participate in multiple VLANs on a managed switch via 802.1q frame tagging
    Configure and maintain a DHCP server
    Using networking diagnostics tool (ping,arp,ethtool)
    Enterprise Linux Fundamentals
    What is Linux?
    Identify the origins of UNIX and how Linux is related to UNIX
    Describe the major goals of the Free Software Foundation and the GNU project
    List key elements of a Linux distribution and name several distributions
    List several standards that apply to Linux
    Describe the basic mechanisms that make UNIX so powerful
      Multi User Concepts
    Describe the differences between the administrative (root) user and normal user accounts and explain when each should be used
    Log into the system
    Switch between accounts using the 'su' command
    Use basic commands to gather information about the system
    Use system help facilities to learn about commands and their options.
      The Linux File System
    List the standard system directories and explain what type of files are contained in each
    Navigate the file system
    Explain standard POSIX file permissions including special permissions such as the SUID, SGID and Sticky bits on both files and directories
    Change permissions of files
    Explain how file ownership (user: group) relates to file permissions
    Change ownership of files
    Describe how the User Private Group (UPG) scheme works and the problem it solves
      Manipulating Files
    Be able to create, delete, copy, move and rename files and directories
    Describe the various types of files that can be stored on UNIX and Linux file systems
    Explain hard links and symbolic links, their pros & cons and when & where they can or can not be used
    Identify the type of content of any file
    View the contents of both text-based and binary files
    Search the file system for files and directories with specific properties
      Text Processing
    Search inside of files for specified information
    Perform file editing, sorting, cutting & merging text files from the command linee
      Shell Basics
    Understand the varied roles the command shell plays in everyday UNIX/Linux usage
    Pipe several commands together to perform more complex and useful processing
    Use file redirection on the command line
    Create and use shell and environment variables to configure and control the operation of the system, the command shell and programs
    Use and escape special characters when they are used on the command line
      Regular Expressions Construct regular expressions for matching text patterns
    Archiving and Compression
    Use tar & cpio to create archives and extract files from them
    Compress and decompress files using the UNIX compress, GNU gzip, bzip2 and zip formats
      Text Editing
    Use simple text editors like pico and nano
    Perform basic and intermediate text editing functions efficiently with vi & Vim
    Perform basic and intermediate text editing functions with GNU Emacs
      Command Shells
    List the history and relationships of the various popular shell implementations available on UNIX and Linux systems
    Identify and switch between the various shell implementations
    Customize the command prompt on Bourne and BASH shells
    Use command line history, command completion, aliases and command line editing
    Customize command shell operation system wide and for individual users
      Introduction to Shell Scripting
    Process arguments passed into a shell script
    Get input from the user of a shell script
    Generate formatted output from a shell script
    Perform tasks conditionally using if, case and while loops in a shell script
    Perform repeated actions over a set of values with for loops on the command line and within shell scripts
    Do math in a shell script
      Process Management and Job Control
    Describe the differences between process and threads
    Find and control running programs with ps, top, kill, and nice
    Use the jobs, fg and bg commands to view and access several tasks at once on a single shell
    Use the screen command to run several programs and disconnect from running programs on remote systems
      Messaging
    Send local messages with the write and wall commands
    Use talk and ytalk to chat with other users
    Send and read email with the mail and pine commands
      The Secure Shell
    Configure the ssh client and sshd server programs securely
    Establish secure, remote connections to other systems
    Use SSH's key-based authentication
      Managing Software
    Find and download software via FTP & HTTP with text & graphical client programs like wget, lftp, links, Konqueror and Mozilla Firefox
    Install binary programs in RPM packages
    List software already installed on the system with RPM
    Compile and install software from source releases
    Compile and install software from a source RPM (SRPM or .src.rpm) package
      Printing
    Use CUPS to connect to available local and network printers
    Use various commands to process and convert files in preparation for printing
    Send jobs to a printer
    Monitor and remove print jobs
      Mounting FileSystems and Managing Removable Media
    Use the mount command
    Access NFS and SMB filesystems over the network
    Use autofs for on-demand mounting of filesystems without root privileges
      X Window System
    Start the graphical environment manually
    Select different desktop environments
    Launch graphical applications
    Use Linux as an X terminal
    Customize the graphical environment and auto-start applications at login and X startup
    Securely tunnel remote graphical applications through SSH

    Hello!
    I will kindly ask for your honest opinions as I want to study for an Oracle Linux exam and I need to get the below indicated topics covered, but unfortunately I could not find a book to cover them all (as I did for Oracle 11g).
    Please help me locate a book, two or how many are necessary to help me study for the exam and cover the following topics:
    Thank you all!
    Installing Enterprise Linux
    Install Enterprise Linux on any supported architecture.
    Create partitions, software RAID and LVM storage configurations.
    Select Packages for Installation.
      PC Hardware & Linux
    Get detailed information about all PCI & USB devices that are connected to a Linux system
    Identify, load, unload and configure kernel modules
    Tune the running kernel using the /proc/ filesystem
      Post-Install System Configuration
    Set and maintain the system clock with date, hwclock and NTP
    Install, update and remove RPM packages with the rpm & yum commands
    Configure printers with CUPS
    Create and use Kickstart files for automated, hands-off installations
      Boot Process & SysV Init
    Configure the GRUB boot loader
    Manage SysV Init scripts, including customizing files under the /etc/sysconfig/ directory to tune SysV Init scripts
    Configure and use SysV runlevels
    Shutdown & reboot Linux systems
      User/Group Administration and NFS
    Describe and apply the User Private Group scheme
    Create, delete and configure user and system accounts
    Create, delete and configure groups
    Customize the PAM configuration
    Configure and control access to su and sudo
    Configure Linux systems to use centralized authentication and user information stores for system logins
    Implement a file server to share files with NFS v3 & v4
    Configure the automounter (autofs) allowing un-privileged users to mount filesystems on-demand
      Filesystem Administration
    Work with device nodes and udev
    Partition hard drives after installation
    Create and tune filesystems
    Mount filesystem, including persistent configuration in the /etc/fstab file
    Create, manage and tune swap devices
    Configure, manage, assign and maintain quotas on filesystems
    Create, use and remove File Access Control Lists (FACLs)
      LVM & Raid
    Configure Logical Volume Manager volume groups and logical volumes
    Create and use software RAID devices
    Grow and shrink logical volumes and the filesystems on them
    Use LVM snapshots to create consistent, reliable backups
      Task Automation & Process Accounting
    Use the at & batch facilities to run one-time tasks
    Manage cron jobs for recurring tasks, both system-wide and per-user
    Configure syslog for central system logging
    View, manage and kill running processes
    Monitor system and application logs on a daily basis with logwatch
    Configure process accounting and examine the resulting logs
    Limiting and measuring resource usage (ulimit, pam, sar, vmstat, iostat)
      Client Networking
    Configure TCP/IP networking on Linux systems
    Configure static routing on a Linux system
    Aggregate multiple network links into a single interface via the bonding driver's Etherchannel and 802.3ad support
    Configure a Linux system to participate in multiple VLANs on a managed switch via 802.1q frame tagging
    Configure and maintain a DHCP server
    Using networking diagnostics tool (ping,arp,ethtool)
    Enterprise Linux Fundamentals
    What is Linux?
    Identify the origins of UNIX and how Linux is related to UNIX
    Describe the major goals of the Free Software Foundation and the GNU project
    List key elements of a Linux distribution and name several distributions
    List several standards that apply to Linux
    Describe the basic mechanisms that make UNIX so powerful
      Multi User Concepts
    Describe the differences between the administrative (root) user and normal user accounts and explain when each should be used
    Log into the system
    Switch between accounts using the 'su' command
    Use basic commands to gather information about the system
    Use system help facilities to learn about commands and their options.
      The Linux File System
    List the standard system directories and explain what type of files are contained in each
    Navigate the file system
    Explain standard POSIX file permissions including special permissions such as the SUID, SGID and Sticky bits on both files and directories
    Change permissions of files
    Explain how file ownership (user: group) relates to file permissions
    Change ownership of files
    Describe how the User Private Group (UPG) scheme works and the problem it solves
      Manipulating Files
    Be able to create, delete, copy, move and rename files and directories
    Describe the various types of files that can be stored on UNIX and Linux file systems
    Explain hard links and symbolic links, their pros & cons and when & where they can or can not be used
    Identify the type of content of any file
    View the contents of both text-based and binary files
    Search the file system for files and directories with specific properties
      Text Processing
    Search inside of files for specified information
    Perform file editing, sorting, cutting & merging text files from the command linee
      Shell Basics
    Understand the varied roles the command shell plays in everyday UNIX/Linux usage
    Pipe several commands together to perform more complex and useful processing
    Use file redirection on the command line
    Create and use shell and environment variables to configure and control the operation of the system, the command shell and programs
    Use and escape special characters when they are used on the command line
      Regular Expressions
    Construct regular expressions for matching text patterns
    Archiving and Compression
    Use tar & cpio to create archives and extract files from them
    Compress and decompress files using the UNIX compress, GNU gzip, bzip2 and zip formats
      Text Editing
    Use simple text editors like pico and nano
    Perform basic and intermediate text editing functions efficiently with vi & Vim
    Perform basic and intermediate text editing functions with GNU Emacs
      Command Shells
    List the history and relationships of the various popular shell implementations available on UNIX and Linux systems
    Identify and switch between the various shell implementations
    Customize the command prompt on Bourne and BASH shells
    Use command line history, command completion, aliases and command line editing
    Customize command shell operation system wide and for individual users
      Introduction to Shell Scripting
    Process arguments passed into a shell script
    Get input from the user of a shell script
    Generate formatted output from a shell script
    Perform tasks conditionally using if, case and while loops in a shell script
    Perform repeated actions over a set of values with for loops on the command line and within shell scripts
    Do math in a shell script
      Process Management and Job Control
    Describe the differences between process and threads
    Find and control running programs with ps, top, kill, and nice
    Use the jobs, fg and bg commands to view and access several tasks at once on a single shell
    Use the screen command to run several programs and disconnect from running programs on remote systems
      Messaging
    Send local messages with the write and wall commands
    Use talk and ytalk to chat with other users
    Send and read email with the mail and pine commands
      The Secure Shell
    Configure the ssh client and sshd server programs securely
    Establish secure, remote connections to other systems
    Use SSH's key-based authentication
      Managing Software
    Find and download software via FTP & HTTP with text & graphical client programs like wget, lftp, links, Konqueror and Mozilla Firefox
    Install binary programs in RPM packages
    List software already installed on the system with RPM
    Compile and install software from source releases
    Compile and install software from a source RPM (SRPM or .src.rpm) package
      Printing
    Use CUPS to connect to available local and network printers
    Use various commands to process and convert files in preparation for printing
    Send jobs to a printer
    Monitor and remove print jobs
      Mounting FileSystems and Managing Removable Media
    Use the mount command
    Access NFS and SMB filesystems over the network
    Use autofs for on-demand mounting of filesystems without root privileges
      X Window System
    Start the graphical environment manually
    Select different desktop environments
    Launch graphical applications
    Use Linux as an X terminal
    Customize the graphical environment and auto-start applications at login and X startup
    Securely tunnel remote graphical applications through SSH
    How about posting this question in the Certification Forum
    Since Oracle Linux is based on Red Hat Enterprise Linux, you can use and search "RHEL books". There should some.

  • Problem in sending variable to backing bean

    I want to send the data selected by the user that retrieved from the database to the backing bean. I have two questions. First, I don't know why the variable irl, irw, ird cannot display in the inputbox. Second, when the user click the commandbutton, it will throw NullPointerException. Please help. Thanks.
    Code of the JSF
                     <sql:query sql = "SELECT PLI_ITEM_NO,PLI_RD_CODE,PLI_TRNH_LEN,PLI_TRNH_WID,PLI_TRNH_DEP FROM PLI_PLAN_ITEM WHERE PLI_PLAN_ID = ${pid} AND PLI_ITEM_NO = ${iid}" var = "itemresult" dataSource="${db}">
                     </sql:query>
                     <table id="ro-item" cellspacing="0" cellpadding="3" border="0">
                          <c:forEach var="itemrow" items="${itemresult.rows}">
                               <c:set var="irl" value="${itemrow.PLI_TRNH_LEN}"/>
                               <c:set var="irw" value="${itemrow.PLI_TRNH_WID}"/>
                               <c:set var="ird" value="${itemrow.PLI_TRNH_DEP}"/>
                               <tr>
                                    <td>Road Category:</td>
                                    <td></td>
                               </tr>
                               <tr>
                                    <td>Length:</td>
                                    <td>
                                         <h:inputText id="itemlength" value="#{irl}" size="6"></h:inputText>m
                                    </td>
                               </tr>
                               <tr>
                                    <td>Width:</td>
                                    <td>
                                         <h:inputText id="itemwidth" value="#{irw}" size="6"></h:inputText>m
                                    </td>
                               </tr>
                               <tr>
                                    <td>Depth:</td>
                                    <td>
                                         <h:inputText id="itemdepth" value="#{ird}" size="6"></h:inputText>m
                                    </td>
                               </tr>
                          </c:forEach>     
                     </table>
                   <c:if test="${irl==null}"><c:set var="irl" value=""/></c:if>
                     <c:out value="${irl}"/>
                  <h:commandButton id="submit" value="Submit" actionListener="#{planBean.action}">
                      <f:attribute name="attributeName1" value="#{irl}" />
                  </h:commandButton>Code of the backing bean
    public class PlanBean {
        public void action(ActionEvent event) {
            String attributeName1 = FacesUtil.getActionAttribute(event, "attributeName1");
            System.out.println("attributeName1: " + attributeName1);
    }

    Its never advisable to use JSTL and JSF together
    not sure ... but if i were at ur place .. i will never use <c:forEach> and <c:if> etc with JSF
    There are a number of reasons:
    1. Using JSTL actions and JSF actions means using both JSP EL expressions and JSF EL expressions.
    Because of the subtle differences between these two expression types, it's not always obvious what's going on.
    For instance, all variables in a JSP EL expression must refer to existing beans, while beans for variables in a JSF
    value binding expression are created automatically if they don't exist. Another difference is that a JSF EL expression can't access page scope variables.
    2. When you use <c:if> to conditionally include or exclude a JSF action, the corresponding component is physically added
    or removed from the view's component tree. This can lead to strange effects because the component loses its state when
    its removed from the view.
    3. The <c:if> action and the type of conditions used in the EL expressions represent application logic,
    and it's better kept out of the template altogether.
    Intead why r u not using JSF table ...?
    the reason for null pointer may be u are declaring variable in JSTL and using as a parameter as attribute for JSF component
    try using JSF table ... things shud get resolved ...
    [http://myfaces.apache.org/trinidad/devguide/table.html|http://myfaces.apache.org/trinidad/devguide/table.html]
    [http://lavnish.blogspot.com/2007/12/all-about-adf-tables.html|http://lavnish.blogspot.com/2007/12/all-about-adf-tables.html]

  • Dynamic table header/footer on multiple pages stay original

    hi experts,
    i've got a form with a dynamic table. this means that i have a footerrow with mapped information if it should be visible or not. so the table can have from 1 to 40 columns.
    i did some scripting in the table's initialize section:
    loop over count of colums and set the headerrow, row1 and footerrow elements for index x to hidden.
    everything works out fine BUT if the data spans over multiple pages the headerrow on pages 2 to last is original again. means that the hiding of cells is not effective any more. same with footerrow (but here its fine at last page and original at  page 1 to last -1).
    i tried to hide cells again in layout:ready section for the other instances of the headerrow.
    cells got hidden, but the still visible cells didnt relocate to the left (if i hide it, there should be no space between staying cells).
    can anyone please give me a hint what i am missing here?
    does anyone have a simple sample for this task? its all about the header/footer for multiple pages!
    thanks a lot!
    daapoo

    When the footer goes to the 2nd page the page subform is incremented so you will have to reference the page subform as well. I suggest that you add a button (this is for a test only) to the footer subform and add the code app.alert(this.somExpression). Now render the form and make sure the footer stays on one page. Hit the button and take note of the someExpression. Now add enough rows to force the footer to a new page. Hit th ebutton again and take note of the changed somExpression. So to solve your problem you will have to find out which page your footer is on. and then construct your expression to incorporate this chane in expression. Note that the indexes are 0 based but the page numbering is 1 based.
    Hope that helps
    Paul

  • Code problem

    Hey i've this button on my applet that when clicked passes text entered in a textArea to a seperate class,then shows the result (after the class is finished with it), at least thats what its supposed to do. What happens is that a flock of errors occur. Can anyone spot the problem
    Here's the button code
    public boolean action (Event e, Object o)
         if (e.target == b1)
         first = text1.getText();
         ParseMe parser = new ParseMe(first);
            if( parser.answer()==1){
           showStatus("Answer was" + parser.answer());
           return true;
         }else{
           showStatus("Answer was" + parser.answer());
           return false;
       }and this is the class that the info's bein passed to
    package test.pkg;
    public final class ParseMe {
            //----------------- public interface ---------------------------------------
            public ParseMe(String definition) {
                    // Construct an expression, given its definition as a string.
                    // This will throw an IllegalArgumentException if the string
                    // does not contain a legal expression.
                    parse(definition);
            public double answer(){
              return this.value(1.0,1.0,1.0)+ this.computeStackUsage();
            public double value(double x) {
                    // Return the value of this expression, when the variable x
                    // has the specified value.  If the expression is undefined
                    // for the specified value of x, then Double.NaN is returned.
                    return eval(x, 0, 0);
            public double value(double x, double y) {
                    // Return the value of this expression, when the variable x
                    // has the specified value.  If the expression is undefined
                    // for the specified value of x, then Double.NaN is returned.
                    return eval(x, y, 0);
            public double value(double x, double y, double z) {
                    // Return the value of this expression, when the variable x
                    // has the specified value.  If the expression is undefined
                    // for the specified value of x, then Double.NaN is returned.
                    return eval(x, y, z);
            public String getDefinition() {
                    // Return the original definition string of this expression.  This
                    // is the same string that was provided in the constructor.
                    return definition;
            //------------------- private implementation details ----------------------------------
            private String definition;  // The original definition of the expression,
            // as passed to the constructor.
            private byte[] code;        // A translated version of the expression, containing
            //   stack operations that compute the value of the expression.
            private double[] stack;     // A stack to be used during the evaluation of the expression.
            private double[] constants; // An array containing all the constants found in the expression.
            private static final byte  // values for code array; values >= 0 are indices into constants array
                    PLUS = -1,   MINUS = -2,   TIMES = -3,   DIVIDE = -4,  POWER = -5,
                    UNARYMINUS = -6, VARIABLE_X = -7, VARIABLE_Y = -8, VARIABLE_Z = -9;
            private double eval(double variableX, double variableY, double variableZ) {
          // evaluate this expression for this value of the variable
                    try {
                            int top = 0;
                            for (int i = 0; i < codeSize; i++) {
                                    if (code[i] >= 0)
                                            stack[top++] = constants[code];
    else if (code[i] >= POWER) {
    double y = stack[--top];
    double x = stack[--top];
    double ans = Double.NaN;
    switch (code[i]) {
    case PLUS: ans = x + y; break;
    case MINUS: ans = x - y; break;
    case TIMES: ans = x * y; break;
    case DIVIDE: ans = x / y; break;
    case POWER: ans = Math.pow(x,y); break;
    if (Double.isNaN(ans))
    return ans;
    stack[top++] = ans;
    else if (code[i] == VARIABLE_X) {
    stack[top++] = variableX;
    else if (code[i] == VARIABLE_Y) {
    stack[top++] = variableY;
    else if (code[i] == VARIABLE_Z) {
    stack[top++] = variableZ;
    else {
    double x = stack[--top];
    double ans = Double.NaN;
    switch (code[i]) {
    case UNARYMINUS: ans = -x; break;
    if (Double.isNaN(ans))
    return ans;
    stack[top++] = ans;
    catch (Exception e) {
    return Double.NaN;
    if (Double.isInfinite(stack[0]))
    return Double.NaN;
    else
    return stack[0];
    private int pos = 0, constantCt = 0, codeSize = 0; // data for use during parsing
    private void error(String message) {  // called when an error occurs during parsing
    throw new IllegalArgumentException("Parse error: " + message + " (Position in data = " + pos + ".)");
    private int computeStackUsage() {  // call after code[] is computed
    int s = 0; // stack size after each operation
    int max = 0; // maximum stack size seen
    for (int i = 0; i < codeSize; i++) {
    if (code[i] >= 0 || code[i] == VARIABLE_X
    || code[i] == VARIABLE_Y || code[i] == VARIABLE_Z
    s++;
    if (s > max)
    max = s;
    else if (code[i] >= POWER)
    s--;
    return max;
    private void parse(String definition) {  // Parse the definition and produce all
    // the data that represents the expression
    // internally; can throw IllegalArgumentException
    if (definition == null || definition.trim().equals(""))
    error("No data provided to Expr constructor");
    this.definition = definition;
    code = new byte[definition.length()];
    constants = new double[definition.length()];
    parseExpression();
    skip();
    if (next() != 0)
    error("Extra data found after the end of the expression.");
    int stackSize = computeStackUsage();
    stack = new double[stackSize];
    byte[] c = new byte[codeSize];
    System.arraycopy(code,0,c,0,codeSize);
    code = c;
    double[] A = new double[constantCt];
    System.arraycopy(constants,0,A,0,constantCt);
    constants = A;
    private char next() {  // return next char in data or 0 if data is all used up
    if (pos >= definition.length())
    return 0;
    else
    return definition.charAt(pos);
    private void skip() {  // skip over white space in data
    while(Character.isWhitespace(next()))
    pos++;
    // remaining routines do a standard recursive parse of the expression
    private void parseExpression() {
    boolean neg = false;
    skip();
    if (next() == '+' || next() == '-') {
    neg = (next() == '-');
    pos++;
    skip();
    parseTerm();
    if (neg)
    code[codeSize++] = UNARYMINUS;
    skip();
    while (next() == '+' || next() == '-') {
    char op = next();
    pos++;
    parseTerm();
    if (op == '+')
    code[codeSize++] = PLUS;
    else
    code[codeSize++] = MINUS;
    skip();
    private void parseTerm() {
    parseFactor();
    skip();
    while (next() == '*' || next() == '/') {
    char op = next();
    pos++;
    parseFactor();
    if (op == '*')
    code[codeSize++] = TIMES;
    else
    code[codeSize++] = DIVIDE;
    skip();
    private void parseFactor() {
    parsePrimary();
    skip();
    while (next() == '^') {
    pos++;
    parsePrimary();
    code[codeSize++] = POWER;
    skip();
    private void parsePrimary() {
    skip();
    char ch = next();
    if (ch == 'x' || ch == 'X') {
    pos++;
    code[codeSize++] = VARIABLE_X;
    else if (ch == 'y' || ch == 'Y') {
    pos++;
    code[codeSize++] = VARIABLE_Y;
    else if (ch == 'z' || ch == 'Z') {
    pos++;
    code[codeSize++] = VARIABLE_Z;
    else if (Character.isDigit(ch) || ch == '.')
    parseNumber();
    else if (ch == '(') {
    pos++;
    parseExpression();
    skip();
    if (next() != ')')
    error("Exprected a right parenthesis.");
    pos++;
    else if (ch == ')')
    error("Unmatched right parenthesis.");
    else if (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '^')
    error("Operator '" + ch + "' found in an unexpected position.");
    else if (ch == 0)
    error("Unexpected end of data in the middle of an expression.");
    else
    error("Illegal character '" + ch + "' found in data.");
    private void parseNumber() {
    String w = "";
    while (Character.isDigit(next())) {
    w += next();
    pos++;
    if (next() == '.') {
    w += next();
    pos++;
    while (Character.isDigit(next())) {
    w += next();
    pos++;
    if (w.equals("."))
    error("Illegal number found, consisting of decimal point only.");
    if (next() == 'E' || next() == 'e') {
    w += next();
    pos++;
    if (next() == '+' || next() == '-') {
    w += next();
    pos++;
    if (! Character.isDigit(next()))
    error("Illegal number found, with no digits in its exponent.");
    while (Character.isDigit(next())) {
    w += next();
    pos++;
    double d = Double.NaN;
    try {
    d = Double.valueOf(w).doubleValue();
    catch (Exception e) {
    if (Double.isNaN(d))
    error("Illegal number '" + w + "' found in data.");
    code[codeSize++] = (byte)constantCt;
    constants[constantCt++] = d;
    /*public static void main(String args[])
    ParseMe me = new ParseMe("1");
    System.out.println(me.value(1,1,1) + ", " + me.computeStackUsage());
    any help would be well appreciated.
    cheers
    podger

    It looks like it parses a mathematical expression represented as a String with up to three variables (x, y, z), and will substitute x, y, and z with whatever values you give it. What is your "text" (value of "first") that you are trying to parse?
    Eventually, you probably want to have text fields for the user to enter x, y, and z, parse those text values as doubles, and pass those to your ParseMe instance by calling: parser.value(x, y, z);
    What happens if you type the following in the text field named "text1"?
    x + y + z

  • JDeveloper 11g Using jsp to display images

    I am converting a 10.1.3.3 application to 11.1.1.3
    It has 2 web modules. One is an ADF administrator module and the other is a public web that displays information including images stored as blobs.
    This public module has a simple technology scope, only html, java, jsp and servlets. It is a hand me down from a few technologies ago and ran well on 10.1.3.3
    To display images it uses a jsp acting as a servlet which is referenced inside other jsps. Since moving to 11g the images no longer display. If I use a java class servlet it works
    however I have to use the full url, e.g. http://mydomain:myport/web/Sevlet?.... which means I have to update the details for each deployment.
    I can use <h:graphicImage but this means I have to include JSF and use expression language to fill in the servlet parameters.
    I don't know what has changed to cause it to fail. Weblogic?
    The Libraries and Classpath include
    JSP Runtime
    Servlet Runtime
    JSTL 1.2
    The servlet jsp is as follows remembering it works in 10.1.3.3
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="javax.naming.Context" %>
    <%@ page import="java.io.*" %>
    <%@ page import="userinterface.util.ByteArray" %>
    <%@ page import="userinterface.online.ImageUIHelper" %>
    <%@ page import="userinterface.online.ImageUIHelperValue" %>
    <%
         String dataObjectId = "";
         String regionId = "";
         boolean getObjectImage=false;
         boolean getRegionImage=false;
         // determine which type of image to retrieve
         if (request.getParameter("dataObjectId") != null)
              dataObjectId = request.getParameter("dataObjectId").toString();
              getObjectImage=true;
         } else if (request.getParameter("regionId") != null)
              regionId = request.getParameter("regionId").toString();
              getRegionImage=true;
         if (getObjectImage==true || getRegionImage == true)
              try
                   ImageUIHelper imageHelper = new ImageUIHelper();
                   ImageUIHelperValue vo = null;
                   if (getObjectImage)
                        vo = imageHelper.doReadObjectImage(new Integer(dataObjectId));
                   } else if (getRegionImage)
                        vo = imageHelper.doReadRegionImage(new Integer(regionId));
                   if (vo != null && vo.getImage() != null)
                        // determine the mimetype
                        String mimeType="image/png";
                        if (vo.getFilename().toLowerCase().endsWith(".gif"))
                             mimeType = "image/gif";
                        else if (vo.getFilename().toLowerCase().endsWith(".jpg"))
                             mimeType = "image/jpg; charset=windows-1252";
                        else if (vo.getFilename().toLowerCase().endsWith(".png"))
                             mimeType = "image/png";
                        else if (vo.getFilename().toLowerCase().endsWith(".bmp"))
                             mimeType = "image/bmp";
                        response.setContentType(mimeType);
                        response.setHeader("pragma", "no-cache");
                        ServletOutputStream os = response.getOutputStream();
    os.write(vo.getImage().getBytes());
                        os.flush();
                        os.close();
              } catch (Exception ex)
    A simple test harness follows. The actual pages substitute the java values using <%= uri %> as below
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%
    String uri = "http://localhost:7101/publicweb/img/ImageServlet?imageType=dataObject&dataObjectId=822";
    String uri2 = "ImageServlet.jsp?dataObjectId=822";
    String uri3 = "ImageServlet.jsp?dataObjectId=694";
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
    <title>testServlet</title>
    </head>
    <body>
    <table cellspacing="2" cellpadding="3" border="1" width="100%">
    <tr>
    <td width="20%">Checking Servlet</td>
    <td width="80%"><img src=<%= uri %>
    id="imge"
    width="400px" alt="Image" />
    </td>
    </tr>
    </table>
    </body>
    </html>

    i responded to your duplicate message 4 days ago:
    is it possible to insert and retrieve images from sql server using actionscript.
    you'll need server-side script to query your database and you can use the flash urlloader class to call your script.
    also  is it possible to create a flash scrolling gallery based on images  stored in a database and everytime an image is added it is displayed in  the gallery.
    load the data using the urlloader class and  then load the images.  periodically query the database for new images if  there's no direct way for flash to know a new image was added.

  • XSLT with XML XPath references

    I have not used XSLT, and don't need to much, but have questions on creating XML that will be used by client's XSLT.
    We are using a tool (xstream) that automatically transforms a Java object into XML. When it has multiple references to the same object, instead of expanding it in each place, it refers to the previous location of the object. It can do this in two ways (examples below).
    My question is, can XSLT use the XPath or RefID to navigate the XML? I know XSLT uses XPath, but I'm not sure if it uses it in this way.
    -- Note in the following examples how 'type' and 'item' are the exact same object, and the second instance of the object refers to the first location in the XML doc.
    <saleLineItemGrouping>
      <item class="item">
        <id>3000</id>
        <retailPrice>
          <type>
             <code>USD</code>
             <description>US Dollars</description>
             <decimalPlaces>2</decimalPlaces>
             <locale>en_US</locale>
          </type>
          <amount>400000000</amount>
        </retailPrice>
        <markdownAmount>
          <type reference="../../retailPrice/type"/>
          <amount>0</amount>
        </markdownAmount>
      </item>
      <lineItems>
        <saleLineItem>
          <item class="item" reference="../../../item"/>
    <saleLineItemGrouping id="1">
      <item class="item" id="2">
        <id>3000</id>
        <retailPrice id="3">
          <type id="4">
             <code>USD</code>
             <description>US Dollars</description>
             <decimalPlaces>2</decimalPlaces>
             <locale id="5">en_US</locale>
          </type>
          <amount>400000000</amount>
        </retailPrice>
        <markdownAmount id="6">
          <type reference="4"/>
          <amount>0</amount>
        </markdownAmount>
      </item>
      <lineItems id="7">
        <saleLineItem id="8">
          <item class="item" reference="2"/>

    So as I read your answer, I understand XSLT cannot
    "construct XPath expressions." But, can it read in
    XML with that XPath notation?Sure, it can read in that XML. It's well-formed XML so why not? But I gather you want your XSLT to take those attributes, whose values are strings, and interpret those strings as XPath expressions. That, XSLT can't do.
    To put it another way, the XPath expressions in an XSLT stylesheet have to be basically hard-coded there. So you could possibly solve your problem by first transforming the XML into an XSLT containing those expressions; e.g.<type reference="../../retailPrice/type"/>could be transformed into<xsl:value-of select="../../retailPrice/type"/>and then use that XSLT to do the actual transforming. But it would be extremely difficult to make that work -- I wouldn't want to have to do it myself.
    The second idea, using reference="2" to refer to <item class="item" id="2">, is much more feasible.
    Thank you for your replies and your patience.You're welcome. Have fun with XSLT.

  • Report Formatting with Dynamic Height Header/Footer

    I need to generate a printable report (pdf if possible) with a:
    1) Header - Dynamic Height based on recordset output
    2) Body - Recordset output, may carry over to multiple pages
    3) Footer - Dynamic Height based on recordset out
    In short, the whole page is dynamic- The header and footer need to be on every page and whatever height is left over to fit within the print area goes to the body and the line item output of each record (think invoice).  Then the number of pages will depend on how long it takes to output the body recordset (but the header and footer MUST be on each page).
    I have been trying to get this to work using cfdocument since CF7 and have never had any luck. It has not worked due to the reason that since the header and footer are dynamic height, I do not have any way to set the margins properly on page generation (so it shrinks the header or leaves excess whitespace).
    Anyone recommend the best way to go about this? I have heard about the report builder and am not sure if that will fit these requirements.  I appreciate any assistance!

    When the footer goes to the 2nd page the page subform is incremented so you will have to reference the page subform as well. I suggest that you add a button (this is for a test only) to the footer subform and add the code app.alert(this.somExpression). Now render the form and make sure the footer stays on one page. Hit the button and take note of the someExpression. Now add enough rows to force the footer to a new page. Hit th ebutton again and take note of the changed somExpression. So to solve your problem you will have to find out which page your footer is on. and then construct your expression to incorporate this chane in expression. Note that the indexes are 0 based but the page numbering is 1 based.
    Hope that helps
    Paul

  • XPATH building assistant locks up in JDev 10.1.2 beta 3

    When I attempt to use either the XPATH building assistant or XPATH expression builder in JDev 10.1.2 beta 3 it locks up JDev apparently going into a tight loop using 99% of the CPU and it won't come out. I end up killing the process. I've tried several different techniques to work around the lock up but can't seem to bypass it.
    The building assistant locks up almost right away, while the expression builder waits until I'm finished constructing the expression.
    I can't get very far with this condition. Any help would be appreciated.

    Hi John ,
    Thanks for sending your project accross.
    I tried to reproduce it but couldn't due to missing XSDs and wsdls used by your project.
    I can see some schema import from URL in your project WSDL :
    <import namespace="http://www.eds.com/ns/iC"           schemaLocation="http://localhost:9700/orabpel/xmllib/providerEnrollment.xsd"/>
    and
    a online wsdl :
    http://W2ZZZZIDNN:9700/orabpel/default/licenseReceipt/licenseReceipt?wsdl
    Without these artifacts, process doesn't find the variable definition.
    I have few suggestions :
    1. Make sure you have XSDs in right place and the XSDs are valid.
    2. Make sure your engine is started otherwise those XSDs won't be accessible.
    3. Go to Jdeveloper->Tools->Preferences->Web Browser and Proxy [Set it right] but if it localhost then I don't think it is required.
    If possible pass those XSDs as well to me so that I can verify that those XSDs are working fine with our tool.
    Please pass me the WSDL as well.
    HTH.
    Thanks,
    rakesh

  • Making dynamic table header

    Hi,
    I want to know how to put some value on a table header dynamically.
    Regards
    Hawker

    When the footer goes to the 2nd page the page subform is incremented so you will have to reference the page subform as well. I suggest that you add a button (this is for a test only) to the footer subform and add the code app.alert(this.somExpression). Now render the form and make sure the footer stays on one page. Hit the button and take note of the someExpression. Now add enough rows to force the footer to a new page. Hit th ebutton again and take note of the changed somExpression. So to solve your problem you will have to find out which page your footer is on. and then construct your expression to incorporate this chane in expression. Note that the indexes are 0 based but the page numbering is 1 based.
    Hope that helps
    Paul

Maybe you are looking for

  • Lose interfaces from MRTG monitor system after upgrade.

    After upgrade C7609S routers from: c7600rsp72043-adventerprisek9-mz.122-33.SRD4.bin to c7600rsp72043-adventerprisek9-mz.150-1.S3a.bin I lose interface with ip mpls configure form the MRTG SNMP pooling system. cfgmakre not see any more that interfaces

  • Can you not create nested rules in smart playlists in 11.1.3?

    I tried to create a nested rule for a smart playlist today, and found the ellipsis (which you click to add a nesting rule) is no longer there. Advice, please?

  • I give up--good luck ZM us

    Well, after a month my Zen Micro (ZM) ceased up, was making a funny noise from the hard dri've, so I got an RMA from Amazon (thank god for Amazon!) and returned it for a new one. This time it worked fine for about 6 weeks, without any of the initial

  • I could load Yamaha C7 grand in Logic Pro BUT I could not load in MainStage

    Hi there, I tried to load Yamaha C7 grand in Mainstage, but i won't load  but instead a "Organ sound" after i choose Yahama Grand. ALL the Yamaha grand in Logic could be loaded and sound perfectly ok. Could some one help  me to solve my problem in Ma

  • N95 Backup .ARC

    Hey guys I backed up my data from an N90 n saved it on the mmc. I have now gotten an N95 8Gb and when using the content copier on NSeries PC Suite it doesn't recognize the .arc backup file. Any suggestions on what i can do to get around it. My previo