Convert HTML ASCII codes with JSTL and Apache Taglibs?

I am building a web application using JSTL and some of the Apache Taglibs, so these are the taglibs I have at my disposal currently. What I am looking for is the ability to handle the &#039; that appears in submitted search strings which contain the ' character. SQL seems to be able to handle other special characters (such as &, [, ", etc) but I can't get it to get along with the &#039;.  I have tried using a <string:replace replace="&#039;" with="\&#039;"> to escape the &#039;, but this doesn't seem to work either.  Any suggestions?  Let me know if you need more information to be able to fully understand the situation.
--Ioeth                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

By the way, the search string that a user enters is getting Tokenized using " " as the token and then fed directly into multiple SQL LIKE comparisons based on how many tokens were found.

Similar Messages

  • Converting html file into zip file and send email attaching zip file

    Hi Experts,
    I am trying to send email with attachment(html). Which contains more than 7MB. So, It is throwing an error like Size exceeded.
    So, Now i need to compress the data for less than 7MB.
    I decided to convert HTML File into ZIP File.
    Kindly suggest me to convert the HTML file into ZIP file and sending email with attached ZIP file.
    Correct answer rewarded,
    Thanks & Regards,
    N. HARISH KUMAR

    Hi Experts,
    *// HTML_TAB converting into ZIP File
       DATA  : zip_tool TYPE REF TO cl_abap_zip,
               filename TYPE string ,
               filename_zip TYPE string .
       DATA  : t_data_tab TYPE TABLE OF x255,
               bin_size TYPE i,
               buffer_x TYPE xstring,
               buffer_zip TYPE xstring.
    filename = text-007.                                                                          "'HTML_TAB
    *describe the attachment
       DESCRIBE TABLE html_tab LINES tab_lines.
       bin_size = tab_lines * 255.
       CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
         EXPORTING
           input_length = bin_size
         IMPORTING
           buffer       = buffer_x
         TABLES
           binary_tab   = html_tab.
       IF sy-subrc <> 0.
    *     message id sy-msgid type sy-msgty number sy-msgno
    *     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    *create zip tool
       CREATE OBJECT zip_tool.
    *add binary file
       CALL METHOD zip_tool->add
         EXPORTING
           name    = 'FSSAI_MAIL.HTML'
           content = buffer_x.
    *get binary ZIP file
       CALL METHOD zip_tool->save
         RECEIVING
           zip = buffer_zip.
       CLEAR: t_data_tab[],bin_size.
       CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
         EXPORTING
           buffer        = buffer_zip
         IMPORTING
           output_length = bin_size
         TABLES
           binary_tab    = html_tab.
    Thanks & Regards,
    N. HARISH KUMAR

  • Simple setup problems with JSTL and Tomcat

    Hi all, I'm having some problems getting JSTL to work the 1st time. JSTL setup seems to be a common problem for relative newbies, but having read previous threads, I still haven't been able to solve my problem so hopefully someone can help:
    the jstl.jar and standard.jar are in my WEB-INF/lib directory, so I don't think it's a classpath problem.
    My jsp page has the following at the top:
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>Later, I reference a bean var with :
    <c:out value="My var is : ${var.property}"/>In my web.xml I have:
      <taglib>
       <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
       <taglib-location>/WEB-INF/lib/jstl.jar</taglib-location>
      </taglib>And I've placed the actual tld (c.tld) in the WEB-INF directory.
    On startup I get the error when compiling the JSP:
    No such tag out in the tag library imported with prefix c
    Can anyone help here?
    Thanks in advance,
    Mike

    I think this note from the JSTL mailing list by Shawn Bayern, one of the lead developers of Jakarta JSTL and the author of "JSTL In Action", will clarify it:
    http://www.mail-archive.com/[email protected]/msg04587.html
    Don't put that <taglib> in your web.xml. All the books tell you to do it, but Shawn Bayern has the right answer. The URI should be the one that's in the TLD JAR .tld files.
    I use JSTL and Tomcat 4.1.24 without the <taglib>, and it works fine. - MOD

  • Convertion to ASCII code

    Hi everybody,
    I have string:s, I convert it to an integer in base 16:
    int a = 0;
    a = Integer.parseInt(s, 16);
    How can I convert the integer: a to it's equvalence ASCII code?
    Any help is greatly appreciated.

    I think we'lll try that again;-
    char c = (char)a;Without other info, and based solely on 'ascii' the following is probably better...
          if (a > 127)
              throw new Exception("Can not map value(" + a + ") to ascii");
          char c = (char)a;

  • Easy accent (special character) translation to html numeric codes with xdk.

    Hi, I have an xml (obtained via xsql) with the correct special characters (spanish accents in this case), I got it in a servlet like:
                                            XSQLRequest req = new XSQLRequest(pageUrl);
    XMLDocument xsqlDoc = (XMLDocument)req.processToXML(params);
    XSLProcessor processor = new XSLProcessor();
    processor.setBaseURL(xslUrl);
    XSLStylesheet sheet = processor.newXSLStylesheet(xslUrl);
    processor.processXSL(sheet, xsqlDoc, out);
    This works fine, I got a pretty xml document like:
    <BLOQUE_B>
    <ROW num="1">
    <TITULO>Trabajos Topográficos Catastrales.</TITULO>
    <TITULO_RESTO>PolÃgono núm. 6</TITULO_RESTO>
    <RESPONSABILIDAD>Servicio de Catastro Topográfico Parcelario;</RESPONSABILIDAD>
    <ESCALA>Escala 1:5000</ESCALA>
    <FRASE_INTRODUC>Versión original</FRASE_INTRODUC>
    <DESCRIPCION_FISICA>1 plano</DESCRIPCION_FISICA>
    </ROW>
    </BLOQUE_B>
    The problem comes with the special characters (accents), I need to output as html codes:
    á --> &amp;#225;
    é --> &amp;#233;
    etc ...
    I've try with xdk 10 (xls v2), using the new character-map funcion, but it didn't work. (applying version="2.0" in the stylesheet and processor.setXSLTVersion(oracle.xml.parser.v2.XSLProcessor.XSLT20)
    in the servlet), (example in xml.com: http://www.xml.com/pub/a/2004/06/02/tr-xml.html)
    With xdk 9 (xls v1), I try with a string-replace template function (like the http://www.dpawson.co.uk/xsl/sect2/StringReplace.html), and it seens to work.
    It's there an easy way to make this?
    Why didn't work the character-map with xdk10 (xls v2))
    Thanks in advance
    Felipe Llano

    I found a solution, without using xsl, just with the jtidy library, as I need the translation via servlet, I did it with just a few lines like:
    PrintWriter out = response.getWriter();
    XSQLRequest req = new XSQLRequest(pageUrl);
    XMLDocument xsqlDoc = (XMLDocument)req.processToXML(params);
    ByteArrayOutputStream out2 = new ByteArrayOutputStream();
    ByteArrayOutputStream out3 = new ByteArrayOutputStream();
    xsqlDoc.print(out2);
    Tidy tidy = new Tidy();               
    tidy.setXmlTags(true);
    tidy.setXmlOut(true);
    tidy.parse(new ByteArrayInputStream(out2.toByteArray()), out3);
    out.print(out3.toString() );

  • DIVX Converter/Codec not working with FCP and OS 10.7?

    For years, I've used the DIVX Converter/Codec to output video files from Final Cut Pro 7.0.3 via the Export/Use Quicktime Conversion/Divx as a .divx file. But today, after I upgraded my OS from 10.6 to 10.7 and installed the latest version of DIVX Pro, the normal output functions pop the screen showing that the output processing has started, but it then hangs with "0%" showing in that screen. Is DIVX no longer compatible with FCP in 10.7? Or, is there some additional setting change needed somewhere to make it work as usual. Oddly, DIVX has no email contact information on its site's "Support" section and nothing in their forums appears to address this. Any suggestions or info appreciated.

    You ask this question at FCP forum this is FCP X forum https://discussions.apple.com/community/professional_applications/final_cut_stud io

  • Is there a way to convert a Word document with Red and Black into Spot colors in Acrobat X?

    Customer sent us PDF files created in MS Word. Of course, Word creates CMYK versions of colors. I need the red text and black text converted into spot colors for 2 color output on press. Is there a way to do this? I saw another thread that said there is a Fixup in the Print Production/Preflight section of Acrobat X that has a convert to Spot, but I'm not seeing that. All I see is Convert to CMYK. I'm using Acrobat X 10.1.13 on OS X. Any help would be appreciated. He also sent the Word docs so I can drop that into InDesign and reformat the whole thing and fix the colors myself but if I can do it in Acrobat, that would be a lot quicker. Thanks!

    Frequently in this scenario the red will be 100% of either magenta or yellow with 0% black. In these cases you can merely plate the Black & Magenta (or yellow) for press.
    I've created a Preflight Fixup on occasion for these also.
    An example shown - Note it requires the document is cmyk. MS Files will be rgb. You could create a Preflight looking for rgb colors.
    With Fixup tab selected - Options > Create New Fixup > Type of Fixup - search for Spot in the field

  • How do i convert a double array (with spaces and tabs) to a string?

    Hi
    In our files, we have a mixture of spaces and tabs as a delimeter. How do I convert a double array into a string?
    Thank you.

    Not sure about the last part of your question.
    The Search and Replace pattern can be better than the simple Search and Replace string when you have to do complex searchs, such as detecting multiple spaces.
    Have a look at the attachment.
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    ReplaceSpaces.vi ‏27 KB

  • How to implement OData based BASIC Authentication using HTML, JavaScript for Mobile Apps using Apache Cordova/PhoneGap and datajs-1.1.1.js library

    Hello,
    I have an issue with OData based BASIC authentication for iOS App created using HTML, JavaScript, SAP UI5, OData and Apache Cordova/PhoneGap.
    Please check the post here http://scn.sap.com/thread/3527245
    Request you to kindly reply on the above given link.
    Thanks and Regards,
    Suraj Kumar

    Hello Prathik,
    The code which I am using for OData based BASIC Authentication, for my Mobile App is as below.
       var onSuccess = function(data) {
       alert("We are Through"); //Just to check that the OData request was sucessful
       var onError = function(err) {
       switch(err.response.statusCode) {  
       case 403 : {
       window.alert("Error Code - 403, Service unreachable ");
       break;
       case 401 : {
       window.alert("The credentials are incorrect or missing!");
       break;  
    // dataUserName and dataPassword are the two variables, in which I am storing my Username and Password, respectively.
       var connectionRequest = {
       requestUri: "ODATA SERVICE URL GOES HERE/",
       headers: { Authorization : 'Basic ' + Base64.encode(dataUsername + ":" + dataPassword) },
       method: "POST"
       OData.request( connectionRequest, onSuccess, onError);

  • How to convert ascii codes into Strings

    Is it possible to convert integers (ascii codes) into Strings. It cannot be done by casting like:
    int temp = (String)(111)
    Please help me out. I think there is a method for this.

    Something as simple as String.valueOf((char) 111) comes to mind...

  • Replace % with jstl tags

    Hi
    i am trying to convert the following code to jstl
    <OPTION <% if (rpt.equals("none"))   { %> selected <% } %> value="none" id="none">       </OPTION>i am doing something like this with jstl but it isnt correct
    <OPTION value="none" id="none"
    <c:if test="${pageScope.rpt_local == 'none'}">
         selected >//gives error here sayin option tag not closed
    </c:if>how would i do this in jstl?
    null
    Message was edited by:
    bhaarat_java

    1) The URI you are using suggests that you
    removed/copied the tlds into the WEB-INF directory,
    and that your web.xml uses them. You should not do
    this. The tlds are in the JSTL jar files. By
    maintaining the proper URI, the one defined in the
    JAR, you will be sure to be using the proper version
    of the TLD and tag library.Thanks, I must have missed this important bit while scanning the docs. It's probably an old feature I've never investigated - so much to read and do :-)
    >
    2) Outputting the ${scope} string instead of a
    representation of the scope object suggests that EL
    is not being interpreted. This may be because you
    are using an old version of the web descriptor
    (web.xml) xmlns, or because you are using a non RT-EL
    version of JSTL.Yep, after I fixed my web.xml things started working.
    regards,
    Keith S.

  • Unable to print ASCII codes

    Hello,
    I am facing a problem in printing ASCII code between 128 and 159. these codes are displayed as '?'. All the other codes are printed correctly. Please let me know the reason behind this.
    Given below is the code for the same
    class Codes
         public static void main(String args[])
              short i = 165;
              for (i=0; i<=256;i+=5)
                   System.out.println(i+" "+(byte)i+" "+(i+1)+" "+(byte)(i+1)+" "+(i+2)+" "+(byte)(i+2)+" "+(i+3)+" "+(byte)(i+3)+" "+(i+4)+" "+(byte)(i+4));
    Waiting for a quick reply
    rgds,
    Sameer

    1. What are the chars you are talking about? As already mentioned, they are control chars in unicode. What character encoding would you like to use, or in other words, what characters would you like to have for those bytes?
    2. The character encoding of the dos console (Cp850 on the windozes I've used) is different from the system's default encoding (Cp1252, IIRC). This will cause problems if you want to print out text having non-ascii characters. For example System.out.println("&Aring;&Auml;&Ouml;") should print out the last three letters of the finnish alphabet but it prints something else instead. But if you write the text to a file it comes out as it should.
    Another character encoding can be used by wrapping an OutputStreamWriter around System.out:
    OutputStreamWriter osw = new OutputStreamWriter(System.out, "Cp850");
    PrintWriter out = new PrintWriter(osw, true);
    out.println("&Aring;&Auml;&Ouml;");
    Similarly, the input read through the standard inputstream in dos (the keyboard input or redirection using "<") is in another encoding and needs to be converted.

  • Images with width and height

    There is a way to insert an image inside of the html code
    with width and height already? I mean, now, if I want to insert an
    image at the code, goes only <img src="images/test.gif" /> I
    d like that if I insert an image it goes as: <img
    src="images/canto_topo.gif" width="8" height="29" />
    is possible in dreamwaver to do that?
    Thanks!
    Vismona

    If you insert the image using the "Insert Image" function, DW
    will
    automatically insert the width and height.
    Or, if you'd rather insert them the way you are, in the
    Property Inspector
    on the far left, click the dimensions next to the Image
    field, and DW will
    automatically add (or correct) the width and height.
    Hope that helps,
    Patty Ayers | www.WebDevBiz.com
    Free Articles on the Business of Web Development
    Web Design Contract, Estimate Request Form, Estimate
    Worksheet
    "Vismona" <[email protected]> wrote in
    message
    news:gc60ut$nmv$[email protected]..
    > There is a way to insert an image inside of the html
    code with width and
    > height
    > already? I mean, now, if I want to insert an image at
    the code, goes only
    > <img
    > src="images/test.gif" /> I d like that if I insert an
    image it goes as:
    > <img
    > src="images/canto_topo.gif" width="8" height="29" />
    >
    > is possible in dreamwaver to do that?
    >
    > Thanks!
    > Vismona
    >

  • Ascii Codes

    Is there a function that can convert an ascii code to the proper character?
    ie: in excel, one can use code() and char() to go back and forth.
    Found some ref to \u0041 = A, but not sure if this is the right method?
    Any assistance greatly appreciated.

    Hi,
    CODE("A") could be written in JavaScript as "A".charCodeAt(0), where the argument to charCodeAt is the position in the string so "AB".charCodeAt(1) would give you the code of B
    and
    CHAR(65) could be written in JavaScript as String.fromCharCode(65).  The method fromCharCode can take a list so String.fromCharCode(65,66,67) will return "ABC".
    Bruce

  • Having trouble with rounding and if/else

    I am trying to write a program that reads 2 floating-point numbers and test if they're the same when rounded to 2 decimal places and whether they diff by less than 0.01. I'm having trouble compiling it, with errors such as
    "C:\Documents and Settings\John\My Documents\Test2.java:24: 'else' without 'if' else"
    C:\Documents and Settings\John\My Documents\Test2.java:18: cannot find symbol
    symbol  : method round(double,int)
    location: class java.lang.Math
         double round1 = Math.round(firstinput,2);
                             ^
    C:\Documents and Settings\John\My Documents\Test2.java:19: cannot find symbol
    symbol  : method round(double,int)
    location: class java.lang.Math
         double round2 = Math.round(secondinput,2);Here is the code:
    import java.util.Scanner;
    import java.text.NumberFormat;
    import java.math.*;
    import java.lang.Math;
    public class Test2
         public static void main( String args[] )
         Scanner sc = new Scanner( System.in);
         System.out.println("Enter your first floating-point number: ");
         double firstinput = sc.nextDouble();
         System.out.println("Enter your second floating-point number: ");
         double secondinput = sc.nextDouble();
         double round1 = Math.round(firstinput,2);
         double round2 = Math.round(secondinput,2);
         double total = round1 - round2;
        if(round1 == round2);
        System.out.print("They are the same when rounded to two decimal places. \n");
        else
        System.out.print("They are not the same when rounded to two decimal places. \n");
         if(total<1.01 && total>0.99)
         System.out.print("They differ by less than 0.01. \n");
         else
         System.out.print("They do not differ by less than 0.01. \n");
    }

    Are you restricted to Math.round()? Try reading about DecimalFormat:
    http://java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html
    Your code with DecimalFormat:
    import java.text.DecimalFormat;
    import java.util.Scanner;
    public class Test2 {
        public static void main(String[] args) {
            DecimalFormat df = new DecimalFormat("#.##");
            Scanner sc = new Scanner( System.in);
            System.out.println("Enter your first floating-point number: ");
            double firstinput = sc.nextDouble();
            System.out.println("Enter your second floating-point number: ");
            double secondinput = sc.nextDouble();
            double round1 = Double.parseDouble(df.format(firstinput));
            double round2 = Double.parseDouble(df.format(secondinput));
            double total = round1 - round2;
            if(round1 == round2)
                System.out.print("They are the same when rounded to two decimal places. \n");
            else {
                System.out.print("They are not the same when rounded to two decimal places. \n");
                if(total<1.01 && total>0.99) //<== Rather redundant, why not just use total == 1
                    System.out.print("They differ by less than 0.01. \n"); //<== From the above if statement, it seems if you are looking to see if the 2 numbers differ by less than 1.00, and not 0.01. The same goes for the else statement below
                else
                    System.out.print("They do not differ by less than 0.01. \n");
    }Also, when I ran your program with the latter code and entered two same floating point numbers, it also printed out "They do not differ by less than 0.01." I've added curly brackets around the outer else statement to ensure that it does not happen. It's best to use curly brackets in structured statements if their function exceeds more than one line; for stability and legibility.
    Also, read my comments.

Maybe you are looking for

  • Is it possible to transfer song ratings from an ipod to a computer's itunes

    Is this possible? I rate my songs when I'm listening to them and tend to listen to songs through my ipod rather than through itunes and was wondering if I can transfer the ratings from my ipod to my computer. Perhaps I'm missing somthing, but its rea

  • Device Error-The Target Device Isn't Suitable For Use

    I read this in another forum after I experience this problem. Hope it helps some of you. I encountered the problem when I was exporting my finished movie. I had added a few effects like transitions and menu makers as well as stop markers to my timeli

  • Changing folder order in project

    This may be a dumb question, but is there a way to rearrange the order that the folders show up in a project tree?  It seems by default CVI has them in the order of "User Interface Files", "Source Files", "Include Files", which is fine.  However, I h

  • How do I obtain product recovery media for my Satelite Pro A100?

    When I purchased my A100, I was not given any product recovery media. I assumed that it would be pre - installed on a partition on my hard drive. Seems not to be the case. I wish to resize my primary partition to enable me to install linux on the spa

  • Problem while downloading sform..

    HI all, I am converting smartform to pdf format. but i get the error 0 bytes transported, code page 0000. can anyone help me plz