This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes html:img Taking Different Dynamic SRC Value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:img Taking Different Dynamic SRC Value" Watch "html:img Taking Different Dynamic SRC Value" New topic
Author

html:img Taking Different Dynamic SRC Value

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
Is it possible to use <html:img> to display different pictures depending on the value of some other beans without using EL syntax? The 'src' seems accept a runtime expression but if i dont want to use EL (e.g. with JSP 1.2 container) what else can i use as the runtime expression?

Or would there be a better strategy other than using runtime expression?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
A Scroptlet will work also:

src='<%=mySource%>'


Merrill
Consultant, Sima Solutions
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
Yes, I am thinking too much about script-free page. Sometimes scriptlet can achieve simple things.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: html:img Taking Different Dynamic SRC Value