Win a copy of Microservices in Action this week in the Web Services forum!

Steve Dyke

Ranch Hand
+ Follow
since Nov 16, 2004
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
7
Received in last 30 days
0
Total given
11
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Steve Dyke

I have discovered that any line that starts with a " or ends with "" will print the extra "".

So I have appended a space before and after in such cases and the problem is solved.
4 days ago

Dave Tolls wrote:

I think the actual root problem is how you are turning data in your database into a JSON String.

I think I asked this before, but can't see an answer in the thread, but how are you creating the JSON from the data in your database?



Sorry I got pulled on a different project but still having issues with this.

This is the code for note2: then the compile string that concatenates all the string together:

4 days ago
I have an input element in one container that has a keyup event bound to it.

In the process another container displays a list. When a user selects a list element the input in the first container is populated.

I would like to do a trigger that would programmatically press the enter key.

Every thing works fine except the trigger.

Here is the function that starts the request:



Here is the first container:



Here is the trigger code:

Ron McLeod wrote:It looks like the server-side is having problems dealing with the user name provided by the client.

In your case, it appears like the server had an issue with the user name provided by the client, and aborted the log-in procedure.
Check the log for the server-side to see if it provides any clues.



When running from my local host the server log shows user name but when I try from the production server the same code shows a blank user name in the log.
4 weeks ago
We switched a server on which a label generating software is installed.

My web app FTP's a file into a watched folder of that server.

My connection call works fine while running on my local host but fails when I deploy it to the production server.

If I switch back to old server it works also even when running from production environment.

1 month ago

Dave Tolls wrote:So, if you don't do that conversion you see the string OK in jQGrid?
But it's when you display it in a JLabel (or something) that it goes wrong?

Again, this is without the conversion code you showed...what goes wrong when you do not do that?
What do you see that you should not see?



If I store the data as Name: SEAT ASSY  TYPE: "A" "SF" and then try to display in jQgrid I get this:



So I am convinced that I need to store as Name: SEAT ASSY  TYPE: \"A\" \"SF\" to at least get the jQgrid display to work.

When JSON is used to send to print routine each string is wrapped in quotes. For what ever reason if the string contains quotes the end wrapper quote is printed
thus I get a label as   Name: SEAT ASSY  TYPE: "A" "SF""
1 month ago
Sorry should be:
Two print the string on a label using JSON
1 month ago

Dave Tolls wrote:OK, now I'm confused.
Why exactly are you trying to turn the escaped quotes in this String into two lots of double quotes?

That will not fix the broken Json.

Indeed, it is the cause of the broken Json.



I have two challenges. One is to display the string in a jQgrid using JSON. Two print the string on a label using jQgrid.

So storing the string as NAME: DIVAN 2 PAX TYPE: \"A\" \"SF\" causes it to display in the grid correctly as NAME: DIVAN 2 PAX TYPE: "A" "SF"

However the printing as I showed earlier prints an extra double quote at the end of the string.
1 month ago

Dave Tolls wrote:Can I suggest logging the fieldValue before you make any edits to it, and then after.
Not what appears in the tag.
Just what values htis bit of code is dealing with, so straight from your logs.



Thank you for taking time to help me with this.



Console out:
[11/13/18 7:54:47:334 CST] 0000009e SystemOut     O AbstractLabelCompiler: pre_note2(from data source): NAME: DIVAN 2 PAX TYPE: \"A\" \"SF\"
[11/13/18 7:54:47:334 CST] 0000009e SystemOut     O AbstractLabelCompiler: note2(first translation): "NAME: DIVAN 2 PAX TYPE: \"A\" \"SF\""
[11/13/18 7:54:47:334 CST] 0000009e SystemOut     O AbstractLabelCompiler: note2(second translation): "NAME: DIVAN 2 PAX TYPE: ""A"" ""SF"""
1 month ago

Dave Tolls wrote:This:
"NAME: DIVAN 2 PAX TYPE: ""A"""
contains a couple of escaped double quotes.
So the actual String is:
NAME: DIVAN 2 PAX TYPE: "A"

Looks like the translation process is failing to handle those escapes.



This is the string from the database I need to translate:
NAME: DIVAN 2 PAX TYPE: \"A\" \"SF\"

This is the translation code:


This is what is printed on the tag:
NAME: DIVAN 2 PAX TYPE: "A" "SF""
1 month ago

Dave Tolls wrote:So what is creating the JSON?
What is populating that fieldValue field?



Here is my connection code that save the string to the database:

1 month ago

Dave Tolls wrote:So what is creating the JSON?
What is populating that fieldValue field?



A process within the app. It runs an SQL connection an creates the JSON.

Here is the compiled string when the database filed is like \"A\"

But on the printed placard I have like this "A""(an extra ")

1 month ago

Dave Tolls wrote:What service is this coming from?
As Ron says, it's the provider that needs fixing if (and it is an if) this is how it is being sent out.

How are you getting the String?



I have a java web app with an interface to a remote database. Call/Send data using SQL. In this interface I type in a string of data,
click submit and this string is sent to the data base field. This is done for several fields. Then I click a print icon
and the tag prints out of a Zebra printer. So the string I type in to send to the database field is like such:
TYPE: "A" "SF" which works as expected. However, when I use this data to populate a jQgrid I get the syntax error unless
I go into the database manually and replace the " with \" as suggested here.

Now there should be a way to initially send the string to the database with the proper syntax:

So the user types in this string TYPE: "A" "SF" and before the string is sent to the database is converts it to
TYPE: \"A\" \"SF\"

I have tried to use this code but it does not work as expected

1 month ago

Ron McLeod wrote:

Steve Dyke wrote:Can this be corrected with a replaceAll method?


Maybe - but it should be fixed whatever is providing the information, not on the consumer-side.  Shouldn't the information actually be something like: NAME: DIVAN 2 PAX TYPE: ASF ?



No this is an FAA Tag and must have the verbiage TYPE: "A" "SF"

The remote data is populated from a java web app interface. So when I write the data I need to set it up that the " get replaced by \"
This is what I expected to work but only " is written. Please help with syntax.

1 month ago

Ron McLeod wrote:It looks like the data that you are being provided is malformed.  The value in line 28 has includes quotation marks which were not properly escaped.



Can this be corrected with a replaceAll method?

1 month ago