• Register
0 votes
26 views

I am a beginner java developer and developing a java program that returns a plain output text file on a browser specifically. Because the program is running on a server.

Whenever something goes wrong I just need to show this following ASCII Art-

¯\_(ツ)_/¯

I have tried using BufferedStreamOutput:

errorOutput.writeln("##################################\n"
                    + "#####       Error Output     ######\n"
                    + "#####       ¯\\_(ツ)_/¯       ######\n"
                    + "##################################\n");

 

The problem is when I look into the output text file I get the following: 

##################################
#####       Error Output    ######
#####       ¯\_(ツ)_/¯       ######
##################################

How can I solve this problem using java?

6 2
830 points

1 Answer

0 votes

This can solved in a couple of ways I have tried in a fancy way to solve this problem.

Solved using the following code snippets:

    @GET
    @Path("getError/{idApp}")
    @Produces("text/html; charset=UTF-8")  //specify that you are printing UTF-8 as output format

    public Response getError(@PathParam("idApp") Integer idApp) {
        return super.getError(jobsMap.get(idApp));
    }

    
    return Response.ok(job.getError(), "text/plain; charset=UTF-8").build();

 

4 1
1,480 points

Related questions

1 vote
1 answer 103 views
103 views
Problem : I am trying to find solution for following error replace any space ' ' by '_' in 2-character string passcode. sample output for the given program:
asked Nov 11, 2019 peterlaw 6.9k points
0 votes
1 answer 16 views
16 views
Problem: Words that have a special meaning in a programming language are called?
asked Jul 21 HenryL 620 points
0 votes
1 answer 2 views
2 views
I know that the HTML is a language but can it be considered in the programming language? Can I write HTML as my programming language under my professional resume?
asked Oct 9 sikandar 2.4k points
1 vote
1 answer 19 views
19 views
Problem: Is a programming language that can be used to create a wide range of windows applications?
asked Mar 23 ArifulIslam 5.7k points
0 votes
1 answer 44 views
44 views
Problem: What best defines a programming language?
asked Mar 9 ArifulIslam 5.7k points