Hi, I'm new to Webware and practicing with my first
lines of code.
I would like to map HTTPRequest._fields keys names
to some other values before
forwarding to a new servlet so that I can make
forms/servlets much more reusable.
I think there is no problem with an micro-code like
next one:
def respond(self, trans):
# checkings and more checkings.
...
# resultMapping "interprets" the results. For
example, a client sends
# formIdx=3242 from an HTML ddbb view form.
resultMapping maps 'formIdx' to 'formFK_client_idx',
# 'formFK_document_idx', ... deppending on the
context.
contextInPlace =
self.session().value('ContextStack').pop()
resultMapping =
contextInPlace['resultMapping']
for oldFieldName in resultMapping:
self._fields[resultMapping[oldFieldName]]=self._fields.pop(oldFieldName)
trans.application().forward(trans,
contextInPlace['ServletAwareOfResult'] +
self._request.extraURLPath() )
The idea is that visual code generation is not aware
of the context and meanings of the generated forms,
and just when the client user fills and send a valid
value it is translated in something meaningfull.
My doubt come next. To map field names I'm accessing
the "private" member _fields and so my code depends on
HTTPRequest implementation that can't be considered
good practice. � Is there any other way to do in an
standard or correct way ?
If the answer is NO, who I am to email to convince
for the inclussion of an HTTPRequest method like:
def mapFieldNames(self, dicFieldNamesMapping)
Thanks in advance for your help!
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss