Jehoshaphat is the king of Judah, and serves God willingly.  He wants to have a relationship with the tribes of Israel, but they do not have a relationship with God.  This leaves him in a compromised position.

And Jehoshaphat the king of Judah returned to his house in peace to Jerusalem.  And Jehu the son of Hanani the seer went out to meet him, and said to king Jehoshaphat, Shouldest thou help the ungodly,  and love them that hate the LORD? therefore is wrath upon thee from before the LORD.  Nevertheless there are good things found in thee, in that thou hast taken away the groves out of the land, and hast prepared thine heart to seek God.  And Jehoshaphat dwelt at Jerusalem: and he went out again through the people from Beersheba to mount Ephraim, and brought them back unto the LORD God of their fathers.  2 Chronicles 19:1-4

While God is disappointed, he is also merciful to this king who desires to do right.  Jehoshaphat recognizes that his opportunity is still alive in the grace of God.  He moves to lead Judah to righteousness.

And he set judges in the land throughout all the fenced cities of Judah, city by city,  And said to the judges, Take heed what ye do: for ye judge not for man, but for the LORD, who is with you in the judgment.  Wherefore now let the fear of the LORD be upon you; take heed and do it: for there is no iniquity with the LORD our God, nor respect of persons, nor taking of gifts.  Moreover in Jerusalem did Jehoshaphat set of the Levites, and of the priests, and of the chief of the fathers of Israel, for the judgment of the LORD, and for controversies, when they returned to Jerusalem.  And he charged them, saying, Thus shall ye do in the fear of the LORD, faithfully, and with a perfect heart.  And what cause soever shall come to you of your brethren that dwell in your cities, between blood and blood, between law and commandment, statutes and judgments, ye shall even warn them that they trespass not against the LORD, and so wrath come upon you, and upon your brethren: this do, and ye shall not trespass.  And, behold, Amariah the chief priest is over you in all matters of the LORD; and Zebadiah the son of Ishmael, the ruler of the house of Judah, for all the king’s matters: also the Levites shall be officers before you. Deal courageously, and the LORD shall be with the good.  2 Chronicles 19:5-11

Jehoshaphat placed judges over local affairs, priests and captains over spiritual and government.  All are charged to be under the Lord in all things.  They are being prepared with the breastplate of righteousness for spiritual warfare.  The dark spirit realm is also preparing it’s armies.  Jehoshaphat knows how to respond.

It came to pass after this also, that the children of Moab, and the children of Ammon, and with them other beside the Ammonites, came against Jehoshaphat to battle.  Then there came some that told Jehoshaphat, saying, There cometh a great multitude against thee from beyond the sea on this side Syria; and, behold, they be in Hazazontamar, which is Engedi.  And Jehoshaphat feared, and set himself to seek the LORD, and proclaimed a fast throughout all Judah.  And Judah gathered themselves together, to ask help of the LORD: even out of all the cities of Judah they came to seek the LORD.  2 Chronicles 20:1-4

A carnal warfare is shaping up, but Judah enters into spiritual warfare to prepare.  Fasting prepares them for prayer and to receive deliverance by faith from God.  Jehosaphat offers no instructions to God, nor any plan of battle, but only reports for further orders.

And Jehoshaphat stood in the congregation of Judah and Jerusalem, in the house of the LORD, before the new court,  And said, O LORD God of our fathers, art not thou God in heaven? and rulest not thou over all the kingdoms of the heathen? and in thine hand is there not power and might, so that none is able to withstand thee?  Art not thou our God, who didst drive out the inhabitants of this land before thy people Israel, and gavest it to the seed of Abraham thy friend for ever?  And they dwelt therein, and have built thee a sanctuary therein for thy name, saying,  If, when evil cometh upon us, as the sword, judgment, or pestilence, or famine, we stand before this house, and in thy presence, (for thy name is in this house,) and cry unto thee in our affliction, then thou wilt hear and help.  0And now, behold, the children of Ammon and Moab and mount Seir, whom thou wouldest not let Israel invade, when they came out of the land of Egypt, but they turned from them, and destroyed them not;  Behold, I say, how they reward us, to come to cast us out of thy possession, which thou hast given us to inherit.  O our God, wilt thou not judge them? for we have no might against this great company that cometh against us; neither know we what to do: but our eyes are upon thee.  2 Chronicles 20:5-12

God promised the land to Israel, so his word is resurrected as assurance of their claim to deliverance.  The people are united in this petition, and a prophet was able to deliver a response from the Lord to them.

And all Judah stood before the LORD, with their little ones, their wives, and their children.  Then upon Jahaziel the son of Zechariah, the son of Benaiah, the son of Jeiel, the son of Mattaniah, a Levite of the sons of Asaph, came the Spirit of the LORD in the midst of the congregation;  And he said, Hearken ye, all Judah, and ye inhabitants of Jerusalem, and thou king Jehoshaphat, Thus saith the LORD unto you, Be not afraid nor dismayed by reason of this great multitude; for the battle is not yours, but God’s.  To morrow go ye down against them: behold, they come up by the cliff of Ziz; and ye shall find them at the end of the brook, before the wilderness of Jeruel.  Ye shall not need to fight in this battle: set yourselves, stand ye still, and see the salvation of the LORD with you, O Judah and Jerusalem: fear not, nor be dismayed; to morrow go out against them: for the LORD will be with you.  And Jehoshaphat bowed his head with his face to the ground: and all Judah and the inhabitants of Jerusalem fell before the LORD, worshipping the LORD.  And the Levites, of the children of the Kohathites, and of the children of the Korhites, stood up to praise the LORD God of Israel with a loud voice on high.  2 Chronicles 20:12-19

Their orders to battle are just to have a seat in the balcony and watch the show, as God will fight the battle.  Jehoshaphat further exhorts them to stand in faith in God.

And they rose early in the morning, and went forth into the wilderness of Tekoa: and as they went forth, Jehoshaphat stood and said, Hear me, O Judah, and ye inhabitants of Jerusalem; Believe in the LORD your God, so shall ye be established; believe his prophets, so shall ye prosper.  And when he had consulted with the people, he appointed singers unto the LORD, and that should praise the beauty of holiness, as they went out before the army, and to say, Praise the LORD; for his mercy endureth for ever.  And when they began to sing and to praise, the LORD set ambushments against the children of Ammon, Moab, and mount Seir, which were come against Judah; and they were smitten.  For the children of Ammon and Moab stood up against the inhabitants of mount Seir, utterly to slay and destroy them: and when they had made an end of the inhabitants of Seir, every one helped to destroy another.  2 Chronicles 20:20-23

I have had nightmares where I was able to remember to call on the Lord and rebuke the enemy.  If we can take charge and find victory in our dreams, we can do the same in our real life.  When the army of Judah began to praise God, he honored that with the victory.  Nightmares are about fear, and with enough encouragement to trust God we can manage fear in our sleep and in our daytime battles as well.  We need to be trained to do spiritual warfare.  In this story the spirits of darkness turned away from Judah and turned against the host of their enemies.  Fear begets madness and that turned the axis of darkness against itself.  Faith is our ally, and fear is our enemy.  Let our enemies have their father of lies, and they will destroy each other.

And when Judah came toward the watch tower in the wilderness, they looked unto the multitude, and, behold, they were dead bodies fallen to the earth, and none escaped.  And when Jehoshaphat and his people came to take away the spoil of them, they found among them in abundance both riches with the dead bodies, and precious jewels, which they stripped off for themselves, more than they could carry away: and they were three days in gathering of the spoil, it was so much.  And on the fourth day they assembled themselves in the valley of Berachah; for there they blessed the LORD: therefore the name of the same place was called, The valley of Berachah, unto this day.  2 Chronicles 20:24-26

The enemies of Israel had probably looted other cities along the path of their warfare.  So when Judah found them dead, they also found the wealth of nations among them.  They had gained peace, security, wealth, and more evidence of God’s faithfulness.  The nations around them also came to fear the Lord from this.

Then they returned, every man of Judah and Jerusalem, and Jehoshaphat in the forefront of them, to go again to Jerusalem with joy; for the LORD had made them to rejoice over their enemies.  And they came to Jerusalem with psalteries and harps and trumpets unto the house of the LORD.  And the fear of God was on all the kingdoms of those countries, when they had heard that the LORD fought against the enemies of Israel.  So the realm of Jehoshaphat was quiet: for his God gave him rest round about.  2 Chronicles 20:27-30

As Jehoshaphat learns to trust God more than alliances or worldly wisdom, he has found the grace and power of God.  If he has not completed the reform of worship completely he has seen this evidence for obedience and faith in God.

And Jehoshaphat reigned over Judah: he was thirty and five years old when he began to reign, and he reigned twenty and five years in Jerusalem. And his mother’s name was Azubah the daughter of Shilhi.  And he walked in the way of Asa his father, and departed not from it, doing that which was right in the sight of the LORD.  Howbeit the high places were not taken away: for as yet the people had not prepared their hearts unto the God of their fathers.  Now the rest of the acts of Jehoshaphat, first and last, behold, they are written in the book of Jehu the son of Hanani, who is mentioned in the book of the kings of Israel.  And after this did Jehoshaphat king of Judah join himself with Ahaziah king of Israel, who did very wickedly:  And he joined himself with him to make ships to go to Tarshish: and they made the ships in Eziongaber.  Then Eliezer the son of Dodavah of Mareshah prophesied against Jehoshaphat, saying, Because thou hast joined thyself with Ahaziah, the LORD hath broken thy works. And the ships were broken, that they were not able to go to Tarshish.  1-37

One last time Jehoshaphat has turned to an alliance with the backslidden king of Israel.  He has one last reminder that God does not approve, as his fleet is destroyed.  This is human nature, to return to our failure as a dog returns to his vomit.  We need to look beyond nature to find the supernatural help that we need.  Flesh will always fail while Yeshua will always offer the way of deliverance to the repentant.  We have to ask for help, as he seeks “whosoever will”, the willing.  He doesn’t need our skill or ability, only our willingness to trust him.  He is our source.