PhantomJS to screenshot website div for Spring MVC, Tomcat and iText use

帅比萌擦擦* 提交于 2019-12-04 12:19:06

Should I keep trying this path just to get a screenshot of my website? I feel like it's a losing battle based on what's going on.

You are right, I think the approach of managing dependencies needs to be reconsidered, otherwise it will not be possible to make the site work. Donwloading jars manually one by one is unlikely to give good results, as there is no guarantee that the library versions are compatible with each other.

In fact the IncompatibleClassChangeErroris a sign that the jars downloaded are not compatible.

Your best bet is to use Maven to donwload most of the jars automatically. By declaring only the top level jars, Maven will then download the needed dependent jars (transitive dependencies) automatically, helping reduce and in many cases eliminate library incompatibility problems.

Once you have the site up and working, it's a matter of writing some scripts in Casper.js to access a page in your local server, click some buttons to generated PDFs etc. and then take some snapshots.

There is no special integration needed with Spring MVC, for the Spring MVC application it's transparent if the site is accessed by PhantomJS or a normal browser.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!