cancel
Showing results for 
Search instead for 
Did you mean: 

URL Validator

Former Member
0 Kudos

Hi Experts,

I had downloaded common validator from http://www.java2s.com/Code/Jar/ABC/Downloadcommonsvalidator131jar.htm and imported to my project library.

private boolean ValidateUrl(){

IWDMessageManager manager = wdComponentAPI.getMessageManager();

UrlValidator urlValidator = new UrlValidator();

boolean urlOK;

//valid URL

if (urlValidator.isValid("http://www.mkyong.com")) {

manager.reportSuccess("url is valid");

urlOK = true;

} else {

manager.reportException("url is invalid", true);

urlOK = false;

}

return urlOK;

}

However at runtime, i get the error:

The initial exception that caused the request to fail, was:

java.lang.NoClassDefFoundError: org/apache/commons/validator/UrlValidator

at com.emi.AddNewItemView.ValidateUrl(AddNewItemView.java:878)

What could it be the cause of error? Is the common validator supported by SAP NetWeaver?

Thanks & Regards,

Lai

Accepted Solutions (0)

Answers (2)

Answers (2)

Qualiture
Active Contributor
0 Kudos

Hi,

It's best practice to store external jars in an External Library which can be referenced in your Web Dynpro application.

See http://help.sap.com/saphelp_nw70/helpdata/en/5a/2e2f4234135433e10000000a155106/frameset.htm for more info

Former Member
0 Kudos

Hi

Did you imported files into lib folder under project folder and added jars from project settings?