Hmmm. Not quite. Here's my scenario:
Page A has a form. The form comes from an included file (via PSP include),
and this form is re-used in lots of different parts of the application.
Let's use a login form as an example. Perhaps Page A is the main page of an
app, and includes this login form. A good login goes to Page B. A bad login
(perhaps bad password) goes to Page C. Since this form is not directly part
of a page, but rather an included snippet, I'd like to parameterize the
"good login" and "bad login" pages. The form submits to yet another page,
"D", which authenticates, then redirects as appropriate.
As for redirection, I'm currently using Response.sendRedirect, which works,
but involves a round trip to the client. I had forgotten about
Application.forwardRequest --I'll look into that.
--On Friday, October 13, 2000 3:11 PM -0400 Chuck Esterbrook
> So are you saying that:
> Page A has the form
> Page A receives the submit
> Page A redirects to Page B if an error is detected
> Page B wants the original form data.
> If so, are you doing redirection via the HTTP header, Location: (sp?), or
> via Application.forwardRequest(self, trans, URL)?
> There is also a forwardRequestFast(self, trans, URL) which preserves the
> request, response and session. Since the request is preserved, you could
> presumably use it in Page B.
> I wouldn't mind seeing the plain old forwardRequest() take an args
> parameter to pass to the other servlet. Just a thought.
> Let me know if I'm on track or not with regards to what your situation
> and problem are.
> At 11:54 AM 10/13/00 -0700, David Creemer wrote:
>> [slightly off-topic warning....]
>> Thanks. This does beg a more abstract question of why nobody else has
>> found the need to delete from session. This makes me worried that I'm
>> missing a better technique.
>> As an example, I have a PSP snippet form. The code that handles the form
>> POST expects to see some variables in the current session -- for
>> example, a page to redirect to on a processing error. When this code is
>> finished, I want to "clean up," and remove the session key/value pair.
>> I could pass this parameter as a hidden value in the form, but this
>> seems less efficient, and open to abuse (since it exposes some inner
>> workings to the client).
>> Is there a better way of handling this?
>> -- David
>> --On Friday, October 13, 2000 10:35 AM -0400 Chuck Esterbrook
>> <echuck@...> wrote:
>>> At 08:39 PM 10/12/00 -0700, David Creemer wrote:
>>>> There doesn't seem to be a clean way to delete state from a Session
>>>> object. I can onviously break encapsulation, and do:
>>>> del self.session()._values['key']
>>> Wow. I think this is the first time anyone has ever deleted anything
>>> from a session. :-)
>>> I've been developing actual sites with Webware, but haven't needed this
>>> to date.
>>>> but it would be nice if I could just use a method. I propose something
>>>> def delValue( self, name ):
>>>> del self._values['key']
>>>> is this reasonable? or am I missing something obvious?
>>> Agreed, that it's reasonable. Don't think you're missing anything.
>>> Webware-discuss mailing list
>> David Creemer david@...
>> Webware-discuss mailing list
David Creemer david@...