JSTL inside of single quotes

Very strange occurrence here. I'm pretty sure it must be something to do with server set up, but here goes.
I have the following code.
<li><a href="" onClick="javascript:window.location='${pageContext.request.contextPath}/logOut.do';return false;">Logout</a></li></ul>This works just fine on my development environment (RAD 6.0) and in production. I'm going on a long Vacation and I was making sure another developer was able to support it while I'm gone. We got everything to work on his computer except he wasn't able to log out and wasn't able to do a few other things. I was under the impression we had identical environments, and I've check my project into source control and he checked it out, so all the same jars and libraries should exist.
Turns out the problem is anytime there is EL inside a single quote (not counting single quotes inside JSTL tags), it isn't being recognized as EL. The source code is spitting out the ${...}
the places that have el like <td>${data}</td> work just fine.
My only guess would be something with the server settings.. but I don't know of anything that could cause this.
Anyone have any ideas?

well, we narrowed it down to a problem on his local 6.0 server. If he creates an ear file it deploys just fine to our test and QA environment.. so I would image the same would be true for Production. I can live with him not being able to double check that the logout functionality works on the off chance that he has to do any work on the app in the next 11 days.
Just means I need to make sure he is at the top of the list on upgrading to Rad 7.0 and using a 6.1 server instead of 6.0, and I guess need to make sure he has the latest fix packs and such installed.

Similar Messages

  • Jstl inputText takes apostrophe (single quote) as end of string

    Hi,
    I run into a problem with jstl when apostrophe(single quote) is in input text:
    <h:inputText id="input1" styleClass="field" size="20" maxlength="20" value="#{bean.property1}" />
    When user inputs string contains apostrophe (single quote), for example "John's task", the bean only gets "John". The text after the apostrophy is gone. It seems that the inputText takes apostrohe as end of the string.
    I also test with escaple sequence, for example, input is "John\' task", the result in bean is still "John"
    input is "John\\\' task", the result in bean is "John\\".
    It doesn't have problem with other special characters, such as "<".">",""", "@" etc.
    Finally, I fix the problem by replacing apostrohy with "&#039;".
    I just wonder if anyone has similar prolbem and wehether this is some bug in certain version of JSTL or some configuration issue ( for example, some definittion for end of the string in some config file, etc).I'm using JSTL 1.1.1.2.
    Your insight is appreciated.
    Thanks

    This isn't JSTL, it's JSF. There's a separate forum for this: http://forum.java.sun.com/forum.jspa?forumID=427
    I think the escape character for a single quote is the single quote itself. Give that a shot.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • REGEXP_LIKE help with literal single-quote

    I'm trying to write a check constraint to validate email addresses that may include an apostrophe in the email address. Such as joe.o'[email protected] Here is my sample setup:
    create table emails
    ( email_address varchar2(150)
    insert into emails values('[email protected]') ;
    insert into emails values('[email protected]') ;
    insert into emails values('joey.o''[email protected]') ;
    commit;
    sql> select * from emails;
    EMAIL_ADDRESS
    [email protected]
    [email protected]
    joey.o'[email protected]
    alter table emails add constraint email_address_format_ck
        CHECK ( REGEXP_LIKE ( email_address, '^[a-z0-9._%-]\'?+@[a-z0-9._%-]+\.mil$','c'));
    ERROR at line 2:
    ORA-00911: invalid characterIt doesn't like *\'?*
    My understanding is this means one or more single-quotes. Anyone know the correct syntax to accept apostrophes?

    Hi,
    jimmyb wrote:
    ... insert into emails values('joey.o''[email protected]') ;
    That's the correct way (actually, that's one correct way) to include a single-quote in a string literal: use 2 single-quotes in a row.
    ... alter table emails add constraint email_address_format_ck
    CHECK ( REGEXP_LIKE ( email_address, '^[a-z0-9._%-]\'?+@[a-z0-9._%-]+\.mil$','c'));Here, the 2nd argument to REGEXP_LIKE is a string literal, just like 'joey.o''[email protected]' was a string literal.
    To include a single-quote in the middle of this string literal, do the same thing you did before: use 2 of them in a row:
    CHECK ( REGEXP_LIKE ( email_address, '^[a-z0-9._%''-]+@[a-z0-9._%-]+\.mil$','c'));There were a couple of other problems, too.
    I'm sure you meant for the apostrophe to be inside the square brackets. Inside square brackets, \ does not function as an escape character. (Actually, single-quote has no special meaning in regular expressions, so there's no need to escape it anyway.)
    I'm not sure what the '?' mark was doing; I left it out.
    Of course, you'll have trouble adding the CHECK constraint if any existing rows violate it.
    Edited by: Frank Kulash on Feb 10, 2012 6:52 PM

  • Mssql single quote problem!

    Hi,
    I user servlet to update MS SQL2000. My problem is there is a single quote inside a text string!
    I can't use double quote for string, as it is not a valid statement for MSSQL. I need to use single quote, but there is single quote inside the string, how can I handle the string?
    String mstrnig="I'm a boy";
    String mSQL = "UPDATE news SET " + "title='" + mstring + "' WHERE code =" + mcode;
    Thanks

    the cleanest and easiest soln is to use preparedStatement.
    PreparedStatement ps = con.prepareStatement("update table comment=? where id = ?");
    ps.setString(1,"That's way to do it");
    ps.setInt(1,8);//some itn value
    ps.execute();

  • JSF inputText takes apostrophe (single quote) as end of string

    Hi,
    I run into a problem with JSF when apostrophe(single quote) is in input text:
    <h:inputText id="input1" styleClass="field" size="20" maxlength="20" value="#{bean.property1}" />
    When user inputs string contains apostrophe (single quote), for example "John's task", the bean only gets "John". The text after the apostrophy is gone. It seems that the inputText takes apostrohe as end of the string.
    I also test with escaple sequence, for example, input is "John\' task", the result in bean is still "John"
    input is "John\\\' task", the result in bean is "John
    It doesn't have problem with other special characters, such as "<">", "@" , double quote etc.
    Finally, I fix the problem by replacing apostrohy with "& # 0 3 9".
    I just wonder if anyone has similar prolbem and wehether this is some bug in certain version of JSTL or some configuration issue ( for example, some definittion for end of the string in some config file, etc).
    Your insight is appreciated.
    Thanks

    Without the actual code we can't be of any meaning for you. Create a small reprocudeable test case and post the actual code here. For example:
    JSF<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <f:view>
        <html>
            <head>
                <title>test</title>
            </head>
            <body>
                <h:form>
                    <h:inputText value="#{myBean.value}" />
                    <h:commandButton value="submit" action="#{myBean.action}" />
                    <h:outputText value="#{myBean.value}" />
                </h:form>
            </body>
        </html>
    </f:view>MyBeanpackage mypackage;
    public class MyBean {
        private String value;
        public void action() {
            System.out.println(value);
        public String getValue() {
            return value;
        public void setValue(String value) {
            this.value = value;
    }faces-config:<faces-config>
        <managed-bean>
            <managed-bean-name>myBean</managed-bean-name>
            <managed-bean-class>mypackage.MyBean</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
    </faces-config>Which works fine by the way.

  • How do I pass single quotes into a string variable?

    Thanks for any help?
    Example
    Select xdat, yday
    from foo
    where
    xdat = to_char(sysdate, 'mm/dd/yyyy')
    How do I pass the single quoted stuff above into a string variable?

    Thank you but that is not the same thing. I am building a dynamic sql statement and need to pass the quoted material into a statement that is quoted Is that not what my example above shows?
    My example above has a quoted string inside a string. I think this is exactly what you were asking for.

  • Date without single quotes in SQL Where clause turns to 00000000. Why?

    The below program works in 4.6c but does not in ECC 6.0, the issue is the date actually turns to 00000000, debug shows the internal table as having the correct value that was inserted but st05 trace shows that the variable is holding the value 00000000, this works fine when the date is put inside single quotes but the actual program where I have this issue does not warrant adding single quotes. Has someone come across this situation. Any help is appreciated!
    data v_vbeln like vbak-vbeln.
    data: begin of where_tab occurs 0,
          s_date(20) type c,
          end of where_tab.
    where_tab-s_date = 'audat = 19971106'.
    append where_tab.
    select vbeln into v_vbeln from vbak where (where_tab).
      write:/ v_vbeln.
    endselect.

    HI,
    data v_vbeln like vbak-vbeln.
    ******data: begin of where_tab occurs 0,
    ******s_date(20) type c,
    ******end of where_tab.
    ******where_tab-s_date = 'audat = 19971106'.
    ******append where_tab.
    ***** The above statements are not needed for the select query.
    ******select vbeln into v_vbeln from vbak where (where_tab).
    Your select query can be re-written as
    select vbeln into v_vbeln from vbak where audat eq '19971106'.
    write:/ v_vbeln.
    endselect.
    and if your requirement is to check for multiple dates then,
    append them to a select-options and rewrite the select query as
    select vbeln into v_vbeln from vbak where audat IN S_DATE. " S_DATE is your select-options
    Regards
    Sharath

  • Using single quotes

    Hi ,
    I have to write this in case statement .
    1.case when studentname in ('xyz'a') then 'pass' end
    Kindly please help me . i want to know how i can give tat single quotes inside the formaula since when i am giving tat it completes a word
    Kind Regards
    Sudarshan

    Hi,
    Rephrase the case statement as ,
    case when studentname in ('xyz''a') then 'pass' end
    (ie) replace the single quote with two single quotes, *'* to *''*
    Rgds,
    Dpka

  • Bug? Copy/Paste single quote from MS Word

    I am not sure if this is a bug or not. Whenever I copy a text from MS Word that has single quotes in it (for example, This is just a 'test') and put it inside an af:inputText field, save the value in a Java bean then retrieve it for editing, the single quotes become an inverted question mark (i.e. This is just a ¿test¿) This is only happening whenever I copy the text from MS Word. Copying from Notepad or Wordpad as well as manually inputting the text do not produce the said bug.
    Does anyone have an idea regarding this issue?
    Thank you.
    -rolly

    .... and no, I don'think this is a bug because you are facing a character conversion, which e.g. also happens when copy and pasting from Word to Powerpoint
    Frank

  • Text within single quotes

    Hello Everybody,
    I have a requirement wherein i need to take out text which exists within single quotes.
    For eg:
    string1 = Hi ' I am within single quotes' .
    here i need to take the text which is inside single quotes aside.
    Kindly provide me a solution.
    Thanks and Regards
    Manish

    Use SPLIT.
    TYPES: BEGIN OF ITAB_TYPE,
            WORD(20),
          END   OF ITAB_TYPE.
    DATA: ITAB TYPE STANDARD TABLE OF ITAB_TYPE WITH
                    NON-UNIQUE DEFAULT KEY INITIAL SIZE 5.
    SPLIT 'Hi '' I am within single quotes''' AT '''' INTO TABLE ITAB.
    So you will have the entire string in the second record of the table.
    Note that working with single quotes in ABAP makes you use twice single quotes, in order to avoid ending the string.
    Message was edited by:
            Angel Garcia

  • WLS 9.2: JSP error when attribute enclosed in double vs single quote

    Hi all,
              We are trying to deploy a WAR file on WLS 9.2 on a Unix box. This app uses Struts, and does not use any app-server specific extensions/tags etc. We run into JSP compilations errors when we try to deploy as well as when we run weblogic.appc on the WAR. The errors are generally the same type..."This attribute is not recognized" for multiple Tags that are used...not just Struts tags, but even plain vanilla <jsp:include tags...liks so:
              LookupPO.jsp:102:72: This attribute is not recognized.
              <jsp:include flush="true" page="
              <%=(String)request.getAttribute("selectTile")%>"/>
              ^--------^
              However, if we just change the same tag to use single quotes for attribute values, like so:
              <jsp:include flush="true" page='
              <%=(String)request.getAttribute("selectTile")%>'/>
              then it works fine.
              What throws me off is that these tags in the same double-quoted format work well on other servers such as Sun Java System.
              Changing the double to single quotes for every single tag in our applications 600-odd JSPs will be a huge burden...is there any other way?
              Any help is sincerely appreciated.
              Thanks,
              Vik.
              Edited by vshevde at 03/26/2008 9:09 AM

    quote:
    Originally posted by:
    joeG
    Ok I see what you mean, actually the insert in that fashion
    with MySQL still puts the data in normalized, its just in one
    statement. From the docs:
    INSERT statements that use VALUES syntax can insert multiple
    rows. To do this, include multiple lists of column values, each
    enclosed within parentheses and separated by commas. Example:
    INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
    thanks for the response.
    Oh, that's what you meant. See what happens when you get old,
    you go blind.
    I have two suggestions. First, keep trying with cfqueryparam.
    I don't use it that often myself because the db I work with doesn't
    support it, but, I think it has a list attribute.
    Second, what you are attempting, a loop within a query, is
    intuitively more efficient than putting your query inside a loop.
    This is something I have tested and what I found is that the most
    efficient approach depends on the db. I did not test MySQL, but I
    suggest you do. The gettickcount() function is handy for these
    sorts of tests.

  • Escaping single quotes in SQL Statement

    I am getting SQL Statement error when i tried to have a value with a single quote in it ,inside my SQL Statement.
    e.g.
    INSERT INTO tblHoldings(Title) VALUES ('Developing Asia�s fibre processing through collaboration');
    here the Title to be inserted in the table tblHoldings is "Developing Asia�s fibre processing through collaboration"
    i used to trapped the single quote by using its escape character ( \ ) with this method and its fine with MySQL 4 but when I upgraded to MySQL 5.0.22, I now getting the SQL Statement error again.
    public String cleanse(String dirty) {
          String clean = dirty.replaceAll("\'", "\\\\'");         
          return clean;
      }    please help me..how can i trapped/escape single quote in MySQL 5 in Java?
    Thanks in advance for your help.

    No. Please use PreparedStatements. That is theonly
    correct answer to this question.Ok please tell us. how would you use prepare
    statement.. no just say USE PREPARE STATE.. givethe
    guy the code... or help..What size spoon would you like to be fed with? There
    was nothing about gob size in the original post.
    http://www.javaalmanac.com
    well duffymo.. i think you gave a link, is quite of help, but my friend preparestatement just gave "use preparestatement"..
    i think even you when you start coding you needed help... and some one just tell you use preparestatement how do you feel..
    There is a level of help. i think it will be (((as much as you can)))

  • Problem with single quote when exporting insert statement

    Hi
    I'm using Oracle SQL Developer 2.1.1.64 on Ubuntu 10.04. I got some records which has single quote in it.
    For example,
    Let says Table '*TABLE_A*' has varchar2 column called '*COL_A*'.
    And there is only one record in the table and the value is:
    his friend's dog name is dog.
    When I export that table data to insert statement, i got this:
    Insert into TABLE_A (COL_A) VALUES ('his friend's dog name is dog.');
    As you can see friend's is wrong, it should be friend''s instead. (note the double single quotes).
    Anyone knows how to fix this please?

    Yes - that's a bug. But probably not what you're expecting.
    Mind you really can't use "normal" SQL on LOBs, because they're just too big to fit in the statements.
    You should export and import them through e.g. the DBMS_LOB package.
    I do remember some request on the SQL Developer Exchange to automate this, so go vote there to add weight for future implementation.
    So the bug is that the column's fields should all yield NULL inside the INSERTs.
    Regards,
    K.

  • Single Quote problem with javascript

    Hello;
    I have a custom popup search page that work very well most times. if the data that I am passing back to me calling page has a single quote in it the popup page fails. Take a look at this URL that is called and you van see why the single quote is causing the problem.
    javascript:passBackSearch('413','TOM'S GRILL')

    To make it more clear, it should be
    javascript:passBackSearch('413',"TOM'S GRILL") Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

  • Stripping out single quotes

    I pull names of businesses from a query and some of them have
    single quotes in the name. I do a cfoutput query and embed those
    results inside a google map. For some reason the businesses that
    have the quotes will not display so I need to strip them out.
    What's the best way to do this?

    cf also has JSStringFormat() function that will escape quotes
    in a text
    string, making it js-safe...
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

Maybe you are looking for