• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

displaying next image on clicking a link

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

My jsp page is having image tag as shown .

<img src="PropertyImage.do?action=image" height="100" width="100" name ="img"/>

Can any one tell me how can i render the next image in the same page with all other details remain same when user clicks on a link say "next"

Thanks & regards
Anuja K
 
anuja Edathu
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ,
i don't want to change the src of <img> tag because i want the same servlet to render next image .

Please help

Regards ,
Anuja Karthikeyan
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

u can achieve this by declaring a imgName jsp variable and refer the imgName as src of the <img tag='<%=imgName%>'/> on click of the next link u write a logic in jsp to change the imgName variables value by this way u r problem is solved....
 
anuja Edathu
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
Sathish jsp displays the first image when it is loaded first time .

when click on link 'next' can i cal a javascript and in than in turn call the servlet from there . I am afraid i am doing this wrongly

<div align="center"><a href="javascript:changeImage();">next</div></td>

function changeImage()
{
document.getElementById("img").src="PropertyImage.do?action=image2";

}

any thought on this will be highly appreciated
Anuja
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic