Using IntelliJ IDEA Diagrams to Visualize Java Servlet Inheritance Hierarchy
This tutorial explains how to use IntelliJ IDEA's diagram feature to view, clean up, and explore the inheritance and interface implementation relationships of Java Servlet classes, including removing irrelevant nodes, inspecting class members, adding other classes, and jumping to source code.
Having some free time, I revisited past Java knowledge and, while exploring the Servlet part, used IntelliJ IDEA's diagram tool to clearly visualize the inheritance chain, which I now share.
Viewing the Inheritance Chain in Graphical Form
In the class's editor tab, right‑click and choose Diagrams (either Show for an embedded view or Show ... Popup for a floating window).
You can also right‑click a class in the project tree and select Diagrams for the same result.
The resulting diagram for a custom Servlet looks like the image below.
Key visual cues:
Blue solid arrows indicate inheritance.
Green dashed arrows indicate interface implementation.
Optimizing the Inheritance Diagram to Fit My Needs
2.1 Remove Unwanted Classes
Some nodes, such as Object or Serializable , may be irrelevant. Select them and press the Delete key to clean the diagram.
2.2 Show Detailed Class Information
Right‑click the diagram and choose Show Categories to expand fields, methods, constructors, etc. You can also use the toolbar button for the same purpose.
To filter methods by visibility (e.g., show only protected and above), right‑click and select Change Visibility Level .
Press Alt to activate a magnifier for a closer look at the diagram.
2.3 Add Other Classes to the Diagram
If you need to check relationships with additional classes, choose Add Class to Diagram and type the class name.
For example, adding a Student class shows no arrows, indicating no direct inheritance or interface links with the current set.
2.4 Jump to Specific Source Code
To view the actual source of a class or method, double‑click the class in the diagram, then right‑click the desired method and select Jump to Source .
The Structure tool pane can also list all methods of the selected class for quick navigation.
Conclusion
Using the described IntelliJ IDEA features makes learning and inspecting class relationships—especially for major framework source code—much more comfortable and efficient.
Source: 捡田螺的小男孩
Backend‑Specific Technical Group
Build a high‑quality technical community; developers, recruiting HRs, and anyone willing to share referrals are welcome.
Speak civilly, focusing on technical discussion , job referrals , and industry exploration .
Advertisements and private messages are prohibited; beware of scams.
Add me as a friend and I will invite you to the group.
Selected Java Interview Questions
A professional Java tech channel sharing common knowledge to help developers fill gaps. Follow us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.