In my project users upload image files which are saved outside the context root in the drives. I need to show these images in a jsp. I use struts2. Any help will be appreciated.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Take a look to this tutorial. I think that is exactly what you are looking for.
Edit:
The idea is to tell the action what image you want. That is done adding a parameter in the request. In the example, for instance, it is use the parameter
imageIdbut you can change this strategy and use a different thing, like the image name. Then you should call the action in this way (according to the tutorial):Also, take in mind the @Dave Newton’s comment as a very good alternative. See this other example for that.