The previous version of this software was built using servlets as
controllers. The filter/taglib approach is both easier for me to
develop, and more intuitive for my users.

Control is handled by the filter and taglibs, so the JSP is rather
less messy than you probably think. The only non-HTML content in the
entire JSP layer is form post and error handling (one custom tag with
a page-scope variable, and a few jstl tags):

(from login.jsp, HTML trimmed)

<form:post action="SomeAction" errors="errors"
  onSuccess="<%= redirect %>"/>

<c:if test="${errors != null}>
  <c:forEach var="message" items="${errors}">
    <c:out value="${message}"/>
  </c:forEach>
</c:if>

Effectively I've got a more customizable Struts, without the .do
extensions. ;)

Chris

Phillip Morelock wrote:
> 
> my polite suggestion is:
> 
> use servelts for these kinds of tasks -- it's much easier to control and
> visualize how things should "flow" -- just use JSP to display information
> they need, use the Servlet as its meant to be used, as a "controller."
> 
> just IMHO, good luck.
> 
> cheers
> fillup
> 
> On 4/25/02 6:38 PM, "Chris Wolfe" <[EMAIL PROTECTED]> wrote:
> 
> > I am trying to transparently redirect requests for one JSP page to
> > another, and then forward back to the original when some condition is
> > met. The intended sequence of events is something like:
> >
> > browser GET protected.jsp
> > filter protected.jsp to login.jsp
> > login.jsp sent to browser
> >
> > browser POST protected.jsp (with login.jsp form data)
> > filter protected.jsp to login.jsp
> > login.jsp tags perform validation, find errors
> > login.jsp sent to browser
> >
> > browser POST protected.jsp (with corrected login.jsp form data)
> > filter protected.jsp to login.jsp
> > login.jsp tags perform validation, login successful
> > login.jsp forwards back to protected.jsp
> >
> > My problem is that the final forward (from login.jsp back to
> > protected.jsp) gets routed back to login.jsp without the filter doing
> > anything. It seems like something is being cached in the
> > Catalina/Jasper code, but I have not managed to find it. Is there a
> > way I can work around this, and still have the browser believe it is
> > requesting protected.jsp for the entire login?
> >
> > I have a number of working alternatives, but all of them result in
> > the browser requesting the login.jsp URL directly, which I would
> > prefer to avoid (I have users who get confused if the wrong URL
> > appears when they open a bookmark).
> >
> > Thanks,
> > Chris
> >
> > --
> > To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> > For additional commands: <mailto:[EMAIL PROTECTED]>
> > Troubles with the list: <mailto:[EMAIL PROTECTED]>
> >
> 
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to