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

Syntax

 
Erik Pragt
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
I have a small question: is something like this possible in a jsp, and if not, is there an other solution?
[code]
<HTML>
<BODY>
<% if(variable.equals(<jsp:getProperty name="Name" property="test" /> )) execute this...
%>
</BODY>
</HTML>

I hope that you know what I mean by this.
Please note that replacing the <jsp:getPropery> tag by Name.getTest() is not an option.
Greetings, Erik
[ January 23, 2002: Message edited by: Erik Pragt ]
[ January 23, 2002: Message edited by: Erik Pragt ]
[ January 23, 2002: Message edited by: Erik Pragt ]
 
rom chatterjee
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Erik
This is almost right. Quick bit of background jsp syntax is based on XML. Anything that is between <% %> tags is known to be java. Everything else is treated equally. The <jsp:getProperty.. /> is XML notation for a java call.
To correct your code you need to jump into the java conditional with <% then jump out %> to do the XML style <jsp:getProperty... /> tag then go back to the java <% to continue and finally %> back to the HTML

Hope this helps
 
Tim Holloway
Bartender
Posts: 18419
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or, if you prefer, you can make the code slightly cleaner by using the Java equivalent for <jsp:getProperty>

[ January 24, 2002: Message edited by: Tim Holloway ]
 
Erik Pragt
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both, thanks for replying, and Rom, thanks for your solution, I hope this will help me in my ORA loop.
Greetings, Erik
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!