Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

FrontController and Command Pattern together  RSS feed

 
Phani Sajja
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently developing a web application and trying to implement FrontController design pattern. FrontController delegates incoming requests to a RequestHelper, the helper intern creates a command based on the url-pattern. The command executes and returns the next view. My problem is When the command executes it gets a list of items for view, the client selects one of the items for further processing. When the user selects an item it generates a new command based on the url-pattern and the list is no more accessible. How to keep the list even after executing a new command. I dont want to use a "HttpSession" or "ServletContext". Is there any alternative or a pattern for preserving the list for feature. Please help me.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
phani sajja wrote:I dont want to use a "HttpSession" or "ServletContext"

Why not? That's what they're for.

That's like saying "I don't want to use a hammer to bang in a nail".
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hopefully the OP just meant they don't want to use it directly? In which case give an attribute map to the controller and/or command.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm hoping so. So many times in these forums we've seen the admonition to use the session wisely twisted into "Don't use the session!".
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!