• Register
0 votes
28 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

Please log in or register to answer this question.

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();

 

5 2
1,480 points

Related questions

0 votes
1 answer 4 views
4 views
I need to read a large text file of around 5-6 GB line by line using Java. How can I do this quickly?
asked Dec 17, 2020 TeamScript 9.9k points
1 vote
1 answer 111 views
111 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 73 views
73 views
Problem: Words that have a special meaning in a programming language are called?
asked Jul 21, 2020 HenryL 620 points
0 votes
1 answer 5 views
5 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, 2020 sikandar 2.4k points
1 vote
1 answer 56 views
56 views
Problem: Is a programming language that can be used to create a wide range of windows applications?
asked Mar 23, 2020 ArifulIslam 5.6k points
0 votes
1 answer 89 views
89 views
Problem: What best defines a programming language?
asked Mar 9, 2020 ArifulIslam 5.6k points
0 votes
2 answers 720 views
720 views
Problem: Can anyone help it was actually asked in exam as following: Translating an algorithm into a programming language is called ________? A) interpreting B) compiling C) coding D) executing
asked Feb 18, 2020 maddi86 5.4k points
0 votes
1 answer 5 views
5 views
Problem: I have a project that requires me to display any text file that I browse into my page. How to do this using javascript?
asked Nov 4, 2020 robin_gallo 420 points
0 votes
2 answers 71 views
71 views
Problems: I am new, I need help, can anyone help me? Applications on the android os are mostly written in what programming language?
asked Feb 14, 2020 maddi86 5.4k points
0 votes
1 answer 8 views
8 views
Help me by solving this problem.
asked Dec 30, 2020 TeamScript 9.9k points