Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 value append while using s:text

 
Aaron Raja
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I try to show image in jsp page.
Following code work .


Now I want to show image based on userImageFileName
I want to show image dynamically based on userImageFileName, this value chage for each user.
Value it pass is correct. eg smith123.jpg, smith 234.jpg something like this
but it won't work when I try to append value


tried this too but no luck
 
Jesus Mireles
Ranch Hand
Posts: 122
IntelliJ IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what the best solution is as of course there are more than one ... but I think you can do something like:



I actually just checked an old project on how I solved this. Basically what I did was that I built the location of in the action controller. Basically the location and image name was in the database and then there was a getter for my property ... my JSP then had:


 
Aaron Raja
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks IT work
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic