简体   繁体   中英

How i can print stacktrace from my java class to a servlet

i want to print the stack trace on my jsp page. I am calling a method from my servlet for sending a mail but when some issue occurs it still executes my next line.The next i have called a success page It always goes to that page \\

Use a log framework such as slf4j or log4j instead. Displaying the stack trace in your results is not helpful to the end user and may be a security risk. Catch the appropriate exceptions and log them, or use framework features (as provided by Spring and other frameworks) to automatically log exceptions for you and return an error page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM