Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SGWT.mobile - UTF-8 Encoding and Bullet character

    Hi,

    As you know I have a sgwt application running in production for some time and I am currently developing its mobile counterpart in SGWT.mobile. The two use the same mySQL DB and SGWT server part (including ds definition). UTF-8 is used everywhere (DB, sgwt, sgwt.mobile).

    Bullet character • is permitted in UTF-8 and some users have entered such kind of characters in some text fields, which was possible using the desktop UI. When I open these records (with a Bullet character) in SGWT.mobile the is no problem to load and visualize it. However when I try to update the data using SGWT.mobile I get the following error:

    Code:
    === 2013-03-14 23:03:11,656 [l0-5] INFO  RequestContext - URL: '/isomorphic/RESTHandler', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.160 Safari/537.22': Safari with Accept-Encoding header
    === 2013-03-14 23:03:11,657 [l0-5] DEBUG RestRequestParser - Parsing json object: '{"transactionNum":29,"dataSource":"ui_form_actions","operationType":"update","requestId":"29","showPrompt":null,"data":{"id":61,"companyName_short":"0001","id_type":1,"description":"•","id_prospect_contact":null,"name":"Test","id_prospect":341,"id_person_owners":"[3],[3]","sneak":"id:61","id_person_contributors":"[3]"},"oldValues":{"id":61,"companyName_short":"0001","id_type":2,"id_prospect_contact":null,"description":"•","name":"Test","id_prospect":341,"id_person_owners":"[3],[3]","sneak":"id:61","id_person_contributors":"[3]"}}'
    === 2013-03-14 23:03:11,662 [l0-5] ERROR RESTHandler - Top-level servlet error: 
    com.isomorphic.js.parser.TokenMgrError: Lexical error at line 1, column 183.  Encountered: "\u2022" (8226), after : "\""
    	at com.isomorphic.js.parser.JSParserTokenManager.getNextToken(JSParserTokenManager.java:1444)
    	at com.isomorphic.js.parser.JSParser.jj_ntk(JSParser.java:735)
    	at com.isomorphic.js.parser.JSParser.JSDataStructure(JSParser.java:120)
    	at com.isomorphic.js.parser.JSParser.HashLine(JSParser.java:264)
    	at com.isomorphic.js.parser.JSParser.HashLiteral(JSParser.java:219)
    	at com.isomorphic.js.parser.JSParser.JSDataStructure(JSParser.java:122)
    	at com.isomorphic.js.parser.JSParser.HashLine(JSParser.java:264)
    	at com.isomorphic.js.parser.JSParser.HashLiteral(JSParser.java:219)
    	at com.isomorphic.js.parser.JSParser.JSDataStructure(JSParser.java:122)
    	at com.isomorphic.js.parser.JSParser.parseDataStruct(JSParser.java:105)
    	at com.isomorphic.js.parser.JSParser.parseDataStruct(JSParser.java:44)
    	at com.isomorphic.js.JSTranslater.fromJS(JSTranslater.java:1589)
    	at com.isomorphic.js.JSTranslater.fromJS(JSTranslater.java:1578)
    	at com.isomorphic.rpc.RestRequestParser.parseRequest(RestRequestParser.java:200)
    	at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:286)
    	at com.isomorphic.servlet.RESTHandler.processRequest(RESTHandler.java:307)
    	at com.isomorphic.servlet.RESTHandler.doPost(RESTHandler.java:259)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
    	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
    	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
    	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.Server.handle(Server.java:324)
    	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
    	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
    	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
    === 2013-03-14 23:03:11,665 [l0-5] INFO  Compression - /isomorphic/RESTHandler: 3150 -> 776 bytes
    The exact same operation using SGWT UI works fine, here is the log:
    Code:
    === 2013-03-14 22:59:23,053 [l0-9] INFO  RequestContext - URL: '/moon_desktop/sc/IDACall', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0': Moz (Gecko) with Accept-Encoding header
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - Header Name:Value pair: Host:127.0.0.1:8888
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - Header Name:Value pair: User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - Header Name:Value pair: Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - Header Name:Value pair: Accept-Language:en-US,en;q=0.5
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - Header Name:Value pair: Accept-Encoding:gzip, deflate
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - Header Name:Value pair: Content-Type:application/x-www-form-urlencoded; charset=UTF-8
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - Header Name:Value pair: Referer:http://127.0.0.1:8888/MOON_DESKTOP.html?gwt.codesvr=127.0.0.1:9997
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - Header Name:Value pair: Content-Length:1925
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - Header Name:Value pair: Cookie:com.nside.moon.client_desktop.MoonDesktop.uiversion=2.1.0.d; com.nside.moon.client_desktop.screens.ScreenMoonitor.selectedId=4; com.nside.moon.client_desktop.screens.ScreenCompanies.explorerWidth=700; com.nside.moon.client_desktop.screens.ScreenCompanies.selectedId=165; com.nside.moon.client_desktop.screens.ScreenOrders.explorerWidth=650; com.nside.moon.client_desktop.screens.ScreenOrders.selectedId=76; com.nside.moon.client_desktop.screens.ScreenDashboard.selectedId=5; com.nside.moon.client_desktop.screens.ScreenActions.explorerWidth=800; com.nside.moon.client_desktop.screens.ScreenActions.selectedId=39; com.nside.moon.client_desktop.screens.ScreenEntries.explorerWidth=750; com.nside.moon.client_desktop.screens.ScreenEntries.selectedId=0; com.nside.moon.client_desktop.screens.ScreenAccounting.selectedId=4; com.nside.moon.client_desktop.security.LoginWindow.username=bda; isc_cState=ready; JSESSIONID=1noikfr5tsuga; com.nside.moon.client_desktop.screens.ScreenProspects.explorerWidth=700; com.nside.moon.client_desktop.screens.ScreenProspects.selectedId=341
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - Header Name:Value pair: Connection:keep-alive
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - Header Name:Value pair: Pragma:no-cache
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - Header Name:Value pair: Cache-Control:no-cache
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - session exists: 1noikfr5tsuga
    === 2013-03-14 22:59:23,053 [l0-9] DEBUG IDACall - remote user: null
    === 2013-03-14 22:59:23,060 [l0-9] DEBUG XML - Parsed XML from (in memory stream): 6ms
    === 2013-03-14 22:59:23,061 [l0-9] DEBUG RPCManager - Processing 1 requests.
    === 2013-03-14 22:59:23,062 [l0-9] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
            id:61
        },
        values:{
            id:61,
            companyName_short:"0001",
            id_type:2,
            description:"•",
            name:"Test",
            id_prospect:341,
            id_person_owners:"[3],[3]",
            sneak:"id:61",
            id_person_contributors:"[3]"
        },
        operationConfig:{
            dataSource:"ui_form_actions",
            operationType:"update"
        },
        componentId:"isc_ValuesManager_10",
        appID:"builtinApplication",
        operation:"ui_form_actions_update",
        oldValues:{
            id:61,
            companyName_short:"0001",
            id_type:1,
            description:"•",
            name:"Test",
            id_prospect:341,
            id_person_owners:"[3],[3]",
            sneak:"id:61",
            id_person_contributors:"[3]"
        }
    }
    === 2013-03-14 22:59:23,062 [l0-9] INFO  IDACall - Performing 1 operation(s)
    === 2013-03-14 22:59:23,062 [l0-9] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
    === 2013-03-14 22:59:23,062 [l0-9] DEBUG DeclarativeSecurity - DataSource ui_form_actions is not in the pre-checked list, processing...
    === 2013-03-14 22:59:23,062 [l0-9] DEBUG AppBase - [builtinApplication.ui_form_actions_update] No userTypes defined, allowing anyone access to all operations for this application
    === 2013-03-14 22:59:23,062 [l0-9] DEBUG AppBase - [builtinApplication.ui_form_actions_update] No public zero-argument method named '_ui_form_actions_update' found, performing generic datasource operation
    === 2013-03-14 22:59:23,063 [l0-9] INFO  SQLDataSource - [builtinApplication.ui_form_actions_update] Performing update operation with
    	criteria: {id:61}	values: {id:61,companyName_short:"0001",id_type:2,description:"•",name:"Test",id_prospect:341,id_person_owners:"[3],[3]",sneak:"id:61",id_person_contributors:"[3]"}
    === 2013-03-14 22:59:23,063 [l0-9] INFO  SQLValuesClause - [builtinApplication.ui_form_actions_update] Ignored data for non-existent or included columns: [companyName_short, id_person_owners, sneak, id_person_contributors]
    === 2013-03-14 22:59:23,063 [l0-9] DEBUG PoolableSQLConnectionFactory - [builtinApplication.ui_form_actions_update] Executing pingTest 'select 1 from dual' on connection 484260854
    === 2013-03-14 22:59:23,064 [l0-9] DEBUG SQLConnectionManager - [builtinApplication.ui_form_actions_update] Returning borrowed connection '484260854'
    === 2013-03-14 22:59:23,064 [l0-9] DEBUG SQLTransaction - [builtinApplication.ui_form_actions_update] Started new Mysql transaction "484260854"
    === 2013-03-14 22:59:23,064 [l0-9] DEBUG SQLDriver - [builtinApplication.ui_form_actions_update] About to execute SQL update in 'Mysql' using connection'484260854'
    === 2013-03-14 22:59:23,064 [l0-9] INFO  SQLDriver - [builtinApplication.ui_form_actions_update] Executing SQL update on 'Mysql': UPDATE ui_form_actions SET description='•', id_prospect=341, id_type=2, name='Test' WHERE (ui_form_actions.id=61)
    === 2013-03-14 22:59:23,064 [l0-9] DEBUG SQLDataSource - [builtinApplication.ui_form_actions_update] update operation affected 1 rows
    === 2013-03-14 22:59:23,065 [l0-9] INFO  SQLDataSource - [builtinApplication.ui_form_actions_update] primaryKeys: {id=61}
    === 2013-03-14 22:59:23,065 [l0-9] DEBUG DeclarativeSecurity - [builtinApplication.ui_form_actions_update] Processing security checks for DataSource null, field null
    === 2013-03-14 22:59:23,065 [l0-9] DEBUG DeclarativeSecurity - [builtinApplication.ui_form_actions_update] DataSource ui_form_actions is not in the pre-checked list, processing...
    === 2013-03-14 22:59:23,065 [l0-9] DEBUG DeclarativeSecurity - [builtinApplication.ui_form_actions_update] Processing security checks for DataSource ui_form_actions_, field sneak
    === 2013-03-14 22:59:23,065 [l0-9] DEBUG DeclarativeSecurity - [builtinApplication.ui_form_actions_update] DataSource ui_form_actions_ is not in the pre-checked list, processing...
    === 2013-03-14 22:59:23,065 [l0-9] DEBUG DeclarativeSecurity - [builtinApplication.ui_form_actions_update] Processing security checks for DataSource ui_form_actions_, field companyName_short
    === 2013-03-14 22:59:23,065 [l0-9] DEBUG DeclarativeSecurity - [builtinApplication.ui_form_actions_update] Processing security checks for DataSource ui_form_actions_, field id_person_owners
    === 2013-03-14 22:59:23,065 [l0-9] DEBUG DeclarativeSecurity - [builtinApplication.ui_form_actions_update] Processing security checks for DataSource ui_form_actions_, field id_person_contributors
    === 2013-03-14 22:59:23,065 [l0-9] DEBUG AppBase - [builtinApplication.ui_form_actions_update, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
    === 2013-03-14 22:59:23,065 [l0-9] DEBUG AppBase - [builtinApplication.ui_form_actions_update, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
    Please note that I had encoding problems before (see post http://forums.smartclient.com/showthread.php?t=25105) but this is not the same problem now, there is no issue saving special characters like "ç" which was my problem before. Problems come with "even more special" character like •
    Whatever character that is accepted by the SGWT should be accepted by SGWT.mobile as well otherwise it becomes impossible to have the two living together.

    Thanks for your help, Ben.
    Last edited by bda@n-side.com; 14 Mar 2013, 14:24.

    #2
    You need to look at the request coming from the browser. What's the Content-Type header? If it isn't UTF-8, that's the problem, and the solution is the same things we discussed with you in the other thread.

    Note you were reporting weird flip-flopping behavior before - sometimes UTF-8, sometimes not. This might result from, for instance, saving a file from one editor as UTF-8, then editing it somewhere else and inadvertently changing the encoding back.

    Comment


      #3
      Please find the full request info, captured using Chrome developer tool, in both cases: SGWT.mobile and SGWT.

      Content-type is utf-8 in both cases. However, in the SGWT.mobile case, the "bullet" character in description field is already broken into "•" in the JSON send in the request (request payload). In SGWT, which uses a different technique, the bullet appears correctly in the request (Form Data).

      SGWT.mobile case
      Code:
      Request URL:http://127.0.0.1:8080/MOON/isomorphic/RESTHandler?isc_dataFormat=json
      Request Method:POST
      Status Code:200 OK
      
      Request Headers
      
      Accept:application/json,*/*
      Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
      Accept-Encoding:gzip,deflate,sdch
      Accept-Language:en-US,en;q=0.8
      Connection:keep-alive
      Content-Length:555
      Content-Type:application/json;charset=UTF-8
      Cookie:JSESSIONID=00ABFFFC4065B57EB4A9D6B292C89782; com.nside.moon.client_desktop.screens.Screen2%245.explorerWidth=700; com.nside.moon.client_desktop.screens.Screen0%241.explorerWidth=300; com.nside.moon.client_desktop.screens.ScreenOrders.explorerWidth=650; com.nside.moon.client_desktop.screens.ScreenProspects.explorerWidth=700; com.nside.moon.client_desktop.screens.ScreenCompanies.explorerWidth=700; com.nside.moon.client_desktop.screens.ScreenContacts.explorerWidth=700; com.nside.moon.client_desktop.screens.ScreenInvoices.explorerWidth=900; com.nside.moon.client_desktop.screens.ScreenProducts.explorerWidth=650; com.nside.moon.client_desktop.screens.ScreenInvestments.explorerWidth=700; com.nside.moon.client_desktop.screens.ScreenEntries.explorerWidth=750; com.nside.moon.client_desktop.screens.ScreenSettings.explorerWidth=300; com.nside.moon.client_desktop.screens.ScreenInvestments.selectedId=79; com.nside.moon.client_desktop.screens.ScreenPersonsPrivate.explorerWidth=700; com.nside.moon.client_desktop.screens.ScreenTaggerCompany.selectedId=1; com.nside.moon.client_desktop.screens.ScreenTaggerProspect.selectedId=1; com.nside.moon.client_desktop.screens.ScreenTaggerAction.selectedId=1; com.nside.moon.client_desktop.screens.ScreenTaggerInvoice.selectedId=1; com.nside.moon.client_desktop.screens.ScreenTaggerOrder.selectedId=2; com.nside.moon.client_desktop.screens.ScreenTaggerProduct.selectedId=1; com.nside.moon.client_desktop.screens.ScreenTaggerInvestment.selectedId=2; com.nside.moon.client_desktop.screens.ScreenTaggerEntry.selectedId=1; com.nside.moon.client_desktop.screens.ScreenProducts.selectedId=3; com.nside.moon.client_desktop.screens.ScreenTaggerPerson.selectedId=2; com.nside.moon.client_desktop.screens.ScreenTaggerContact.selectedId=3; com.nside.moon.client_desktop.screens.ScreenAnalysis.selectedId=4; com.nside.moon.client_desktop.screens.ScreenContacts.selectedId=3; com.nside.moon.client_desktop.screens.ScreenJournal.objectFilter=prospect; com.nside.moon.client_desktop.screens.ScreenEntries.selectedId=0; com.nside.moon.client_desktop.screens.ScreenInvoices.selectedId=537; com.nside.moon.client_desktop.screens.ScreenPersonsPrivate.selectedId=3; com.nside.moon.client_desktop.security.LoginWindow.username=bda; com.nside.moon.client_mobile.screens.ScreenMoonitor.selectedId=5; com.nside.moon.client_desktop.screens.ScreenActions.selectedId=0; com.nside.moon.client_mobile.screens.ScreenDashboard.selectedId=4; com.nside.moon.client_desktop.screens.ScreenOrders.selectedId=267; com.nside.moon.client_desktop.screens.ScreenAccounting.selectedId=4; com.nside.moon.client_desktop.screens.ScreenDashboard.selectedId=4; com.nside.moon.client_desktop.MoonDesktop.uiversion=2.1.0.d; com.nside.moon.client_desktop.screens.ScreenMoonitor.selectedId=4; com.nside.moon.client_desktop.screens.ScreenProspects.selectedId=340; com.nside.moon.client_desktop.screens.ScreenCompanies.selectedId=1; com.nside.moon.client_mobile.MoonMobile.uiversion.mobile=2.1.0.m; com.nside.moon.client_mobile.security.LoginWindow.username=ygo; com.nside.moon.client_desktop.security.LoginWindow.username=bda; com.nside.moon.client_desktop.screens.ScreenActions.explorerWidth=800; com.nside.moon.client_desktop.screens.ScreenActions.selectedId=0; settingStore=1347350636886_0; com.nside.moon.client_desktop.screens.ScreenOrders.explorerWidth=650; com.nside.moon.client_desktop.screens.ScreenOrders.selectedId=0; com.nside.moon.client_desktop.MoonDesktop.uiversion=2.1.1.d; com.nside.moon.client_desktop.screens.ScreenMoonitor.selectedId=4; com.nside.moon.client_mobile.screens.ScreenDashboard.selectedId=4; com.nside.moon.client_mobile.security.LoginWindow%243.username=bda; com.nside.moon.client_mobile.screens.ScreenMoonitor.selectedId=6; isc_cState=ready; com.nside.moon.client_mobile.MoonMobile.uiversion.mobile=2.1.0.m; JSESSIONID=doxdzbqhcvft; com.nside.moon.client_mobile.security.LoginWindow.username=ygo
      Host:127.0.0.1:8080
      Origin:http://127.0.0.1:8080
      Referer:http://127.0.0.1:8080/MOON/MOON_MOBILE.html
      User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22
      
      Query String Parameters view source view URL encoded
      isc_dataFormat:json
      
      Request Payload
      
      {"operationType":"update","dataSource":"ui_form_actions","data":{"id_type":4,"id_prospect_contact":null,"id_prospect":263,"id":61,"companyName_short":"Ternium Siderar","description":"•","name":"Test","id_person_owners":"[4],[4]","sneak":"id:61","id_person_contributors":""},"oldValues":{"id_type":3,"id_prospect_contact":null,"id_prospect":263,"id":61,"companyName_short":"Ternium Siderar","description":"•","name":"Test","id_person_owners":"[4],[4]","sneak":"id:61","id_person_contributors":""},"showPrompt":null,"transactionNum":27,"requestId":"27"}
      
      Response Headers view source
      
      Content-Encoding:gzip
      Content-Length:837
      Content-Type:text/html;charset=UTF-8
      Date:Fri, 15 Mar 2013 09:33:11 GMT
      Server:Apache-Coyote/1.1
      X-Included-Test:true
      X-Included-Test2:true
      SGWT case
      Code:
      Request URL:http://127.0.0.1:8080/MOON/moon_desktop/sc/IDACall?isc_rpc=1&isc_v=v8.3_2012-11-20&isc_xhr=1
      Request Method:POST
      Status Code:200 OK
      
      Request Headers view source
      
      Accept:*/*
      Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
      Accept-Encoding:gzip,deflate,sdch
      Accept-Language:en-US,en;q=0.8
      Connection:keep-alive
      Content-Length:1934
      Content-Type:application/x-www-form-urlencoded; charset=UTF-8
      Cookie:JSESSIONID=00ABFFFC4065B57EB4A9D6B292C89782; com.nside.moon.client_desktop.screens.Screen2%245.explorerWidth=700; com.nside.moon.client_desktop.screens.Screen0%241.explorerWidth=300; com.nside.moon.client_desktop.screens.ScreenOrders.explorerWidth=650; com.nside.moon.client_desktop.screens.ScreenProspects.explorerWidth=700; com.nside.moon.client_desktop.screens.ScreenCompanies.explorerWidth=700; com.nside.moon.client_desktop.screens.ScreenContacts.explorerWidth=700; com.nside.moon.client_desktop.screens.ScreenInvoices.explorerWidth=900; com.nside.moon.client_desktop.screens.ScreenProducts.explorerWidth=650; com.nside.moon.client_desktop.screens.ScreenInvestments.explorerWidth=700; com.nside.moon.client_desktop.screens.ScreenEntries.explorerWidth=750; com.nside.moon.client_desktop.screens.ScreenSettings.explorerWidth=300; com.nside.moon.client_desktop.screens.ScreenInvestments.selectedId=79; com.nside.moon.client_desktop.screens.ScreenPersonsPrivate.explorerWidth=700; com.nside.moon.client_desktop.screens.ScreenTaggerCompany.selectedId=1; com.nside.moon.client_desktop.screens.ScreenTaggerProspect.selectedId=1; com.nside.moon.client_desktop.screens.ScreenTaggerAction.selectedId=1; com.nside.moon.client_desktop.screens.ScreenTaggerInvoice.selectedId=1; com.nside.moon.client_desktop.screens.ScreenTaggerOrder.selectedId=2; com.nside.moon.client_desktop.screens.ScreenTaggerProduct.selectedId=1; com.nside.moon.client_desktop.screens.ScreenTaggerInvestment.selectedId=2; com.nside.moon.client_desktop.screens.ScreenTaggerEntry.selectedId=1; com.nside.moon.client_desktop.screens.ScreenProducts.selectedId=3; com.nside.moon.client_desktop.screens.ScreenTaggerPerson.selectedId=2; com.nside.moon.client_desktop.screens.ScreenTaggerContact.selectedId=3; com.nside.moon.client_desktop.screens.ScreenAnalysis.selectedId=4; com.nside.moon.client_desktop.screens.ScreenContacts.selectedId=3; com.nside.moon.client_desktop.screens.ScreenJournal.objectFilter=prospect; com.nside.moon.client_desktop.screens.ScreenEntries.selectedId=0; com.nside.moon.client_desktop.screens.ScreenInvoices.selectedId=537; com.nside.moon.client_desktop.screens.ScreenPersonsPrivate.selectedId=3; com.nside.moon.client_desktop.security.LoginWindow.username=bda; com.nside.moon.client_mobile.screens.ScreenMoonitor.selectedId=5; com.nside.moon.client_mobile.screens.ScreenDashboard.selectedId=4; com.nside.moon.client_desktop.screens.ScreenOrders.selectedId=267; com.nside.moon.client_desktop.screens.ScreenAccounting.selectedId=4; com.nside.moon.client_desktop.screens.ScreenDashboard.selectedId=4; com.nside.moon.client_desktop.screens.ScreenProspects.selectedId=340; com.nside.moon.client_desktop.screens.ScreenCompanies.selectedId=1; com.nside.moon.client_mobile.MoonMobile.uiversion.mobile=2.1.0.m; com.nside.moon.client_mobile.security.LoginWindow.username=ygo; com.nside.moon.client_desktop.MoonDesktop.uiversion=2.1.0.d; com.nside.moon.client_desktop.screens.ScreenMoonitor.selectedId=4; com.nside.moon.client_desktop.screens.ScreenActions.selectedId=61; com.nside.moon.client_desktop.security.LoginWindow.username=bda; com.nside.moon.client_desktop.screens.ScreenActions.explorerWidth=800; com.nside.moon.client_desktop.screens.ScreenActions.selectedId=0; settingStore=1347350636886_0; com.nside.moon.client_desktop.screens.ScreenOrders.explorerWidth=650; com.nside.moon.client_desktop.screens.ScreenOrders.selectedId=0; com.nside.moon.client_desktop.MoonDesktop.uiversion=2.1.1.d; com.nside.moon.client_desktop.screens.ScreenMoonitor.selectedId=4; com.nside.moon.client_mobile.screens.ScreenDashboard.selectedId=4; com.nside.moon.client_mobile.security.LoginWindow%243.username=bda; com.nside.moon.client_mobile.screens.ScreenMoonitor.selectedId=6; isc_cState=ready; com.nside.moon.client_mobile.MoonMobile.uiversion.mobile=2.1.0.m; JSESSIONID=doxdzbqhcvft; com.nside.moon.client_mobile.security.LoginWindow.username=ygo
      Host:127.0.0.1:8080
      Origin:http://127.0.0.1:8080
      Referer:http://127.0.0.1:8080/MOON/
      User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22
      
      Query String Parameters view source view URL encoded
      
      isc_rpc:1
      isc_v:v8.3_2012-11-20
      isc_xhr:1
      
      Form Data view source view URL encoded
      
      isc_tnum:43
      _transaction:<transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object"><transactionNum xsi:type="xsd:long">43</transactionNum><operations xsi:type="xsd:List"><elem xsi:type="xsd:Object"><criteria xsi:type="xsd:Object"><id xsi:type="xsd:long">61</id></criteria><values xsi:type="xsd:Object"><id xsi:type="xsd:long">61</id><companyName_short>Ternium Siderar</companyName_short><id_type xsi:type="xsd:long">2</id_type><description>•</description><name>Test</name><id_prospect xsi:type="xsd:long">263</id_prospect><id_person_owners>[4],[4]</id_person_owners><sneak>id:61</sneak><id_person_contributors></id_person_contributors></values><operationConfig xsi:type="xsd:Object"><dataSource>ui_form_actions</dataSource><operationType>update</operationType></operationConfig><componentId>isc_ValuesManager_0</componentId><appID>builtinApplication</appID><operation>ui_form_actions_update</operation><oldValues xsi:type="xsd:Object"><id xsi:type="xsd:long">61</id><companyName_short>Ternium Siderar</companyName_short><id_type xsi:type="xsd:long">3</id_type><description>•</description><name>Test</name><id_prospect xsi:type="xsd:long">263</id_prospect><id_person_owners>[4],[4]</id_person_owners><sneak>id:61</sneak><id_person_contributors></id_person_contributors></oldValues></elem></operations></transaction>
      protocolVersion:1.0
      
      Response Headers view source
      
      Cache-Control:no-cache
      Content-Encoding:gzip
      Content-Length:241
      Content-Type:text/plain;charset=UTF-8
      Date:Fri, 15 Mar 2013 09:35:14 GMT
      Expires:Fri, 15 Mar 2013 09:35:14 GMT
      Pragma:no-cache
      Server:Apache-Coyote/1.1
      X-Included-Test:true
      X-Included-Test2:true
      Last edited by bda@n-side.com; 15 Mar 2013, 01:50.

      Comment


        #4
        It turns out both requests are correct, and we tracked this to bad/incomplete Unicode settings that were used to generate the server-side JSON parser long ago, in such a way that it only handled part of Unicode. The server-side parser had never been an issue before since, prior to RESTHandler, this parser was used for configuration files only. Should be fixed for tomorrow's nightlies.

        Comment


          #5
          Just a further note: as far as seeing the bullet character encoded different for SGWT.mobile vs SGWT desktop: this appears to be some kind of bug in the Developer Tools included with Chrome. Using lower-level packet sniffing tools (Wireshark) there was no different in the request.

          Comment


            #6
            Hi,

            Tested with the last nightly (2013-03-20 sgwt+sgwt.mob), in debug and prod (tomcat), problem still there:

            Code:
            === 2013-03-20 21:53:45,354 [l0-2] INFO  RequestContext - URL: '/isomorphic/RESTHandler', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22': Safari with Accept-Encoding header
            === 2013-03-20 21:53:45,354 [l0-2] DEBUG RestRequestParser - Parsing json object: '{"transactionNum":38,"dataSource":"ui_form_actions","operationType":"update","requestId":"38","showPrompt":null,"data":{"id":52,"companyName_short":"MET","id_type":3,"description":"•","id_prospect_contact":null,"name":"Test","id_prospect":299,"id_person_owners":"[3],[7]","sneak":"id:52","id_person_contributors":""},"oldValues":{"id":52,"companyName_short":"MET","id_type":3,"id_prospect_contact":null,"description":null,"name":"Call Luc Moens","id_prospect":299,"id_person_owners":"[3],[7]","sneak":"id:52","id_person_contributors":""}}'
            === 2013-03-20 21:53:45,359 [l0-2] ERROR RESTHandler - Top-level servlet error: 
            com.isomorphic.js.parser.TokenMgrError: Lexical error at line 1, column 182.  Encountered: "\u2022" (8226), after : "\""
            	at com.isomorphic.js.parser.JSParserTokenManager.getNextToken(JSParserTokenManager.java:1444)
            	at com.isomorphic.js.parser.JSParser.jj_ntk(JSParser.java:765)
            	at com.isomorphic.js.parser.JSParser.JSDataStructure(JSParser.java:137)
            	at com.isomorphic.js.parser.JSParser.HashLine(JSParser.java:281)
            	at com.isomorphic.js.parser.JSParser.HashLiteral(JSParser.java:236)
            	at com.isomorphic.js.parser.JSParser.JSDataStructure(JSParser.java:139)
            	at com.isomorphic.js.parser.JSParser.HashLine(JSParser.java:281)
            	at com.isomorphic.js.parser.JSParser.HashLiteral(JSParser.java:236)
            	at com.isomorphic.js.parser.JSParser.JSDataStructure(JSParser.java:139)
            	at com.isomorphic.js.parser.JSParser.parseDataStruct(JSParser.java:122)
            	at com.isomorphic.js.parser.JSParser.parseDataStruct(JSParser.java:57)
            	at com.isomorphic.js.JSTranslater.fromJS(JSTranslater.java:1640)
            	at com.isomorphic.js.JSTranslater.fromJS(JSTranslater.java:1628)
            	at com.isomorphic.rpc.RestRequestParser.parseRequest(RestRequestParser.java:205)
            	at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:286)
            	at com.isomorphic.servlet.RESTHandler.processRequest(RESTHandler.java:307)
            	at com.isomorphic.servlet.RESTHandler.doPost(RESTHandler.java:259)
            	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
            	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
            	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
            	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
            	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
            	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
            	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
            	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
            	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
            	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
            	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
            	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
            	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
            	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
            	at org.mortbay.jetty.Server.handle(Server.java:324)
            	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
            	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
            	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
            	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
            	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
            	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
            	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
            === 2013-03-20 21:53:45,360 [l0-2] INFO  Compression - /isomorphic/RESTHandler: 3150 -> 776 bytes
            Request:
            Code:
            Request URL:http://127.0.0.1:8888/isomorphic/RESTHandler?isc_dataFormat=json
            Request Method:POST
            Status Code:200 OK
            
            Request Headers
            
            
            Accept:application/json,*/*
            Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
            Accept-Encoding:gzip,deflate,sdch
            Accept-Language:en-US,en;q=0.8
            Connection:keep-alive
            Content-Length:540
            Content-Type:application/json;charset=UTF-8
            Cookie:com.nside.moon.client_desktop.screens.ScreenDashboard.selectedId=4; com.nside.moon.client_desktop.screens.ScreenOrders.explorerWidth=650; com.nside.moon.client_desktop.screens.ScreenOrders.selectedId=76; com.nside.moon.client_mobile.screens.ScreenJournal.periodFilter=last_30; com.nside.moon.client_mobile.screens.ScreenJournal.objectFilter=; com.nside.moon.client_desktop.MoonDesktop.uiversion=2.1.1.d; com.nside.moon.client_desktop.screens.ScreenMoonitor.selectedId=4; com.nside.moon.client_mobile.screens.ScreenAccounting.selectedId=4; com.nside.moon.client_mobile.screens.ScreenAccountingPublic.selectedId=3; com.nside.moon.client_mobile.screens.ScreenMoonitor.selectedId=4; isc_cState=ready; com.nside.moon.client_mobile.screens.ScreenDashboard.selectedId=4; com.nside.moon.client_mobile.MoonMobile.uiversion.mobile=2.2.0.m; JSESSIONID=1cko7rjcyy9aw; com.nside.moon.client_mobile.security.LoginWindow.username=bda
            Host:127.0.0.1:8888
            Origin:http://127.0.0.1:8888
            Referer:http://127.0.0.1:8888/MOON_MOBILE.html?gwt.codesvr=127.0.0.1:9997
            User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22
            
            Query String Parameters
            
            isc_dataFormat:json
            
            Request Payload
            
            {"transactionNum":39,"dataSource":"ui_form_actions","operationType":"update","requestId":"39","showPrompt":null,"data":{"id":52,"companyName_short":"MET","id_type":3,"description":"•","id_prospect_contact":null,"name":"Test","id_prospect":299,"id_person_owners":"[3],[7]","sneak":"id:52","id_person_contributors":""},"oldValues":{"id":52,"companyName_short":"MET","id_type":3,"id_prospect_contact":null,"description":null,"name":"Call Luc Moens","id_prospect":299,"id_person_owners":"[3],[7]","sneak":"id:52","id_person_contributors":""}}
            
            Response Headers
            
            Content-Encoding:gzip
            Content-Length:776
            Content-Type:text/html; charset=utf-8
            Server:Jetty(6.1.x)
            X-Included-Test:true
            X-Included-Test2:true
            Regarding you last note, it is true, looking at the same log in Safari, the bullet appears as • in both cases.
            Last edited by bda@n-side.com; 20 Mar 2013, 23:44.

            Comment


              #7
              The fix was added to 4.0 but not 3.1p. It's now in 3.1p as well.

              Comment


                #8
                Working fine now, many thanks! This one is most welcome!

                Comment

                Working...
                X