Re: Using WOHyperlink, Redirect to Normal HTML Page
Re: Using WOHyperlink, Redirect to Normal HTML Page
- Subject: Re: Using WOHyperlink, Redirect to Normal HTML Page
- From: Kent Conlan <email@hidden>
- Date: Fri, 5 Feb 2010 15:16:44 -0500
Hi Sreenivasulu,
The problem is your call to setUrl(), you must give it a valid
internet address. WORedirect works by returning a page that redirects
to another web site. This allows you to perform some action before
the user leaves your site (like logout.)
One other note: I like to implement this as a DirectAction so that if
the session has already terminated, you don't create a new one just to
terminate it.
- Kent
On Feb 5, 2010, at 4:34 AM, Sreenivasulu A wrote:
Hi Kent,
Thanks for your reply. I am using Session in my application. My
Normal HTML
file is in D:/Logout.html and the java code is in DirectAction.java
as shown
below:
public WOComponent logout() {
session().terminate();
WORedirect rePage = (WORedirect)pageWithName("WORedirect");
rePage.setUrl("file:///D:/Logout.html");
return rePage;
}
It is not working. I tried with "D:/Logout.html", but it is also not
working. I put Logout.html file under WebserverResources and it is
called
rePage.setUrl("Logout.html"). This one also not working. Please
correct me
for this example.
Thanks & Regards,
Sreenivasulu Arveti.
On Thu, Feb 4, 2010 at 6:58 PM, Kent Conlan
<email@hidden>wrote:
Hi Sreenivasulu,
If you don't use Sessions you can just go to the page.
If you do use Sessions (the default) then terminate the Session and
return
a WORedirect, or build your own using HTML 302 or META HTTP-
EQUIV="refresh".
Checkout WORedirect:
http://developer.apple.com/legacy/mac/library/documentation/WebObjects/Reference/WO53_Reference/com/webobjects/appserver/WORedirect.html
// DirectAction.java
public WOActionResults logoutAction(){
if (existingSession() != null) {
existingSession().terminate();
}
WORedirect aRedirect = new WORedirect(context());
aRedirect.setURL("http://www.google.com");
return aRedirect;
}
- Kent
PS. This was entered by hand so there may be a typo.
On Feb 4, 2010, at 5:27 AM, Sreenivasulu A wrote:
Hi All,
Using WOHyperlink how to redirect to a normal HTML Page in
WebObjects?
Will
it work for redirecting to Normal HTML Page? If it is possible,
please
give
me one example to redirect to a normal HTML page.
I want to redirect to normal html page when I click on Logout
button, and
from this normal html page I will redirect to "www.google.com".
Thanks in Advance,
Sreenivasulu Arveti.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden