| 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: 26173
|
|
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
|
 |
 |
|
|
subject: single controller servlet without struts
|
|
|