At first sight your question seems very simple, but it has behind it a lot of important issues. The "means justifying the end" is probably the more commonly experienced phrase and means that for the purposes of achieving a desired outcome (or end), the means, even if wrong or inappropriate, maybe overlooked or excused if the outcome can be seen to be justified. This thinking is used to justify most "activist" activity, and many acts by Nation States, because of the greater good for the population. EG if someone is a spy, they won't be very successful if someone asks them what they do and they admit they are a spy. So they lie, and say they are something else.
I think the phrase "the means justifying the end" is much less common because it is much closer to what we think of as decent morality. IE do what is right, and even if the outcome is not good, it has to be accepted as it is better to behave right, than achieve an aim. This is very much the core of God's message in the bible. Do right, not achieve right. Take this verse as an example: [color=009900]2 Timothy 3:12 Yea, and all that will live godly in Christ Jesus shall suffer persecution.[/color] The outcome (or end) of living godly will be persecution. Not a pleasent outcome, but God still expects us to live godly. The reason it is right, is that in the end God will stand besides those that live the way he wants. Our Lord is the classic example. He lived a godly life, and was still crucified (not a good outcome, but justified by the means of His sinless life), but God raised Him from the dead and He is now seated at His Father's right hand. I hope this gives the connection to the salvation message.
It's late here so my thinking isn't as clear as it ought to be. Hope this helps.
Really, really good question!
Mike