Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

JSP & Controller in class/sequence diagram

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

1) In Cade's book, class diagram, the JSP files <<use>> the Controller class. I find this odd, as what actually happens is that the browser will issue a GET/POST request that will be mapped to a Controller that will execute the business logic and then dispatch to a JSP to render the HTML in response. I believe that the arrows should be in the opposite direction -- the Controller using the JSP files.

A similar issue is in the sequence diagram, where
(2) there is no actor such as the user/browser and
(3) the JSP is calling the Controller. As per my observation above, the browser request is getting mapped to a Controller. It's the browser invoking the Controller, not the JSP. The only way a JSP would be calling some business logic (during it's "render" phase) would be if the JSP uses custom tags, but this looks like the Dispatcher-to-View pattern, which is not intended for heavy-business-logic pages.

Anyone care to comment on these?

Thanks a lot.

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would also like to get some answers on the questions posted above.
 
Ranch Hand
Posts: 62
Hibernate Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Valid doubts, i guess its just the way we look at things

as what actually happens is that the browser will issue a GET/POST request ...
there is no actor such as the user/browser...
the JSP is calling the Controller. As per my observation above, the browser request is getting mapped to a Controller...


yes the browser will issue the request but when? ... On some user action on the jsp page (first page). so this jsp page in turn "uses" the controller to display the next jsp page so you can consider the first jsp page to be responsible for your request (instead of a browser or a user).
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,

In Cade's example, the first Sequence diagram begins with an actor, but the rest begin with JSPs. Is this valid ?
 
Ranch Hand
Posts: 133
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where did find an actor in the Sequence Diagram? In the Cade and Sheil example every SD start with a jsp page.
 
author & internet detective
Posts: 41184
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Krzysztof Koziol wrote:Where did find an actor in the Sequence Diagram? In the Cade and Sheil example every SD start with a jsp page.


Chapter 8. And there is a new thread for the actor question so please reply there.
 
reply
    Bookmark Topic Watch Topic
  • New Topic