I would like some advice on designing a webapp using Spring MVC. I'm using a project use-case to learn spring MVC. I don't have experience in jsp but I can pick that up quickly since its just tags and I can code in java. A quick overview of the site:

My website will allow for users to create drawings and share them online. Each user will have dashboards with multiple drawings that they have created. And the creator can choose to share the master piece via a permalink url for the dashboard as well as the permalink for the drawing. Only the creator of the drawing can edit the specific drawings and dashboards. Everyone else can see that drawing unless the creator has password protected his or her dashboard or drawing in which case the visitor will enter a password for him to view it but not edit it. How will sessions be tracked in this scenario? This is a complex application with rich learning opportunities. How should I design this app?

有帮助吗?

解决方案

Well I think more than Spring MVC, your question is more about program design. The requirements that are indicated in your question have nothing to do with sessions, even though of course Spring MVC handles sessions for you. Each user will have their own session, hence, it's irrelevant to the application requirement.

My advice, is for you to do a quick tutorial on UML and how to model business applications and look at other similar examples on the web, where a common resource is shared with many other users with permissions, etc.

I do not think that Spring security out-of-the-box can help you, as the default Spring security is based on access and authentication of resources/methods. Having said that, may be this approach can work with default Spring Security: you have your design page duplicated twice on 2 difference views (web pages). One view will have static design and the other will be changeable design. Hence, if a person is logged on with the correct authority, then he/she can view the changeable page, otherwise he will be redirected to the static page.

Another approach would be to do it yourself once you are familiar with UML.

I hope the above helps you.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top