How can we use the value of the process data (e.g. in.umxm) in a JSP?

if (%> <%= ivy.html.get("in.umxm")%>  <%) {%><br/>
  A<br/>
<%} else {%><br/>
  B<br/>
<%}%>

asked 03.10.2013 at 05:31

Stefan%20Kressig's gravatar image

Stefan Kressig
(suspended)
accept rate: 0%


You use correctly ivy.html.get() but this is normal Java Code. Therefore you can put it into the same JSP tag like the if. Note that ivy.html.get() returns a String.

The JSP tag with the equals sign <%= ... %> is only required if you want to display the return value of a JSP expression in the HTML page.

 <%> if ( "true".equals(ivy.html.get("in.umxm")) { %>
   A
 <%} else {%>
   B
 <%}%>
link

answered 04.10.2013 at 06:07

Dominik%20Regli's gravatar image

Dominik Regli ♦
(suspended)
accept rate: 85%

Das hat einwandfrei geklappt.
Vielen Dank für die rasche Hilfe Dominik

Hallo Stefan

Dein Ansatz ist korrekt, du hast lediglich einen kleinen Fehler in der Syntax.
So sollte es gehen:


<%> if ( "true".equals(ivy.html.get("in.umxm")) { %>
A
<%} else {%>
B
<%}%>


ivy.html.get() ist normaler Java Code. Diesen kannst du in das gleiche JSP Tag wie bereits das if nehmen. Beachte aber, dass ivy.html.get() einen String zurückliefert.
Das JSP Tag mit dem Gleichheitszeichen <%= ... %> brauchst du nur, wenn du den Rückgabewert der Expression in das HTML ausgeben willst. Im unserem Fall ist das nicht nötig.

Viele Grüsse
Dominik

(04.10.2013 at 08:32) Dominik Regli ♦ Dominik%20Regli's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×11
×7

Asked: 03.10.2013 at 05:31

Seen: 2,820 times

Last updated: 17.09.2014 at 16:26