Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 876301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:24:42+00:00 2026-05-15T11:24:42+00:00

I am using sun.misc.BASE64Encoder to encode an encrypted value, which is then added to

  • 0

I am using sun.misc.BASE64Encoder to encode an encrypted value, which is then added to a JSON field and subsequently sent to the client. I use Javascript’s eval() function on the client to create an object from the JSON code. When eval() runs, it gives the error:

unterminated string literal

There are other fields in the JSON code, but I’ve narrowed the error specifically to the base64 encoded field. Here’s the offending line of javascript code:

var result = eval( '(' + xhr.responseText + ')' ); 

Here’s the JSON object from the Servlet:

{
  'resource':'resource?Signature=j79r/2Hly+HqhS/6fdd+prfsR+kUNijUvDN0QJ14ZR43gzYScOMDypt/crks/CEphTUXVptJvSol
1ZOOvScCUhNOCb7dZk/3MKnI5tOewSACXK32/OJNd8hYpZtSTn+WhA6+f9BUIUZWA83U8Cud/Tb8V
R1yQWbDGG/mM/NiUSiY=', 

'url':'http://somesite.com/pr'
}

I’m not sure why eval is dying, but it seems the value of the ‘resource’ JSON field contains something it doesn’t care for.

Thanks in advance.
Tim

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:24:43+00:00Added an answer on May 15, 2026 at 11:24 am

    I think it may be because your JSON appears to have line breaks in it. If you remove them, does it work?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the encode() method from the sun.misc.BASE64Encoder package. How do I suppress the
I've been using the BASE64Encoder and BASE64Decoder in sun.misc ; I'm using Eclipse and
I am trying to allocate memory using sun.misc.Unsafe.allocateMemory() and access it in native code.
Using Sun Glassfish Enterprise server v2.1.1 I am using alternatedocroot via sun-web.xml for my
I am new to Unix and am using sun solaris (v10 I think). I
Using the stock Sun 1.6 compiler and JRE/JIT, is it a good idea to
I am using http://java.sun.com/jsp/jstl/fmt tag library for outputting messages from Message Resource Bundle which
Using IE 7, JDK 1.6 and Sun Web server 7. Inside the jsp form,
I am using PHP 5.2 on SUN OS server. Having problems with the following
I found this Is Sun Java really necessary for using Android SDK on Ubuntu

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.