aspose file tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes FrontController and Command Pattern together Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "FrontController and Command Pattern together" Watch "FrontController and Command Pattern together" New topic
Author

FrontController and Command Pattern together

Phani Sajja
Greenhorn

Joined: Mar 08, 2009
Posts: 3
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

Joined: Jan 10, 2002
Posts: 61995
    
  67

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".


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jan 10, 2002
Posts: 61995
    
  67

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!".
 
jQuery in Action, 2nd edition
 
subject: FrontController and Command Pattern together