Restrict Special Characters in String Fields

Hello,
My Jdev version is 11.1.1.6 using ADF BC and ADF Faces as technology stack.
I have a requirement to restrict special characters, html tags as input in String/Varchar2 fields.
I have couple of thoughts that can be used in application but not sure which is the best approach:
1. Implement <af:validateRegExp pattern="regular Exp"> inside <af:inputText> component
2. Implement Entity based validator using Regular Expression
Apart from picking the best out of above two, I would like to know if there is a better way to implement this validation.
My application has custom framework extn classes and all Entities/View Objects extend those. Is there a possibility to implement this type of validation at some central place.
I would highly appreciate expert inputs here.
Thanks,
Jai

Hi,
the answer to your question is *"use both"*. The entity level would be enough but then would make people subniitting a request afte which they see an error The RegEx validator in ADF Faces handles problems on the client side and thus before a submit is sent to the server (where it then would be also checked using server side validation in ADF Faces). Why not using RegEx validation in ADF faces alone? Because there are potentially many views accessing your entity through view objects and if only one developer forgets the RegEx validator you would be screwed.
Frank

Similar Messages

  • Restricted Special characters in KM Resource name

    Hi,
    While creating resources in KM, it is not allowing some special characters (ex: '?' , ':') in name.
    How do we know what are all the restricted special characters in KM?
    Please let me know.
    Thanks

    I think the file name restrictions which apply to naming of files on the PC apply to KM Resources as well since the file will have to be created on some file system itself.
    Do refer to [this|http://kb.wisc.edu/page.php?id=2533] link to peek at the list of restricted characters.
    Thanks,
    GLM

  • Replace special characters in String

    Dear Guru ,
    Does SAP provide the standard function that can replace the special characters in String ?
    For example :
    I have one template string : " & & & & & output(s) have not been processed yet ! " and five parameters : "P1" , "P2" , "P3" , "P4" , "P5" .
    And i would like to apply all parameters into the string to replace the "&" character . Is it possibile ?
    My idea is sourcing from the Message String that in tcode : SE91 .
    Thanks .
    Best Regards,
    Carlos Zhang

    Hi Carlos,
    I think instead of a standard FM you can write a one line command to do this job.
    E.g. 
    constant: str1 type string value 'output(s) have not been processed yet ! '.
    data: var1 type c,
             var2 type c,
             var3 type c,
             var4 type c,
             str    type string.
    concatenate var1 var2 var3 var4 str1 into str separated by space.
    So str will have the final value.
    Thanks,
    Mainak

  • Restricting special characters

    Hi All
    I am currently doing the payment extract interface program for the bank. The point here is that the bank doesn't allow some characters which are considered as special characters like (#,$,%,^,*,&) etc..In most of the information like vendor name and invoice numbers they are using these characters.
    In my interface program, i am removing this special characters and replacing it with space or '+' symbol as prescribed by bank through translate command.
    translate(VENDOR_NAME,'/!;<>"{}[]|=_*&^%$@~#',' ')
    But my question is how could i restrict them at the entry level itself?
    In case of invoice creation form, when they enter #INV123 then i should intimate them that they have used special characters. Is that possible to do it in Forms personalisation?
    Regards
    Santhosh

    Duplicate post see:
    Restricting special characters
    Gareth

  • How to restrict special characters for a specific column

    Dear gurus,
    i have a table emp with a field field_1
    in this particular field_1 is an address column where data can be like '12 st first floor' but suppose mistakenly user has entered the data as '12 st first floor & ' it should be restricted (not using trigger but can this be possible by using constraints )so for this how can we restrict the special characters not to get entered into the column.
    regards,
    friend

    Another way of doing it.
    drop table test_table;
    create table test_table (col varchar2(50));
    alter table test_table add constraint chk_address check (NOT regexp_like(col, '[[:punct:]]+'));
    insert into test_table
    (select  'some text' col from dual);
    1 rows inserted.
    insert into test_table
    (select  'some text!' col from dual);
    Error starting at line 20 in command:
    insert into test_table
    (select  'some text!' col from dual)
    Error report:
    SQL Error: ORA-02290: check constraint (FDL_DEV.CHK_ADDRESS) violated
    02290. 00000 -  "check constraint (%s.%s) violated"
    *Cause:    The values being inserted do not satisfy the named check
    *Action:   do not insert values that violate the constraint.
    insert into test_table
    (select  'some text House#32' col from dual);
    Error starting at line 23 in command:
    insert into test_table
    (select  'some text House#32' col from dual)
    Error report:
    SQL Error: ORA-02290: check constraint (FDL_DEV.CHK_ADDRESS) violated
    02290. 00000 -  "check constraint (%s.%s) violated"
    *Cause:    The values being inserted do not satisfy the named check
    *Action:   do not insert values that violate the constraint.
    insert into test_table
    (select  'some text
    (with new line)' col from dual);
    Error starting at line 26 in command:
    insert into test_table
    (select  'some text
    (with new line)' col from dual)
    Error report:
    SQL Error: ORA-02290: check constraint (FDL_DEV.CHK_ADDRESS) violated
    02290. 00000 -  "check constraint (%s.%s) violated"
    *Cause:    The values being inserted do not satisfy the named check

  • How to Avoid Special Characters in string

    Hai.
    I want only Alphabets & Digits to be entered in to my string.No any other special characters except spaces.How can I do this? 
    Solved!
    Go to Solution.

    MikeS81 wrote:
    see the attached example.
    I would allow a few more, e.g. 0 and 8 to allow editing of the entered string (backspace, cursor buttons, delete key, etc.).
    Message Edited by altenbach on 11-21-2008 12:49 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    check_char_LV80MOD.vi ‏14 KB
    FilterStringInput.gif ‏6 KB

  • How to replace special characters in string.

    Hello,
    I want to replace special characters such as , or ; with any other character or " ".I find out there is no such function is java for this.There is only replace() but it accepts only chars.If anybody know how to do this?.
    Thanks,

    Hello,
    I want to replace special characters such as , or ;
    with any other character or " ".I find out there is no
    such function is java for this.There is only replace()
    but it accepts only chars.If anybody know how to do
    this?.
    Thanks,Can't you just do the following?
    public class Test
         public static void main(String[] args)
         String testString = "Hi, there?";
         System.out.println(testString.replace(',',' '));
    }

  • How to extract special characters from a field

    Hi there.
    I am a novice when it comes to Web Intelligence reports. I have been tasked with producing a final report that I can export to Excel which shows a project number and a project name. Very simple. Ultimately I need to import my final Excel file to a third party software. However, the issue is the project name field consists of special characters such as hyphens, parenthesis, asterisks, etc. I need to be able to create a formula which extracts all special characters and just leaves me with alpha-numeric characters and spaces. I also need to limit the character count to no more than 34 characters. I will not be able to import my final Excel file unless I can product those results. With the help of a very knowledgable person in the Crystal Reports forum, I was able to do that by using the following formula:
    stringvar a:=left({Projects.ProjectName},34);
    numbervar i;
    Local StringVar fin;
    for i:= 1 to len(a) do
        if a[i]in ["a" to "z"] then
            fin := fin & a[i]
        else if a[i] in ["1" to "9"] then
            fin := fin & a[i]
    else if a[i] = " " then
         fin := fin & a[i];
    fin;
    It worked amazingly well in Crystal Reports but this report now needs to move to Web Intelligence. Is there a way to do this in a Web Intelligence report? Itried but the formula is not recogizable. I tried creating a variable and using this formual but I couldn't get it to work.  I appreciate all helpful responses. The version of Web Intelligence I am using is SAP Business Enterprise XI. I am working in a PC environment using Windows 7 if that helps at all.
    Thank you!
    Lauren

    Hi Lauren, Please provide with some sample data...
    In SQL, by writing some Functions/Procedures you can eliminate special characters. Ask your database team to do that.
    or
    Create an object with the following syntax... It Works in SQL.
    = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE
    (REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE
    (REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE
    (REPLACE(REPLACE(REPLACE([String_Object],'&',' '),'*',' '),'(',' '),'^',' '),'%',' '),'!',' '),'@',' '),'#',' '),'$',' '),'~',' '),')',' '),'+',' '),'=',' ' ),'-',' '),'_',' '),'/',' '),':',' '),';',' '),',',' '),'<',' '),'.',' '),'>',' '),'?',' '),'"',' '),'''',' '),'[',' '),']',' '),'{',' '),'}',' '),'\',' '),'|',' ')
    Example: Input: '~!@#$%^&*()_+{}:"<>-=[]./\|/*-+ascdfv123'
                  Output: ascdfv123

  • Can't show special characters (ÆØÅ) in pdf fields created with inDesign CS6

    Hi Guys im having a problem with special characters in pdf's form fields created in inDesign CS6
    instead of the character ÆØÅ it creates squares or some other seemingly random character
    Here's the pdf

    I figured it out
    Just in case people had the same problem here is how it's done: (i misunderstood the two posters above me, so you are actually going to change fonts within acrobat, like they said, and save it)
    Open the pdf in acrobat, go and change font settings for each of your fields and change the font under the "Appearance" tab.

  • Special Characters in a Field name

    I am having trouble with creating a SQL statement for a field name that has special characters. I get SQL errors when I run the code below:
                   ResultSet rec = st.executeQuery(
                        "SELECT * " +
                        "FROM F55EXL1 " +
                        "WHERE " +
                        "(SK$#TY = 'UPC' AND " +
                        "SK$#MS = '7107-42' AND " +
                        "SK$#F1 = 'J468-4' AND " +
                        "SK$#F2 = 'JX67-4')");
                   while (rec.next()) {
                        upcCode = (rec.getString(3));
                   }What can I do to make it accept these field names?

    Hi
    Can you try this..
    ResultSet rec = st.executeQuery(
                        "SELECT * " +
                        "FROM F55EXL1 " +
                        "WHERE " +
                        "SK$#TY = \'UPC\' AND " +
                        "SK$#MS = \'7107-42\' AND " +
                        "SK$#F1 = \'J468-4\' AND " +
                        "SK$#F2 = \'JX67-4\' ");
                   while (rec.next()) {
                        upcCode = rec.getString(3);
                   }Thanks
    Srinivas

  • Mac file name restrictions/special characters

    What are the Mac OS file name restrictions? What are the special characters to avoid?
    Is this a legitimate file name? Are the colons allowed?
    /Users/Joe/Desktop/MyDocument 3:2:06.xls
      Windows XP Pro  

    Thanks, Sagesse. I'm new to the Mac OS. Is it tied to Unix in such a way that the colons are allowed?
    A user tried to provide a file with a name similar to that in my original post (e.g. "name 3:4:07.rtf") using a web form, and I'm at a loss as to how they could have saved it with the colons. Thank you for your assistance.

  • OID/Portal - Restrict Special Characters to be used in Password

    Hi,
    Does anyone know how I can restrict the use of special characters ($, &, £...etc) in the OID password? I cannot see an attribute to achive this? orclpwdIllegalValues will stop certain words, but I just want to restrict the use of any of the special characters in any password. All suggestions or information would be much appreciated.
    Thanks

    Requires custom plugin (using PL/SQL) to add password value checking to OID password policy management capabilities. A description and example code for this is available in chapter 27 of the Oracle® Internet Directory Administrator's Guide, 10g Release 2 (10.1.2) entitled "Oracle Internet Directory Plug-In for Password Policies" available at http://download.oracle.com/docs/cd/B14099_19/idmanage.1012/b14082/plugin_pwdpolicies.htm#i122359

  • Convert HTML special characters to String

    Hi,
    I'm looking for an easy way to convert HTML special characters (like "&#246") to String.
    Any Ideas how implement this? Thanks

    Hi,
    I'm looking for an easy way to convert HTML special
    characters (like "�") to String.
    Any Ideas how implement this? Thankswell im assuming that you mean that when you are working with java you will be getting a ? instead of the character you want. assuming that you are reading and writing to this html file. if not well maybe this can stil help : BufferedReader inFile = new BufferedReader(new InputStreamReader(new FileInputStream(fileName),"ISO8859-1"));
    PrintWriter outFile = new PrintWriter(new OutputStreamWriter(new FileOutputStream(fileName2), "ISO8859-1")); basically you need to make sure that ou define ISO8859-1 as the encoding.

  • Removing last 2 characters from string field

    I am trying to remove the last 2 characters of a string field.
    there is no consistant length in the field
    316R1
    12364R1
    i want to remove everything after R
    i tried instrrev but i that didnt do it.
    is there a way to say
    start position1 and go the R
    thanks

    formula,
    left (field, length_formula) is the solution
    the length_formula is the number of chars form left
    f.i
    left(field, length (field)-2)
    left (field, InstrRev, field,"R")
    of course a combination with Right is also possible

  • Remove special characters in string

    Hi all,
    I'm Portuguese, and in our language we use special characters in words like "João or "Sónia".
    I need to take off these special characters, which means I want to have the same words like "Joao" and "Sonia", without the characters "~" or "´".
    Do you have any idea how can I do this?
    Thanks in advance.
    Best regards,
    Sónia Gonçalves

    Hi,
    But I want to make this generic, I don't want to replace character by character.
    If I give a string in the program, I want to search all ocurrences of these special characters and replace them.
    How can I do this?
    Thanks.
    Best regards,
    Sónia Gonçalves

Maybe you are looking for

  • Simple quote in a wiki page title.

    Is it possible to use a simple quote in the title of a page ? I tried to move The_Arch_Way_(Français) to L'Esprit_d'Arch_(Français). It redirects me well if I click on http://wiki.archlinux.org/index.php/The_Arch_Way_(Français) but not if I enter htt

  • My macbook pro (using lion os) can't search files and folders on external hard drive! How can i solve it?

    When i used Snow leopard, i can search every files and folders on my external hard drive (NTFS). But when i upgraded to lion OS, sportlight didn't index files on exteranal hard drive and i can't search everything on external hard drive whatever i typ

  • How to create a new object of HttpServletRequest class manually?

    Dear all, I don't know how silly my question is, however I have no way except asking. I know that when I send a request from the client to the server, server authomatically creates an object of HttpServletRequest and assigns all the request informati

  • Incoming called URI number manipulation in Call manager 10.5

    Dear Experts, can we manipulate the called URI number like we manipulate the digits (e.g Translation pattern) ? can we have manipulate the incoming called number to match a route pattern for eg. the called uri is 955XXXX@CUCM-address route pattern 95

  • Safari dosen't restore the last session

    Hello.I have a problem with Safari on my macbook air 2013.I have the last version of Safari and Mavericks osx.The problem is that I checked the box with "restore all windows from last session" and also "close windows when quoting an app" on system pr