Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can you do this in JSP  RSS feed

 
Rod Nichols
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I have some code that looks like this, this is inside a JSP :
<% System.out.println("text more text more text"); %>

This writes to the log file of our Tomcat server.

Is there an equivalent way to do this in a JSP without using scripting ? Maybe using EL or a JSTL ?

Thanks in advance !!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It'd be a snap to write an EL function or custom tag to do so.

Sounds like a great open source project to me! Maybe one that ties into Log4J or Jakarata Commons Logging.

I actually had one of these years ago, but since moving to JSTL/EL and using JSPs properly as mere views, I've found the need for debugging (and hence logging) within them to be negligible.
 
Rod Nichols
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear, thanks again, I thought it might take something like that. This will give me a good excuse to write a custom tag.

Thanks !!

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enjoy!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!