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

1 vote
1 answer 144 views
144 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 12 views
0 votes
1 answer 4 views
4 views
Problem: I have use plain password every where. is this good or bad? Plese help me to know.
asked Mar 7 Shovo210 14k points
0 votes
1 answer 3 views
3 views
Problem: I'll make a submission for a response to my question. Please, I have searched the internet but have not found any useful material, and I am now having trouble continuing my studies.
asked Mar 29 tuhin1 48.9k points
0 votes
1 answer 176 views
176 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 2 views
2 views
Problem: What are my options for dealing with this issue? how to display html tags as plain text
asked 5 days ago tuhin1 48.9k points
1 vote
1 answer 119 views
119 views
Problem : I am getting mime type error because its mime type ('text/plain') is not executable, and strict mime type checking is enabled.
asked Nov 11, 2019 peterlaw 6.9k points
0 votes
1 answer 3 views
3 views
Problem: i don’t understand about this problem please help? sql server write output to text file
asked Apr 2 Rohit kr 16.2k points
0 votes
1 answer 3 views
3 views
Problem: Getting error with the following. C++ output to text file.
asked Mar 28 Nomio555 23.3k points
0 votes
1 answer 15 views
15 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 13.5k points