Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Event Streams in Action this week in the Java in General forum!

Ron Ang

Greenhorn
+ Follow
since Jan 14, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ron Ang

Hi All, my actual problem was I needed to hard code the path of the image in order to embed it to the e-mail. The problem will occur when I deploy it to other environment and will not be able to access the hard coded path.

However, I already found a solution. I just specified the servlet context path then added the image's location. So it will somewhat look like this.



Thanks all!
7 years ago
I am trying to send an e-mail with an embedded image. I used the approach below rather than using the <img> tag so that the image will immediately appear when email is viewed. When using the <img> tag, the recipient would have only the option to download the image which is not what I need. So, as you can observed, the approach used DataSource fds = new FileDataSource("C:\\images\\jht.gif"); , which actually works but I'm working at a web app. So, we I deploy this to other environments, this would not work. I think I need a relative path but I don't know how. Or other approach that would allow me to do this. Thanks!


credit to http://www.rgagnon.com/javadetails/java-0504.html for the above approach.
7 years ago
Thanks for your answers. Well I am not new to Java. However, from my previous project, we only used Crimson Editor. And for my current project, we will be using Eclipse for Web App Development. So now I am trying to familiarize myself with it. Currently I'm reading "Eclipse for Dummies". I hope it's a good start.
I want to learn in and outs of Eclipse IDE. How do I start?