How to show and hide a div using jQuery? show(), hide(), and toggle() function Example
Java Revisited
by javin paul
4d ago
So, you have a div element and you want to show or hide them may be on a click or during page load, how do you do that in jQuery? Well, jQuery provides convenient show() and hide() methods which can show or hide an element, including div. All you need to do is, write a jQuery selector to find the div you want to show or hide and then call jQuery function show() or hide() depending upon your requirement. You can also use the toggle() function to switch between showing and hiding. This method will make element visible if its hidden and vice-versa. To select the div you can use either element, id ..read more
Visit website
How to version REST API? URL vs Header Versioning? Example Tutorial
Java Revisited
by javin paul
1w ago
Designing a real world, industry standard RESTful API can be a tricky challenge becuase there is no real standard exists. To add into that, there is also a lot of confusing topics e.g. PUT vs POST for creating and updating resources, or using URL or Header for versioning. There are a lot of advices you will find on internet often confusing and advocating one or other alternative, but it ultimately depends upon your own wisdom and use cases to come up with elegant RESTful URIs, which supports both filtering and versioning. There are both pros and cons of URL versioning and Hypermedia ..read more
Visit website
How to sort a HashMap in Java 8 by keys and values using Stream and Lambda Expressions
Java Revisited
by javin paul
1w ago
Technically, you cannot sort a HashMap in Java because it doesn't guarantee any order. So, even if you add entries in sorted order they will be placed randomly and you won't be able to iterate over map in sorted order of keys or values. Though, if you want to process keys, values or entries of an HashMap in sorted order, you can get the data from the HashMap and then potentially use a TreeMap (when you want to sort a HashMap by key) or LinkedHashMap (when you want to sort a HashMap by value) to store entries in sorted order. This is also the way, we used to sort HashMap before Java 8.  Ja ..read more
Visit website
100+ System Design Interview Questions and Problems for Software Engineers
Java Revisited
by javin paul
3w ago
Hello guys, if you are preparing for System Design interviews then you may know that you have to prepare for theory questions as well as System design problems where you need to design a real world system like WhatsApp, YouTube or DropBox. Theory questions are mostly based upon System design basics and core concepts like Scalability, Caching, database sharding, load balancer, API gateway, security, proxies, messaging queues and software architecture, particularly Microservices. I have been sharing a lot of system design preparation material from last few years, in for example, in the past, I h ..read more
Visit website
How to POST JSON request from Linux to test RESTful Web Services? Example
Java Revisited
by javin paul
1M ago
Even though, Postman is a great tool and chrome plugin to test RESTful Web services for Java developers, I often find myself using "curl" or "cURL" command in Linux for testing RESTful Web Services, particularly Java web services built using Spring or Spring Boot framework. The curl command is easily available on most of Linux hosts and you just need to type a command to sent various types of HTTP requests to your application from Linux command line, as shown here. Though, many RESTful web developer and tester knows this trick, they mainly use GET request to access data from web service and&nb ..read more
Visit website
Top 20 Spring Framework Annotations Java Developers Should Know
Java Revisited
by javin paul
1M ago
Hello guys, annotations are quite important when working in modern Java application as almost all frameworks and libraries nowadays use annotations, including Spring Framework. There was time when we need to remember classes and methods to make effective use of JDK or any open source library but now we also need to remember annotations. For example, to use JUnit you must know about annotations like @Test, @BeforeEach, @AfterEach, @Disabled and so on. Similarly for Spring framework you need to know annotations like @Configuration, @Bean, @Component, @Service, @Value, @Autowired, @Repository, @Q ..read more
Visit website
4 Ways to take Heap dump in Tomcat and Java and 3 Tools to Analyse .hprof files
Java Revisited
by javin paul
1M ago
The heap dump is a great source of information on identifying memory related issues on Java application e.g. web and application servers like Tomcat, WebLogic, JBoss, WebSphere and IDEs like IntelliJIDEA and Eclipse. When you take heap dump all live objects of heap with their count and other details are written into a huge file (the .hprof file) for analysis. The name and location of heap dump file is provided by command you use to take the heap dump. There are many command line tools in JDK e.g. jmap and jcmd which can be used to take the heap dump in Java.  Java, Unix, Tibco RV and FIX ..read more
Visit website
10 Examples of @RequestMapping Annotation in Spring MVC and REST
Java Revisited
by javin paul
2M ago
The @RequestMapping annotation is one of the most important annotation of Spring MVC which provides mapping of HTTP requests to controller methods, I mean Java methods on Controller class for processing. If you wonder, how Spring handles a particular request and which method from controller class is called for a particular request, answer lies on @RequestMapping annotation. This annotation maps web request to methods on controller class. You can apply @RequestMapping on class or method level of your controller. This is a powerful annotation and give you a lot of option to sophistically map a w ..read more
Visit website
10 Things Beginners Should Know to Get Java Developer Job
Java Revisited
by javin paul
2M ago
Hello guys, if you are a beginner looking for a job as Java developer but not sure you should know then you have come to the right place. I get fresh computer engineers from colleges, interns, and new hires, so for the kids fresh out of school, here are some of the things I wish/hope they know. This is not just true for Computer science engineers and IT graduates but also to self-taught developers who have learned coding by themselves by following any YouTube video or joining an online course.  Java, Unix, Tibco RV and FIX Protocol Tutorial ..read more
Visit website
3 ways to solve java.lang.NoClassDefFoundError in Java J2EE
Java Revisited
by javin paul
2M ago
I know how frustrating is to see "Exception in thread "main" java.lang.NoClassDefFoundError" while running your Java application. This is one of the dreaded problem in Java  which is also a manifestation of NoClassDefFoundError in Java. I have seen it a couple of times and spent quite a lot of time initially to figure out what is wrong, which class is missing etc. The first mistake I did was mingling java.lang.ClassNotfoundException and NoClassDefFoundError, in reality, are totally different, and my second mistake was using the trial and error method to solve this java.lang.NoClassDe ..read more
Visit website

Follow Java Revisited on FeedSpot

Continue with Google
Continue with Apple
OR