It is very evident that the just live, as subjects of the divine Sovereign, not only by praying but by being answered. And in either case, according to the Scripture representation, the principal or inspiring element of the inward life, whether a person prays or is answered in prayer, is faith. Any other view will probably be found, on close examination, to be inconsistent with the doctrine of living by faith.
Accordingly, on the true doctrine of holy living, viz. by faith, we go to God in the exercise of faith, believing that he will hear; and we return from him in the exercise of the same faith, believing that he has heard; and that the answer exists and is registered in the divine mind, although we do not know what it is, and perhaps shall never be permitted to know. And in accordance with these views, if, in a given case, we know from the word of God that the petition is agreeable to the divine will, and that it is also agreeable to the divine will that it should be granted now, then the doctrine of faith will require us to believe, that the divine decision is made up and is given, and that we do now have the things which we sought for, although they may come in a different way, and with a different appearance from what we anticipated.
And, on the other hand, if the word of God has not revealed to us the divine will, the doctrine of faith still requires us to believe that the true answer exists in the will of God; that the decision of God is made up as in the other case, whatever that decision may be, and whenever and wherever it may be visibly accomplished. In both cases we have need of faith; we believe that God is either now doing, or that he will do. So that the true answer to prayer, as it seems to us, is an answer resting upon the revealed declaration or word of God for its basis, and made available to us in any given case by an act of faith. God promises that he will answer. Faith, accepting the declaration, recognizes the answer, whether it be known or unknown, as actually given in every case, where it can justly be expected to be given.
— edited from The Interior or Hidden Life (2nd edition 1844) Part 3, Chapter 9.