I am writing calendar functionality into a spring mvc application. I have a calendar.jsp
which provides a view of appointments
, which in turn are associated with providers
and customers
.
My underlying MySQL database has tables for appointments
, providers
, and customers
. But calendar
is an abstraction for the user interface. The Calendar
class does not have an associated table in the database, but the Calendar
class does have a List
of all appointments
and a list
of all providers
, etc. I use @Entity
annotation for appointments
, providers
, and customers
.
What spring annotation should I use for the Calendar
class?
I need to be able to reference calendar.providers
and calendar.appointments
, etc. from calendar.jsp
.
Here is a link to an example of a similar class that uses Roo annotation.
I would prefer to avoid using Roo. It would be nice to be able to use the base spring framework distribution. My app uses Spring and Hibernate. I would like to avoid adding unnecessary complexity.
Maybe I've missed something here but are you sure you're not overcomplicating things? If you want to expose a populated
Calendar
instance in your jsp, then after populating it just add it to the model in your controller method.Provided that
Calendar
has Java bean style properties for itsproviders
andappointments
then you can use dotted notation to access this data in the jsp.For example, without seeing any controller code:
And then in calendar.jsp: