The type javax.validation.Payload cannot be resolved. or java.lang.ClassNotFoundException: javax.validation.Validation


If you get the following error using your IDE

The type javax.validation.Payload cannot be resolved. It is indirectly references from required .class files

or getting the following exception

nested exception is java.lang.ClassNotFoundException: javax.validation.Validation

You need to download the following jar validation-api-1.0.0.GA

Download

 

How to disable and enable button using jQuery


If you want to disable a button use the following code snippets;

1.solution

<input id="submit" type="submit" value="Submit"  onclick="doPost()"/>
$('#submit').attr('disabled', 'disabled');

2.solution

<input id="submit" type="submit" value="Submit"  onclick="doPost()"/>
$('input[type="submit"]').attr('disabled','disabled');

And if you want to enable button using jQuery apply the following code;

$('#submit').removeAttr('disabled');

How to access HTML form elements’ values using jQuery


Use the following code example to access form element values;

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>jQueryExample</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"> </script>
<script type="text/javascript">
$(document).ready(function(){
$('#myForm').submit(function() {
var v_username = $('#username').attr('value');
var v_password = $('#password').attr('value');
//alert('username ==> ' + v_username);
//alert('password ==> ' + v_password);
$('#info').html("<font size=\"7\"><b>" + "#Information#" + "</b></font>").show().fadeOut(5000);
$('#span_username').html("<font size=\"5\" color=\"green\"><b> username ==> " + v_username + "</b></font>").show().fadeOut(5000);
$('#span_password').html("<font size=\"5\" color=\"red\"><b> password ==> " + v_password + "</b></font>").show().fadeOut(5000);
return false;
});
});
</script>
</head>
<body bgcolor="#AACCDD">
<h1><b>Form Element Access jQuery</b></h1>
<form id="myForm" method="post">
<table>
<tr><td><b>Username:</b></td><td><input size="50" id="username" type="text" value="tuna"/></td></tr>
<tr><td><b>Password:</b></td><td><input size="50" id="password" type="text" value="123456"/></td></tr>
<tr><td colspan="2"><input id="button" type="submit" value="Submit"/><br/><br/></td></tr>
<tr><td colspan="2"><span id="info"></span></td></tr>
<tr><td colspan="2"><span id="span_username"></span></td></tr>
<tr><td colspan="2"><span id="span_password"></span></td></tr>
</table>
</form>
</body>
</html>

How to call a jQuery Function after page (document) load


Friends the following udemy course created by me;

      Click here to attend Spring Framework 4.x and certification course with a discount

Spring Framework and Core Spring Certification Udemy course with discount
Spring Framework and Core Spring Certification Udemy course with a discount coupon

If you want to call a function after the whole html document loaded, you can use the following example;

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>jQueryExample</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
 $(document).ready(function () {
 alert('after page load...');
 $('#afterLoad').html('This Content is updated after page load!');
 });
</script>
</head>
<body>
 <h2>After Page Load Function Call</h2>
 <b>Static Page Content </b><br/>
 <br/>
 <b>Dynamic content;</b><br/>

 <h1><b><span id="afterLoad" style="color:green;"></span></b></h1>
</body>
</html>

Here is the screen shot for this example;
Before loading

After loaded

How to solve Does your handler implement a supported interface like Controller? exception


      Click here to attend Spring Framework 4.x and certification course with a discount

If you get the following exception after adding the

<mvc:view-controller path=”/index.htm” view-name=”index”/>

tag inside Spring’s framework configuration file, you need to add another tag like;

<mvc:annotation-driven />

this will activate your annotations for the Spring Project.

javax.servlet.ServletException: No adapter for handler controller.TestController@1854b38]: Does your handler implement a supported interface like Controller? org.springframework.web.servlet.DispatcherServlet.getHandlerAdapter(DispatcherServlet.java:967) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:760) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:669) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:574) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Invalid property ‘messageConverters’ of bean class [org.springframework.web.servlet.mvc.annotation.Annotation


      Click here to attend Spring Framework 4.x and certification course with a discount

If you get the following error while using Spring Framework just replace the old spring-webmvc-oldversion.jar s to at least

spring-webmvc-3.0.6.RELEASE.jar 

Click to download 

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0’: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property ‘messageConverters’ of bean class [org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter]:

How to configure the hot deployment (publishing) for Apache Tomcat on Eclipse IDE


If you want to change the default deployment of Eclipse Apache Tomcat configuration;

Just follow the following procedure on Eclipse IDE;

Firstly, just click on Apache Tomcat Icon under Servers View

Secondly, from the Server Configuration windows just change the hot deployment property like the following one;

You can choose under the Publishing tab such as Never publish automatically which will prevent Eclipse publishing whenever you make a change on the Java source files.