• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Struts and how to insert a bean-value into a attribute

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am using Struts 1.0.2 and have problems to stay complete xml-conform.
I have to change some code into XML format, but I need some help.
Is there any tutorial with xml-comform JSP code ?
what can I do to fill an attribute like "alt" within <img > with conglomerated elements ?
With xml-nonconform code would it be :
<%
String filename = "abc.txt";
%>
<img alt="download this <%filename%>" />
I can use <jsp eclaration> for the the 1st part, but how to combine the stuff ?
thanks a lot for any useful idea...
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use <jsp:expression>expression</jsp:expression> (=<%= expression %>
or <jsp:text>text</jsp:text>
Another alternative would be to use JSTL (<c ut>
Hope this helps
Jesse
 
Kai Unewisse
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jesse Beaumont:
Use <jsp:expression>expression</jsp:expression> (=<%= expression %>
or <jsp:text>text</jsp:text>



But I can't say <img alt="download this <jsp:expression>filename</jsp:expression>" /> ??
Can you give me an example ?
Thank you,
Kai
 
Jesse Beaumont
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a sample:

It's a little more complicated than <%= filename%>
Hope that helps.
Jesse
 
Jesse Beaumont
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doh. Correction to the above. The < in the img and > after it should be &lt; and $amp;gt;
Sorry about that... (curse the interpreter...)
Jesse
reply
    Bookmark Topic Watch Topic
  • New Topic