Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jstl instanceof

 
Rafa Barcel� Bauz�
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I'm trying to change some jsp files from scriplet to jstl and some struts tags.

Now i have a doubt. In a lots of jsp files, appears scriplet code like this:

<% if (process instanceof RemoteProcess) { %>
.
.
.<% } %>

How can i translate this kind of scriplet to jstl code??

Anyone uses a custom developed tag?

Thanks. And sorry for my (still) ugly english!!!
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to write your own tag for this, passing an attribute of the object on which you want to apply the instanceof operator, the basic concept will be to check for the condition in your tag class and execute the body only if returns true. Are you just checking for instance of RemoteProcess? if yes it is pretty easy, else you need another attribute, the class name to test on the object passed, tag class will look ugly in this case.
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Write your own!

See how!

Best of luck ...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds more like something that should be handled in the controller before you even get to the JSP, to me.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!