how can i display an image on browser here i am i am getting image name from date base table. and all images are kept in c:\images directory . At the time of string concatination I am getting syntax error and i tried so many ways but i did not get .
Ramesh, There is more than just a syntax error to watch out for here. The src attribute will be used by the browser to request the actual image. however, the browser cannot access the images directory on your server. It requires a URL beginning with http. This means you need to place the images on a webserver or as part of your web application.
If the images were on the user's machine, the URL would begin with file://c.
I would look at writing a download Action class that extends org.apache.struts.actions.DownloadAction. By doing this, you can create a class that will either get the data directly from the database and output it to the output stream, or get the data from a file outside your web context and output it to the output stream. Once you've done this, you can simply code: