This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes single controller servlet without struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "single controller servlet without struts" Watch "single controller servlet without struts" New topic
Author

single controller servlet without struts

Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
I'm not using Struts, but I'm looking at changing some code to have a single Controller servlet that all requests go through before being passed off elsewhere (instead of having each of my JSPs post to different servlets that are relevant to them).

I've discovered request.getHeader("referer") that a class can call to find out which page or servlet or whatever sent the request to it (to find out where the request came from), and I'm wondering if I'm not using Struts if it might be good to use this information in my Controller servlet to partially determine where the request should be sent off to next, or if instead it is best to just determine the direction of the request only based on request parameters.

In a nutshell, if you don't have Struts and you want a single servlet for everything to pass through, what's the best way to direct all the requests?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30130
    
150

Karelicek,
You can have the JSPs pass a parameter (like the struts action concept) which tells the servlet where to pass the request to.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: single controller servlet without struts
 
Similar Threads
Difference between servlet and struts
That "terrible" Backbutton :(
Filters vs Servlets
Design patterns related to managing the controller
Jayson Falkner and the proper use of controller servlets...