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" ?

Similar Messages

  • How to find Length of String

    Hi
    how to find length of a string.. i have a requirement that user cannot add more than 9 digits in a string.. i am new to WD Abap..
    Regards,
    Puneet

    Hi,
    You can use STRLEN command for your requirement.
    First read your input field using code wizard.
    Then using STRLEN command you can find the length of the Input field.
    For Example :
    Here input is your input field.
    data :    length type i.
    length = strlen(input).
    If length < 9.
    raise error msg.
    endif.
    Edited by: Viji on Mar 26, 2008 11:30 AM

  • How to find and replace any string between " "

    Hi everyone,
    Here my sample
    String szTest;
    szTest = "Yellow banana";
    szTest = "Blue monkey";
    szTest = "Red mango";
    szTest is only needed when it's in testing progress. Now I want to put all of that in the /*comment*/ so the released program won't run those code any more (but still keep szTest so I can use it for future develop testing).
    So Here what I want after using the Find and Replace Box:
    //String szTest; //Manual
    /*szTest = "Yellow banana";*/ //use find and replace
    /*szTest = "Blue monkey";*/ //use find and replace
    /*szTest = "Red mango";*/ //use find and replace
    I think I can do this with Regular expressions or Wildcards. But I don't know how to find and replace any string between " and ".
    Find: szTest = " ??Any string?? ";
    Replace with: /*szTest = " ??Any string?? ";*/
    Thanks for reading.

    Hi Nathan.j.Smith,
    Based on your issue, I suggest you can try the Joel's suggestion check your issue again. In addition, I find a MSDN document about how to use the Regex.Replace Method to match a regular expression pattern with a specified replacement string,
    maybe you will get some useful message.
    https://msdn.microsoft.com/en-us/library/xwewhkd1(v=vs.110).aspx
    If the above suggestion still could not provide you, could you please tell me what language you use to create the program for finding and replace any string using regular expression so that we will find the correct programming develop forum to support this
    issue?
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to find number from text string??

    Hi All,
    Can you tell me how to find/ fetch number from string?
    is there any function module  for this.?
    for example , I have string like "+++++1000000589+++"
    and I need to fetch the invoice no 1000000589 from the above string..then  How to do that? Letters may come first or number may come first and latter text...
    Regards,
    Mrunal

    You can do like this.
    The below mentioned is code separate material
        DO 18 TIMES.
          LV_C = LV_C + 1.
          LV_C1 = LV_C - 1.
          IF  GW_MATNR-MATNR+LV_C1(1) CN '0,1,2,3,4,5,6,7,8,9' .
            IF ( ( LV_MAT EQ SPACE ) ) ."  and ( lv_prefix eq space ) ) .
              LV_PREFIX = 'X'.
              CONCATENATE GW_TEMP-PREFIX GW_MATNR-MATNR+LV_C1(1) INTO
              GW_TEMP-PREFIX.
            ELSE.
              LV_SUFFIX = 'X'.
              CONCATENATE GW_TEMP-SUFFIX GW_MATNR-MATNR+LV_C1(1) INTO
              GW_TEMP-SUFFIX.
            ENDIF.
          ELSEIF ( ( LV_SUFFIX EQ SPACE ) ) .
            LV_MAT = 'X'.
            CONCATENATE GW_TEMP-MATNR1 GW_MATNR-MATNR+LV_C1(1) INTO
            GW_TEMP-MATNR1.
          ELSEIF ( ( LV_MAT EQ 'X' ) ) .
            CONCATENATE GW_TEMP-SUFFIX GW_MATNR-MATNR+LV_C1(1) INTO
            GW_TEMP-SUFFIX.
          ENDIF.
        ENDDO.

  • How to find number of files in a folder using pl/sql

    please someone guide as to how to find number of files in a folder using pl/sql
    Regards

    The Java option works well.
    -- results table that will contain a file list result
    create global temporary table directory_list
            directory       varchar2(1000),
            filename        varchar2(1000)
    on commit preserve rows
    -- allowing public access to this temp table
    grant select, update, insert, delete on directory_list to public;
    create or replace public synonym directory_list for directory_list;
    -- creating the java proc that does the file listing
    create or replace and compile java source named "ListFiles" as
    import java.io.*;
    import java.sql.*;
    public class ListFiles
            public static void getList(String directory, String filter)
            throws SQLException
                    File path = new File( directory );
                    final String ExpressionFilter =  filter;
                    FilenameFilter fileFilter = new FilenameFilter() {
                            public boolean accept(File dir, String name) {
                                    if(name.equalsIgnoreCase(ExpressionFilter))
                                            return true;
                                    if(name.matches("." + ExpressionFilter))
                                            return true;
                                    return false;
                    String[] list = path.list(fileFilter);
                    String element;
                    for(int i = 0; i < list.length; i++)
                            element = list;
    #sql {
    insert
    into directory_list
    ( directory, filename )
    values
    ( :directory, :element )
    -- creating the PL/SQL wrapper for the java proc
    create or replace procedure ListFiles( cDirectory in varchar2, cFilter in varchar2 )
    as language java
    name 'ListFiles.getList( java.lang.String, java.lang.String )';
    -- punching a hole in the Java VM that allows access to the server's file
    -- systems from inside the Oracle JVM (these also allows executing command
    -- line and external programs)
    -- NOTE: this hole MUST be secured using proper Oracle security (e.g. AUTHID
    -- DEFINER PL/SQL code that is trusted)
    declare
    SCHEMA varchar2(30) := USER;
    begin
    dbms_java.grant_permission(
    SCHEMA,
    'SYS:java.io.FilePermission',
    '<<ALL FILES>>',
    'execute, read, write, delete'
    dbms_java.grant_permission(
    SCHEMA,
    'SYS:java.lang.RuntimePermission',
    'writeFileDescriptor',
    dbms_java.grant_permission(
    SCHEMA,
    'SYS:java.lang.RuntimePermission',
    'readFileDescriptor',
    commit;
    end;
    To use:
    SQL> exec ListFiles('/tmp', '*.log' );
    PL/SQL procedure successfully completed.
    SQL> select * from directory_list;
    DIRECTORY FILENAME
    /tmp X11_newfonts.log
    /tmp ipv6agt.crashlog
    /tmp dtappint.log
    /tmp Core.sd-log
    /tmp core_intg.sd-log
    /tmp da.sd-log
    /tmp dhcpclient.log
    /tmp oracle8.sd-log
    /tmp cc.sd-log
    /tmp oms.log
    /tmp OmniBack.sd-log
    /tmp DPISInstall.sd-log
    12 rows selected.
    SQL>

  • How to find out which sequence a certain column used?

    you konw column C in table T is created by a sequence.
    How to find out which sequence column C is using?

    In the meantime I think it ought to becompulsory to
    only assign sequence values in triggers.
    Why? I can see no good reason for this. I think it's a good idea to have stuff like this
    coded in only one placeI don't like your argument for compulsory using triggers for sequences for exactly the same reason as you, ie that I like to keep my code in one place. If I'm reading some pl/sql code which uses a sequence I like to see the fact that the sequence is used in the pl/sql code, rather than to check to see if theres a trigger on the table and then see which sequence that uses.
    "naming conventions can work, provided they're enforced. Alas, like other standards, they can only be enforced by active policing".
    Thats what code reviews are.
    " there is also the special case of one sequence populating more than one table...."
    This is My Pet hate. I don't think there's ever a case where this is absolutely necessary. Again code reviews
    Unfortunately I have to live with a system which does this.
    and I appreciate we can't all have code reviews, etc.

  • How to find the font and replace another font using javascript in illustrator?

    Dear All,
    how to find the font and replace another font using javascript [batch process] in illustrator?
    i have 700 image file, it very deficult replace one by one.
    regards,
    .Suresh.S

    Ask the creator of the file for a unprotected version.

  • How to find sales order no., purchase order no. using sales order ID,PO ID

    hi,
    how to find sales order no., purchase order no. using sales order ID,PO ID
    Thank you,
    hari om

    Dear Hari Om,
    Could you please tell me, to what are you referring Sales Order ID and P.O. ID?
    meanwhile check with:
    T. Code: SE16
    Table: VBKD
    Execute (F8) the Report.
    On to next Screen, Go to Menu-bar
    Settings --> Format_Lists --> Choose Fields
    Field: VBELN - Sales Order
    Field: BSTKD - Purchase Order No.
    Best Regards,
    Amit

  • How to find out locations whether it is in use or not in use

    Hi All,
    I want to delete all unused locations from my FDM application. Can you please help me, how to find the locations that are not in use?
    Regards,
    PB

    You can view the tdataseg(x) table that the location is associated with and sort by period key as needed.
    Select PartitionKey,Part Name,Partsegmentkey
    from tpovpartiton
    This will return the location, location id and segment key.  The segment key is the data segment that the location is associated with.
    You can then query this table and sorty by period key to see what periods the location has data imported for.
    This should give you an idea and you can then delete your locations from within the Metadata > Locations Menu in FDM.
    Keep in mind that once the location is deleted, and data associated with the location will also be deleted (Historical Data)
    Hope that answers your question.

  • How to find out the script for the table using SQL

    Hi,
    Could any one tell me that how to find out the script for the table using SQL.
    Thanks,
    kamal

    Kamal,
    You can find the SQL query in Advanced tab of Answers
    Thanks,
    Balaa...

  • HT3986 how to find out serial no. of imac while using windows 7

    how to find out serial no. of imac while using windows 7

    In Windows open up the Command Prompt and type the following:
    c:> wmic bios get serialnumber

  • How to find which version of JDK is loadjava using

    Hi All,
    How to find which version of JDK is loadjava using?
    I am using Oracle : 9.0.1.5.1 and I need to use class javax.crypto.Cipher which is shipped with JDK 1.4.2, but loadjava is unable to import javax.crypto.*;
    Any inputs would be greatly appreciated.
    Thanks and regards,
    Abba

    Abba,
    From memory only (since I haven't verified it), "loadjava" is a script, so you can have a look at its contents. I believe it actually uses JDK 1.1.8 (which is part of the Oracle installation). In any case, Oracle 9i is compatible with JDK 1.3 only.
    Oracle 10g is compatible with JDK 1.4.
    Good Luck,
    Avi.

  • How do I print from my I Pad 2 using Airport Express

    How do I print from my I pad 2 using airport express.

    At this time you can't, not if you mean a printer connected via USB to the Airport unless there's been an app or workaround released that I haven't seen, or unless the printer is one of the few wireless printers that support AirPrint or for which the manufacturer has released their own app. At this time only HP has come out with printers that support AirPrint, which allows an iOS device to natively print directly to a wireless printer:
    http://support.apple.com/kb/HT4356
    It's possible other printer manufacturers may provide updates to their printers to make them AirPrint capable. It's also possible that eventually Apple will support printers connected to a computer or Time Capsule. HP also has an app that allows printing to some of their other wireless printers, as if memory serves does Brother.
    If you don't have an HP printer or a another printer with an app available, then for now, you would have to connect the printer to your computer, then search the web for something like "airprint Windows hack" and you'll find instructions on enabling printing. If you have a Mac, try Printopia. 
    Regards.

  • How to find length of string after encryption using DBMS_CRYPTO package

    Hi,
    I am planning do data encryption using DBMS_CRYPTO package. I want to find how much will be string length after encryption.
    e.g When I try to encrypt string of length between 1-15 characters it gives me encrypted string of 32 characters. When I try with 16 charcters encrypted string is of 64 characters.
    Is ther any formula to calculate length of encrypted string?
    Thanks
    Pravin

    The length change is dependent upon the algorithm you are using which can be a combination of cipher block, padding, and chaining.
    The best solution is determine the method you are going to use and apply it to the l ongest possible strings you are going to proces, then add some safety margin. There iis no penalty for defining your column as VARCHAR2(4000).

  • How is the length of a string calculated in Java?  and JavaScript?

    Hi all,
    Do any of you know how the length of a string is being calculated in Java and JavaScript? For example, a regular char is just counted as 1 char, but sometimes other chars such as CR, LF, and CR LF are counted as two. I know there are differences in the way Java and JavaScript calculate the length of a string, but I can't find any sort of "rules" on those anywhere online.
    Thanks,
    Yim

    What's Unicode 4 got to do with it? 1 characteris 1
    character is 1 character.
    strings now contain (and Java chars also) is
    UTF-16 code units rather than Unicode characters
    or
    code points. Unicode characters outside the BMPare
    encoded in Java as two or more code units. So it would seem that in some cases, a single
    "character" on the screen, will require two charsto
    represent it.So... you're saying that String.length() doesn't
    account for that? That sux. I don't know. I'm just making infrerences (==WAGs) based on what DrClap said.
    I assume it would return the number of chars in the array, rather than the number of symbols (glyphs?) this translates into. But I might have it bass ackwards.

Maybe you are looking for