File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question of MVC Design Pattern

 
avseq anthoy
Ranch Hand
Posts: 106
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jsp page.
Is it reasonable that the page have the code "session.setAttribute("abc")" if I use a mvc framework ?

I think the view layer should only the logic for presentation.
I think the "session.setAttribute("abc")" has some smell for bussiness logic.
Can somebody give me other suggestion?

Thanks~
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe that attribute has something to do with Presentation logic. If it does then it complies with MVC object-oriented design pattern.

If that attribute has something to do with Business logic, then it shouldn't be in the JSP page.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic