Hi,
>Would another option be to check the current context (instead of having
>multiple suffixes)? (This way everything still routes thru your single
>controllerServlet.)
Not quite sure what you mean by this. I have to admit there are still things
I dont quite understand in the whole servlet model. Does the context refer
to EVERY application running? Or when you get the servlet context during the
init() method, is that specific to the application the init method is called
in?
>Does it make sense to add a parameter to the perform() function to
>represent the target Page? E.g.
>
>public interface Action {
> public void perform(HttpServlet servlet,
> HttpServletRequest request,
> HttpServletResponse response
> String targetPage)
> throws IOException, ServletException;
>} // ends interface Action
>
>{BTW, thank you Craig for the above!}
>
>This way the target page is (more) open to configuration (specifically, the
>configuration file that links request uri's with java class names, would
>also specify the target page. And, of course, only under exceptional
>circumstances would the user be redirected back to the request uri, an
>error uri, etc.
I would think not, because how is the controller servlet going to pass the
right forwarding URL to each action? I mean, what if the logic of one action
class may forward to many different pages depending on the outcome of the
logic? I would think the forwarding page should be defined or figured out in
the action class, EJB, whatever is doing the logic. An example would
be..what if you needed to go to a different page based on a STATE drop-down
on a form. Each state has its own page. The controller servlet I guess could
read this in from an XML file..but I think this is "logic" that shouldn't be
done in the controller servlet.
>I think of the action class objects as still part of the controller level
>(from Model - View - Controller). Since their role in life is to mediate
>between the UI & the Model (your EJB objects, or, as in my case, our Corba
>objects, whatever). If your business logic objects have method signatures
>including HttpServletRequest and the like, then you're only going to be
>accessing them thru a web-based frontend. (Not necessarily a bad thing if
>you're a web developer!)
Thats a good point. I am curious as to how you pass, say, the values of a
form field on to the EJB (or business) layer. Do you just pass it the
request object, or do you parse the request object into some intermediary
object, pass that on to the business layer, and it works with it that way? I
would agree though..I can't imagine passing on an HttpServletRequest, which
is the front-end webserver stuff, to the middle-tier logic. Seems that the
middle-tier would expect a certain bit of info passed to it via a simple
object, like a javabean or something.
Then again..I am not in full understanding of the EJB spec and thus cant say
that I am correct in this.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets