Character coersion

I have an interesting problem, using JSTL 1.1.2. I have a bean method which provides a Map of Character objects, like this:
private Map myMap;
...snip...
   Character myChar = new Character('X');
   myMap.put("hello",myChar);
...snip...
public Map getMap() {
   return myMap;
}Now, I can display any part of the map simply in JSTL:
<p>Value is : ${somebean.map['hello']}</p>which works just fine and displays the Character value of X correctly.
HOWEVER... when I try and compare the character to a constant value...:
<c:if test="${somebean.map['hello'] == 'X'}"><p>Something.</p></c:if>...then I get a runtime exception:
javax.servlet.jsp.el.ELException: An exception occured trying to convert String "X" to type "java.lang.Long"Why is it trying to convert the constant value 'X' to a Long? What can I do to make it convert it to a Character instead so that it does the comparison properly?
I have tried using eq instead of == but this makes no difference.

I cannot change the underlying map class. It is being used to represent a record in a table in an Oracle database - Characters represent char columns, Strings for varchars, Doubles for numbers, etc. I need to be able to pass single character values, whether they be char primitives or Character objects, between the bean and JSTL.
JSTL is apparently coercing my Character objects to Long objects before attempting to compare them to a String constant. Wouldn't it be more logical to attempt to coerce the String constant into a Character? Is there any way to obtain this behaviour and override the Long conversion?

Similar Messages

  • Unicode type coersion - revisited

    I am still having a heck of a time with reading and comparing stuff from text files using vanilla AppleScript (I would prefer not to use 3rd party additions or applications). The file contents are basically ASCII text, but they can be stored as either plain text or Unicode files. Strings can be converted to Unicode, but there doesn't appear to be any coersion from Unicode back to plain text. I have a cheapo conversion subroutine that just strips out the null characters of a Unicode string, but there has to be a better way to do it. Since it looks like Unicode is the way things are going, is it better to just use everything as Unicode text? Before I start tearing up my script, are all the various places like dialogs, the Finder, shell scripts and the like Unicode savvy? Tracking all the ApleScript changes is a bit tricky, since the last manual is something like 1.3.7. If someone is familiar with this, I would appreciate the help.
    G4 Tower 733MHz   Mac OS X (10.4.8)  

    Hello
    Here's a little more consistent version which will always replace any character in the source Unicode text that cannot be represented in system's primary encoding with "?", consequently will not yield raw byte sequence extracted from intermediate styled text which may be improperly interpreted in system's primary encoding.
    Tested with AS1.8.3 under OS9.1 (Engilsh).
    Hope this may be of some help.
    H
    -- SCRIPT
      utxt2string
      v0.2
      * solely using special behaviour of 'as string' coercion for Unicode text that contains character
      which can not be represented by any of installed fonts.
    set s to "abcdefghijklmnopqrstuvwxyzáàâäãåçéèêëíìîïñóòôöõúùûüæøœÿ" -- string in System's primary encoding (e.g. MacRoman)
    set ut to s as Unicode text -- UTF-16
    set cyYa to «data utxt042F» as anything -- U+042F : CYRILLIC CAPITAL LETTER YA
    set cmd to «data utxt2318» as anything -- U+2318 : PLACE OF INTEREST SIGN (= COMMAND KEY)
    set ut to ut & cyYa & cmd
    set s1 to utxt2string(ut)
    return {ut, s1}
    on utxt2string(ut)
      Unicode text ut : source unicode text
      return string : string (in system's primary encoding) that corresponds to ut. -- [*0]
    local x
    if ut's class is not Unicode text then error "parameter error" number 9000 -- for safety
    set x to «data utxtD800» as anything -- an invalid surrogate pair (an orphan high surrogate)
    return ((ut & x) as string)'s text 1 thru -2 -- [*1]
      NOTES.
      [0] This string will be plain string («class TEXT») (not styled text («class STXT»)) where
        each character unrepresentable in system's primary encoding will be replaced by "?".
      [1] This 'as string' coercion for Unicode text that contains character
        which can not be represented by any of installed fonts will yield plain string (not styled text),
        where each character that is not representable in system's primary encoding will be replaced by "?".
        (Here, the character x appended at the end of ut is unrepresentable (invalid), which will result in
        this coercion of desired behaviour.)
    end utxt2string
    -- END OF SCRIPT
      Mac OS 9.1.x  

  • Error while assigning a character value to a numeric variable.

    I fire a sql statement and check the number of rows returned by the sql.
    I check this result with the application logs.
    The application logs keeps the sqls fired by the application and the no of rows returned, in the example below the sql returned 8454 rows.
    My script compares the two results.
    ***********Application Log***********
    4/14/2008 11:15:01 AM: 0059 SQL SELECT "CLUSTER_CD",
    4/14/2008 11:15:01 AM: 0060 "PRODUCT_DESC",
    4/14/2008 11:15:01 AM: 0061 "TEAM_CD"
    4/14/2008 11:15:01 AM: 0062 FROM "OPS$TMS"."MAP_CLUSTER_TEAM_PROD"
    4/14/2008 11:15:01 AM:      3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD, 8,454 lines fetched
    ***********Application Log***********
    My script:
    #!/bin/ksh
    typeset -i resA
    typeset -i resB
    opstms_conn_string="abc/[email protected]"
    set `sqlplus -s $opstms_conn_string << EOF
    set pages 0
    WHENEVER SQLERROR CONTINUE
    SELECT count(*)
    FROM MAP_CLUSTER_TEAM_PROD;
    exit
    EOF`
    resA=$1 ##returns 8454
    resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{print $10}'`
    ##resB returns 8,454
    ## here i get syntax error
    if [ $resA -eq $resB ]; then
    echo "QA passed for sql1"
    else
    echo "QA failed for sql1"
    fi
    The problem is as resB is integer variable it does not accept character value: 8,454 so returns a syntax error:
    How do I change the value assigned to resB into a numeric variable?
    error:
    + grep 3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD, BCVP_Main_Loader.qvw.log
    run.ksh[52]: 8,454: syntax error

    Change:
    resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{print $10}'`
    to this:
    resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{print $10}' | tr -d ,`
    to drop the comma. Or you could do it in awk(1):
    resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{ gsub( /,/, "", $10 ); print $10}'`
    Or you could to it all in awk(1):
    resB=`awk '
    /3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD/ {
    gsub( /,/, "", $10 )
    print $10
    ' BCVP_Main_Loader.qvw.log`
    (This example was not tested, it's just for a model.)
    Someone more of an SQL guru than I can probably tell you how to change your numeric locale to avoid presenting those commas in the first place and avoid the problem.
    HTH

  • Problem on print a report in mode character

    hi, i have oracle 8i and reports 6i, my reports it's generate in mode character, when i send to print (printer epson fx1180), the print is bad, (i configure the prt files example: bold esc "E", Unbold esc "F"),
    MY problem is with windows 2000, i send to print on windows 98 and all good, but now i have windows 2000, anybody help me to config the printers file for windows 2000

    You can create a PDF file using the [itext |http://www.lowagie.com/iText/] library
    you can create reports using jasperreports
    you can print the reports and save them as PDF,EXCEL ,HTML and more...
    (jasperreports is using the [itext |http://www.lowagie.com/iText/] library )
    you can edit your reports using ireport
    hope that helps

  • Mail compose window jumps to back when adding address. As soon as I add a single character to the address window of a new mail message, it pops  under all other existing windows. If I have others open...and who doesn't? I have to then close them all.

    So.....deeply....disappointed by Lion...
    It honestly gets in the way of getting things done.
    When was the last time you had an upgrade, in any program or  OS that caused an immediate productivity drop?
    Mail windows, when adding a new address, pop under to become the lowest window in the stack...before you are done composing...
    no extra clicks..just adding ONE character to the actual address bar does it.
    Trying to add files to an online content management system is hard...it's hard because when you attempt to add the file, it disappears from
    the list, so a search must be conducted...oh not a search of your hard drive...no...it has to include ALL FILES and that takes a while, showing
    files totally unrelated to what you need or in whatever that view is, showing everything from movies to documents, to a whole range of other stuff
    that is irrelevant to what is being sought.
    I can get used to the disappearing icon tool bar...but the message threading in Mail is so strangely bad it's hard to describe. So you send out an email,
    and it had 5 points...but that was 3 emails before...A reply comes in addressing those 5 points but saying something like ..."I disagree with point number 4"
    Unless you have total recall the thread shows you only incoming mail and the LAST most recent folded up message you sent. You are forced to go digging
    into sent mail to see what that point you made 8 days eariler actually was...
    I am pleased that I don't have to have Launchpad (honestly the silliest 'feature' I've ever seen on a computer) in the dock and see no point in the juvenile Mission Control (the naming scheme is odd and reminiscent of Junior Spaceman...how ironic that we end America's manned launch capability at the same time as Launch Pad and Mission Control, both throwbacks to the 60's are added to an OS). In any case both are virtually useless tools. One, replacing the mildly useful Spaces and the other just genuinely useless.
    I'm going to give Apple until the second bug fix...but I can tell right now that Snow Leopard was a far more robust OS. The thousands of posts about this may rise to the level of AntennaGate...I hope so...It seems the only way to get Steve (for whom I have now honestly lost respect for the FIRST TIME) to address the issues is to embarrass the company publicly. Lion is a broken system, poorly conceived...and proof that the Apple methodology of no widespread user testing can and does fail. This needs to get fixed. Soon.

    It seems to have something to do with profile manager.
    I get stack traces in the "system messages" logs for the "Server" application, grrrr.
    I'll get that info and attempt to submit a but report tonight.

  • Print landscape report in character mode

    Hi!
    It seems that I should change xxx.prt file in DESFORMAT parameter to match different kinds of printers in order to print landscape report in character mode.
    Our customers are international wide. How can I do to make this setting meet every customer for printing reports in landscape style?
    We will run the reports on Unix on the middle tier and customers read them in browser.
    Thanks for help.
    null

    Hi,
    This sounds like a similar problem that I had (and still having). It was (is) a Bug. Go to metalink.oracle.com and reference this bug#1413754. See if this is your problem as well. My only work around was change the format of the file instead of using character mode I am now using PDF. Which is working fine for me.
    ~Vannette

  • How can I get around the character limit in the "print pages" option

    I have a rather large PDF file and I need to print certain pages (for example, pages 1, 324, 456, 759, 812, 946, 1206, 1562, 1792, etc.). However, when I click on print and try to type in the pages, there is a character limit, and it is much smaller than the number of characters I need to type. Is there a way around this? Thanks.

    OK I figured out the answer. Ctrl+J opens up the console (You have to activate javascript). The following script will extract the pages into a new document, and then you can simply print those pages. All you need to do is fill up the "pageArray" array with a list of your pages, separated by commas. It does not support ranges.
    // Extracts all pages listed into a new document
    var pageArray = [INSERT YOUR LIST OF PAGE NUMBERS HERE, SEPARATED BY COMMAS];
    if (pageArray.length > 0) {
    var d = app.newDoc();    // this will add a blank page - we need to remove that once we are done
    for (var n = 0; n < pageArray.length; n++) {
    d.insertPages( {
    nPage: d.numPages-1,
    cPath: this.path,
    nStart: pageArray[n]-1,
    nEnd: pageArray[n]-1,
        // remove the first page
        d.deletePages(0);

  • How do I find the position of a single character on a page?

    Hi guys,
    I am developing a PDFEditor, but am having trouble implementing the code which finds the location of glyph characters on a page (in device space). I have read the pdf reference on Text, but do not quite understand it.
    I have worked out the individual character spacings, but I cannot accurately find the location of the first character .
    Here is my current attempt:
    float y = CGPDFPageGetBoxRect([current_page pageReference], kCGPDFCropBox).size.height-current_matrix_position.y;
    float x = current_matrix_position.x;
    float xa = a * x + c * y + e;
    float ya = b * x + d * y + f;
    text_position = [NSValue valueWithCGRect: CGRectMake(xa, ya, 15, d)];
    (where text_position is the location of the start character in device space. a,b,c etc come from the Tm operator.
    current_matrix_position is set as a point (e,f) from the cm operator.)
    This code seems to work with some PDF files:
    But does not work with others:
    (Note there is text in the box above the blue which cannot be disclosed for reasons...)
    Is there something I am missing (like another operator?) or is my formula completely wrong.
    Your help would be greatly appreciated

    Hi Irosenth,
    I have been reading the spec and trying to understand it for several weeks. Unfortunately, I am still confused with how to find the coordinates of the text.
    >> You need to parse the content stream(s) that are associated with the page and
    I have done this. My program finds both the cm operator, the tm operator and the font widths etc. Unfortunately, now that I have all of this information, I am unsure what to do with it.
    How do I properly add these two matricies together? I have looked in the spec which describes it as:
    x' = a * x + c * y + e
    y' = b * x + d * y + f
    I tried this and the results worked on some pages, but not on others (several thousand x coordinates out...). I am finding the ISO 32000-1:2008 very confusing in this section.
    >> manage what you find there
    This is the part I am having major trouble with. Using the coordinate transformation matricies, how can I determine the starting coordinate for the first glyph in a text (BT, ET) on a non-scaled page (so 1 unit = 1 pixel) using the matricies?
    Thanks

  • Weird: Character in View cut out.

    I have a very strange behavoir in Crystal Reports. Somehow I feel that there is a simple cause for this.
    OK.
    I have a field in Crystal Reports containing the STATIC string "2-û". The String is displayed correctly in the designer.
    When i save the report and display it through the .net Crystal Reports viewer the - char disappears. It only displays "2û".
    You can test this behavoir easily. It seems to be only the combination of the to characters -û which cause this. The reason why I need this, is that I am displaying barcode, which miracously couldn't be read anymore when the calculated checksum was this - character the û is the stop character of the certain font.
    Does anyone have an idea?
    Thank You!

    I have found an related article:
    [Likely Bug: Chr(173) not printing in CR Basic 2008|Re: Likely Bug: Chr(173) not printing in CR Basic 2008]

  • How to Display Heirarchy and Character at a time in the report...

    Hi
    I have a req ...where I need to design a query to display a character and its heirarchy colum by colum...I mean, I have document type master data info object it has texts and Heirarchy data source...and we loaded this data...Also we have document type directly coming from ECC  Transactional DS...Now When I take this document type and do not select heirarchy its displaying the document types (KN,KA ,KR etc...)..If I select the heirachy in my query..its displaying in heirarchy structure and the document types (KN,KA,KR ) are displaying as the last nodes. But I want to display the heirarchy and also the document type in 2 diff colums... how it would be possible..is there any thing needs to be done at query level / do i need to take a RKF / CKF and write any code to bring heir and info object value?
    Iam bit confused here..pelase advice ASAP.
    regards

    you cannot have the same character in the query twice.  You can either have it in the hier format or just the char.
    I am wondering why you need to display the same characters twice in each column.
    The best way is to have them in the hier. format and in the char. properties expand the node level as you want so you will see them in the detail level.
    assign points if helpful

  • Is it possible to export to PDF without a Return character at the end of every line?

    I am the author of a book whose first edition has been typeset and extensively amended in InDesign.  I now need to rewrite the first edition to produce a second edition.
    When I copy-and-paste from the PDF with which the publisher has supplied me into MS Word, I get a Return character at the end of every line, which means that text doesn’t automatically wrap and sentences are fragmented so that I get spurious grammar errors.
    I know that not all PDF files have a Return at the end of every line.  Is it possible to restrict Returns to the end of paragraphs when exporting from InDesign to PDF?  If so, what should the publisher be asking the typesetter to do?

    Thanks for your lightning-swift and helpful replies, Mike & Ellis.
    I don't have InDesign myself, so I know hardly anything about how it's used.  I'm just trying to research what an internationally-known publisher should already know how to do, but apparently doesn't!
    Following your suggestion, Mike, I have downloaded the trial version of Acrobat and exported the PDF to a Word file.  This has been moderately successful as there are far fewer spurious Return characters, just a few that I suspect may be hangovers from the typesetter having introduced soft returns in ID.
    As you've suggested Peter and Ellis, I'll suggest that the publisher asks the typesettter to export from ID to RTF and Text to see if that's even better.
    Message was edited 15:24 GMT by: AlanS5100

  • Reading a string one character at a time

    Hi,
    I'm hoping you use SmallBasic for year 10 exam students at my school.  But, I have found a problem I cannot solve.
    I need to be able to read one character at a time from a string (txt file) and convert each char to its ACSII code.
    How do to I read one char at a time from a string to enable processing?
    Thanks for your help.
    Baz 

    Here is an over the top solution that will display the Hex value of the character codes of every character in the file.
    TextWindow.Write("Enter full file name: ")
    filnam = TextWindow.Read()
    contents = File.ReadContents(filnam) 'read the entire file
    TextWindow.Clear()
    TextWindow.WriteLine("File Name: " + filnam)
    TextWindow.WriteLine("Offset: 0")
    col = 0
    row = 5
    TextWindow.CursorLeft = col
    TextWindow.CursorTop = row
    For i= 1 To Text.GetLength(contents)
    ch = Text.GetSubText(contents, i,1)
    chVal = Text.GetCharacterCode(ch)
    ConvertToHex()
    TextWindow.CursorLeft = col
    If chVal < 32 Then
    TextWindow.Write(".")
    Else
    TextWindow.Write(ch)
    EndIf
    TextWindow.CursorLeft = 20 + 2 + (col * 3)
    TextWindow.Write(Text.GetSubText(hexstr,1,2))
    col = col + 1
    If col = 8 Then
    col = col + 1
    EndIf
    If col > 16 Then
    col = 0
    row = row + 1
    If row > 20 then
    TextWindow.CursorTop = 23
    TextWindow.CursorLeft = 25
    TextWindow.Write("< < < Press ENTER to Continue > > >")
    TextWindow.Read()
    TextWindow.Clear()
    TextWindow.WriteLine("File Name: " + filnam)
    TextWindow.WriteLine("Offset: " + i)
    row = 5
    EndIf
    TextWindow.CursorTop = row
    EndIf
    EndFor
    TextWindow.WriteLine("")
    TextWindow.WriteLine("")
    Sub ConvertToHex
    HexValue[0] = "0"
    HexValue[1] = "1"
    HexValue[2] = "2"
    HexValue[3] = "3"
    HexValue[4] = "4"
    HexValue[5] = "5"
    HexValue[6] = "6"
    HexValue[7] = "7"
    HexValue[8] = "8"
    HexValue[9] = "9"
    HexValue[11] = "A"
    HexValue[12] = "B"
    HexValue[13] = "C"
    HexValue[14] = "D"
    HexValue[15] = "E"
    val = chVal
    hexstr = "h" 'Need to force Small basic to concatenate rather than add
    While val > 0
    hexPos = Math.Remainder(val, 16)
    hexstr = HexValue[hexPos] + hexstr
    val = Math.Floor(val / 16)
    EndWhile
    For hi = Text.GetLength(hexstr) To 2
    hexstr = "0" + hexstr
    EndFor
    EndSub
    Enjoy!

  • ORA-12712 error while changing nls character set to AL32UTF8

    Hi,
    It is strongly recommend to use database character set AL32UTF8 when ever a database is going to used with our XML capabilities. The database character set in the installed DB is WE8MSWIN1252. For making use of XML DB features, I need to change it to AL32UTF8. But, when I try doing this, I'm getting ORA-12712: new character set must be a superset of old character set. Is there a way to solve this issue?
    Thanks in advance,
    Divya.

    Hi,
    a change from we8mswin1252 to al32utf8 is not directly possible. This is because al32utf is not a binary superset of we8mswin1252.
    There are 2 options:
    - use full export and import
    - Use of the Alter in a sort of restricted way
    The method you can choose depends on the characters in the database, is it only ASCII then the second one can work, in other cases the first one is needed.
    It is all described in the Support Note 260192.1, "Changing the NLS_CHARACTERSET to AL32UTF8 / UTF8 (Unicode)". Get it from the support/metalink site.
    You can also read the chapters about this issue in the Globalization Guide: [url http://download.oracle.com/docs/cd/E11882_01/server.112/e10729/ch11charsetmig.htm#g1011430]Change characterset.
    Herald ten Dam
    http://htendam.wordpress.com

  • How 2 assgin a character value to the auxillary cell

    Hi,
         I'm assigning a character value to the auxiliary cell in the macro. But it gives me a dump. So do let me know can I assign a character value to the auxiliary cell ( I need to display this value for the alert text).
    Thanks,
    Siva.

    Why are you trying to use a character in the planning book - why not a representative value in numbers
    but if you HAVE to use characteristic then you can also try to use the notes functionality (right click on a cell and go to notes if you have not seen this )
    These notes are usually anchored to a cell. These notes are stored in a table (check in se 16 with wildcard on notes ) and is associated to the value of a cell
    So if you can reference a cell value and put in the conditons to the values on it you might be able to manipulate the values in the table for notes and this will cause the notes in the interactive planning boo to change accoring to the value of the cell

  • Error while releasing transport request -  Special character "_" in generic

    Hi all,
    we're receiving the error  Special character "_" in generic key  when releasing a best practice transport.
    Note 1304725 describes my error, but the solution cannot be implemented. The reason for this is that we do not have an individual entry for eacht yb_PS,..,
    but we have only one entry where field BWERT has a wildcard '*' as entry.
    Does anyone has  some idea how to solve this ?
    kind regards !

    Hello Bjorn,
    How did you get this solved?
    I'm having nearly the same issue:
    A custom-table with a total key lenght of about 365 characters. As soon as I enter a special character (_) in the key field just before the position 120, the message tk287 rejects the entry. Entering the special character in a key field at about key position
    60, there's no message rejecting the entry.
    Regards

Maybe you are looking for

  • Unable to inject XMP Packet info into older versions of Adobe Illustrator files

    Hi, I am trying to inject XMP Packet into Illustrator files of version 9 and below. I am using XMP SDK 4.0 Prerelease. My Code is inserting xmp packet only into Illustrator 10 and above. But with Adobe Illustrator 9 and below.. its not. Can you pleas

  • How can we Customise the standard tool bar ??

    Can any body tell em how can we customise the standard tool baar in the forms. ie is there any way by which we can enable or disable few of its button. do reply thanx in advance amyt

  • Compressor Cinema Craft plug-in. What to do with the audio side?

    I've recently installed the Cinema Craft plug-in into Compressor 3.5. Great for improving the quality of my DVDs. But what is the best way to organise the audio compression side and synching it with the output from the Cinema Craft plug-in for the su

  • Automatically created a standalone WLan account - How to get rid of that?

    Dear all, my computer has automatically created a standalone wireless account by the name of "Homeinternet" which is of course open and unsecured. I did create an account previously to access the internet. How do I get rid of that "Homeinternet" acco

  • MobileMe Password Error

    I know that MobileMe has been inactive for some time, but a message pops up on my screen every 10 minutes telling me that I have "entered an invalid MobileMe member name or password." I can't remember my password, and cannot get the messages to stop.