• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: accessing WO app without the need of a session....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: accessing WO app without the need of a session....


  • Subject: Re: accessing WO app without the need of a session....
  • From: Gustavo Pizano <email@hidden>
  • Date: Mon, 5 Oct 2009 12:16:19 +0200

Rob, thanks for the link and the info

I will read it now! :D


G



On Mon, Oct 5, 2009 at 12:13 PM, email@hidden <email@hidden> wrote:
Hi Gustavo,

I tend to work at a fairly low level with WO so you may get a nicer solution from someone else, but the basics are as follows:

You create a direct action by adding a method to the DirectAction.java file. WebObjects expects the method names to end in the word Action. So say you want a direct action called "userInfo" you would create a method called userInfoAction:

public WOComponent userInfoAction() {
}

In order to generate the content you can create a WOComponent lets say you named it "UserInfoPage" and then you fetch the component using pageWithName() and return it as follows:

public WOComponent userInfoAction()
{
WOComponent nextPage;
nextPage = pageWithName("UserInfoPage");
        return nextPage;
}

When you request the page you must leave off the word "Action" so the url would be:

http://www.mydomain.com/cgi-bin/WebObjects/my.woa/wa/userInfo

I would then pass in parameters on the url like userid:

http://www.mydomain.com/cgi-bin/WebObjects/my.woa/wa/userInfo?userid=10

and then read the form value using formValueForKey():

public WOComponent userInfoAction()
{
WOComponent nextPage;

String userID = request().formValueForKey("userid"); // Get the user ID.
System.out.println("User ID: " + userID); //Print the user ID.

nextPage = pageWithName("UserInfoPage");
        return nextPage;
}

This is all probably lower level than you need as you may not need to generate the url yourself, there is more info at http://en.wikibooks.org/wiki/WebObjects/Web_Applications/Development/Direct_Actions

Regards,

Rob.
 



On 5 Oct 2009, at 10:07, Gustavo Pizano wrote:

mmm yes, I remember now,

what should how should I call the DA from outside the WOApp?

so far I have been working form within the WOApp but now I need to access from outside, so this is completly new. :P.


Thanks for the info

:D

g.


On Mon, Oct 5, 2009 at 10:58 AM, email@hidden <email@hidden> wrote:
Hi Gustavo,

You can use a Direct Action if you don't have a session.

Rob.


On 5 Oct 2009, at 09:04, Gustavo Pizano wrote:

Hello, this is what I need to achieve.

I have an J2ee app running on apache, and I have a WOApp running on a G5.
Now, I want to show in the j2ee app in an iframe a WOComponent that will show a list of items from the database based on a selected User, user is an Enterprise Object.

I read somwhwere, but I cant recall where, that I can acces the WO without the neeed of a session ID, or even authenticating, as I said I can't find where I read about it.

Questions, will this approach, will allow me to do fetch to the DB even without a SessionID?, (silly question, I know but as you know im still new to some things).
Will this approach be better than doing WebServices with WO?....

What will be your suggestions.? thinking that I need to select a user and filter the query. ?, should the user selection pop up be inside the WOComponent, or should it be sent somehow to the WOComponent from the j2ee?

confused here. :S//...

any help as alwasy will be very very appreciate it.

Im in the mood today to make things work... :P :P :D

thx

G.

_______________________________________________
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

_______________________________________________
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



 _______________________________________________
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

References: 
 >accessing WO app without the need of a session.... (From: Gustavo Pizano <email@hidden>)
 >Re: accessing WO app without the need of a session.... (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: accessing WO app without the need of a session....
  • Next by Date: Re: accessing WO app without the need of a session....
  • Previous by thread: Re: accessing WO app without the need of a session....
  • Next by thread: [MEETING] Toronto Area Cocoa & WebObjects Developer Group - October 13
  • Index(es):
    • Date
    • Thread