Jimmy Clark wrote:Well you have two applications. The desktop application and the web application. You can have them communicate by sending messages to each other using a message server or you can create one or more web services and have them communicate with the web services.
Keep in mind that Java servlets are designed for Presentation elements. They shouldn't be coded to send external messages outside of the web container. This should be implemented in a business object.
I don't want to augment my application complexity with extra webservices or server messages. the embeded web app will be used for a small task in whole application and want it to stay as simple as possible.
Yahya Elyasse wrote:-i want my servlet to notify my desktop client once it executes the doGet() method.
Paul Clapham wrote:
Yahya Elyasse wrote:-i want my servlet to notify my desktop client once it executes the doGet() method.
But that's just the plain old HTTP request and response process. Your desktop client would send an HTTP request to that servlet and wait for it to send a response. Which it would do naturally as part of the doGet() method. I don't see any need to drag in anything more than that.
my application needs to authenticate user with Google oauth. this can only be done on the web.
Jimmy Clark wrote:
my application needs to authenticate user with Google oauth. this can only be done on the web.
The desktop application can send a HTTP request and can receive the response directly. There is no need to create a separate web application simply to send a single HTTP request.
Google wrote:Note: Though the OAuth protocol supports the desktop/installed application use case, Google only supports OAuth for web applications.
Jimmy Clark wrote:
my application needs to authenticate user with Google oauth. this can only be done on the web.
The desktop application can send a HTTP request and can receive the response directly. There is no need to create a separate web application simply to send a single HTTP request.
The application can wait for a response in the background and continue processing. Or, it can wait in the foreground and not do anything until it recieves the response.
And maybe if there are more requirements for Internet activity, then it seems like it should not be a desktop application but a 100% web application.
Paul Clapham wrote:
Jimmy Clark wrote:
my application needs to authenticate user with Google oauth. this can only be done on the web.
The desktop application can send a HTTP request and can receive the response directly. There is no need to create a separate web application simply to send a single HTTP request.
I was going to say exactly that. But then I did some googling and I found Using OAuth with the Google Data APIs, which said this:
Google wrote:Note: Though the OAuth protocol supports the desktop/installed application use case, Google only supports OAuth for web applications.
So I didn't say that.
However this note really means "Sure, you can try using OAuth from your desktop app, but you're on your own, buddy. Don't ask us for help." So if I were a beginner I would take it seriously; although what we see is that a beginner can't work around this restriction anyway.
Note: Though the OAuth protocol supports the desktop/installed application use case, Google only supports OAuth for web applications.
Yahya Elyasse wrote:beginner?!! you and your other mate are insulting me al through this thread and i don't know why?
I don't need help from such people who are disrespectful and more over don't know what they are talking about. your opinions are misleading and reveal your ignorance regarding google oauth.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |