Reputation: 145
Which is the quickest way to check the presence of Struts runtime from a Java class?
Upvotes: 2
Views: 93
Reputation: 533790
Try loading or using a class you need. If its not there, it will throw a ClassNotFoundException
or NoClassDefFoundError
respectively.
Upvotes: 0
Reputation: 7899
As Peter mentioned you can try to load org.apache.struts.action.RequestProcessor
using Class.forName("org.apache.struts.action.RequestProcessor")
if it throws ClassNotFoundException
then Struts is not present.
Upvotes: 1