On Jan 22, 2007, at 1:32 PM, Seth Norris wrote:

Hi all,

I am new to WO - you may remember back in September I asked about what I should know when applying for a job that used WebObjects - well I got the job and now I have a lot to learn :)

Congrats!


Anyway, I am trying to figure out how to pass an argument in to a WO app. We have two different URLs that do a redirect to the app and I would like the layout to change a little based on which redirect(URL) the user came from. I have a boolean set up in the session and I have all the layout changes working based on that boolean, but I can't figure out how to set the boolean based on where the user came from when the app started. Can I even do this? Should I?

The easiest is to get the redirect to append a direct action path, e.g.

http://my.domain.com/cgi-bin/WebObjects/MyApp.woa/wa/sourceA
http://my.domain.com/cgi-bin/WebObjects/MyApp.woa/wa/sourceB

Then in DirectAction.sourceAAction() and DirectAction.sourceBAction () set the boolean in the session and return the first page.

A bit more flexible is to get the redirect to append a direct action path and a query string, e.g.

http://my.domain.com/cgi-bin/WebObjects/MyApp.woa/wa/default?source=A
http://my.domain.com/cgi-bin/WebObjects/MyApp.woa/wa/default?source=B

Then in DirectAction.defayultAction() use request().formValueForKey ("source") set the boolean in the session and return the first page.


Chuck


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to