Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

print server time

 
Brian Percival
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I print server time in a jsp??
Do we have any implicit objects to access this?
I am using jstl and el.

thanks
Brian
[ October 19, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Brian Percival
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear,

Using a Bean just didn't make sense, butI guess there is no other way.
 
Brian Percival
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just a correction, 'var' should be 'id'
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Percival:

Using a Bean just didn't make sense, butI guess there is no other way.

Why not? The EL is designed to work with beans. They are an integral part of the whole JSTL/EL concept.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Percival:
just a correction, 'var' should be 'id'

Indeed... slipped into JSTL syntax by mistake.
 
Brian Percival
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear,

you are right.. jstl/el is designed to work with Beans. But useBean ussage would mean, we need to have extra knowledge of knowing if a class fits the Bean rules.

I would rather be comfortable somehow using c:set and then accessing the values I want.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Percival:
you are right.. jstl/el is designed to work with Beans. But useBean ussage would mean, we need to have extra knowledge of knowing if a class fits the Bean rules.
I don't get the point,. This applies no matter how the bean gets instantiated. If it's going to be a scoped variable accessible by the EL, it must be a bean.

I would rather be comfortable somehow using c:set and then accessing the values I want.
<c:set> has no means to cause a bean to become instantiated as that is not its purpose. That's what <jsp:useBean> is for.

If you'd rather not use <jsp:useBean> on a page for whatever reason (which I still don't get), instatiate the bean in the servlet controller and set it as a scoped variable prior to forwarding to the page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic