Topic: How can i use Calendar with my Java Servlet and MySql ?

ahmadkhoshdel priority asked 7 months ago


Hi,

Could you please tell me how I can use the MDB5 Calendar in my Java project? I am also using this calendar in my JSP file to gather input about absence times from my users, and this information needs to be stored in my MySQL database. This means that when a user clicks the "Add" button, it should trigger a POST action to Java, and then Java should send it to my database using the Servlet API. As a result, it should be possible for the user to view all their absences in the selected month when they return to the page.

I've been trying to understand this, but I purchased this package specifically for this project. Now, I'm realizing that most templates or plugins are not efficient for a web application with Java. I feel like I paid for nothing. I would appreciate it if you could guide me on how to use the calendar plugin, as well as other plugins and templates for a Java web application with MySQL usage. It's crucial for me to understand how efficient MDB5 is compared to the runtime of my application. Will this package slow down my application, or does it have any negative impacts?

Thank you for your comprehensive answer.

Regards,


Grzegorz Bujański staff commented 7 months ago

Do I understand correctly that you would like to create this application using only Java, without JavaScript?


ahmadkhoshdel priority commented 7 months ago

I want to use JavaScript, but I don't want to send my information as plain JavaScript text. Additionally, using an API for every single request may be slow. Could you please clarify if my understanding is correct?


Grzegorz Bujański staff commented 6 months ago

I don't understand what you mean by sending every single query? Regardless of whether you create the frontend and backend separately or do everything within one Java application, it ultimately doesn't matter. Of course, SSR ensures faster page loading and you can find many articles and benchmarks confirming this. But once the page loads, any action that requires get/send data from/to the server requires sending a request. If you delete one event from the calendar - you need to send a request to the database with information that the event has been deleted. If You add an event - you must send the next request with information that the event has been added.

Of course, you can create logic that will synchronize data between the frontend and the database on demand e.g. every 5 minutes, and send one collective request. But if the user of your application forgets to manually synchronize data or closes the website before automatic synchronization starts, the user will lose unsaved data.

If you don't want to send plain text in requests, you can encode it on the frontend side and decode it on the server side. If you want to create it within one Java application, unfortunately, I can't tell you how to do it exactly. We checked our plugins and components in frameworks such as Django, Laravel, Express, .Net, and some more, but unfortunately not in Java. We haven't tested this and don't know what potential problems it may cause.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.4.2
  • Device: all devices
  • Browser: Chrome , FireFox , Edge , Safari
  • OS: Windows Server and Tomcat
  • Provided sample code: No
  • Provided link: No
Tags