Hey everyone! I’m new to Java and I’ve started working on a project using Spring Boot and Hibernate. I’ve made some progress with the backend, but now I’m stuck on the frontend part. Can anyone suggest a simple way to create a basic frontend for my app? I’m not looking for anything fancy, just something that works.
Here’s a snippet of my main model class:
@Entity
@Table(name = "user")
public class User extends BaseEntity {
@Column
private String name;
@Column
private String email;
@Column
private UserRole role;
@Column
private Long profileId;
// Getters and setters
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
// More getters and setters...
}
Any tips or resources would be super helpful. Thanks in advance!
For a straightforward frontend solution, you might want to explore using Spring MVC with JSP (JavaServer Pages). This approach integrates seamlessly with your existing Spring Boot setup and allows you to create dynamic web pages easily. Start by adding the necessary dependencies to your pom.xml file, then create JSP files in the src/main/webapp/WEB-INF/views directory. You can use JSTL tags to display data from your model and handle form submissions. This method provides a good balance between simplicity and functionality, especially for developers already familiar with Java. Remember to configure your ViewResolver in your application properties to point to your JSP files.
ooh, have you considered using Vue.js? it’s super lightweight and plays nicely with Spring Boot. you could start with a simple form to add/edit users, then maybe a table to display them? just curious, what kinda features are you hoping to include in your frontend? sounds like an exciting project!
hey there! for a quick frontend, u could try thymeleaf. it’s pretty easy to use with spring boot. just add the dependency, make some html templates, and use thymeleaf syntax to display ur data. check out spring’s docs for examples. good luck with ur project!