[appengine-java] Re: Simple Java WebServices Call in GAE

2011-12-28 Thread Hector Rovira
Are you trying to expose a Web Service from your Appspot?

For this you will need to extend HttpServlet, and configure it in your 
web.xml with a mapping for your web service.
http://code.google.com/appengine/docs/java/runtime.html#Requests_and_Servlets

For an example of a REST web service with JSON output, go here: 
 http://goo.gl/0zU0e  

It uses Spring MVC to manage URL mappings.  In this example, the controller 
receives an AJAX request from a web page to 
https://example.appspot.com/users/whoami and returns JSON containing 
information about the logged in user... I use this controller to load user 
information on the web page, and provide a sign out button.

Here's a javascript component that makes the REST call and processes the 
JSON:  http://goo.gl/Z18ev

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/6GazSiYJ-8wJ.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Dudas sobre Aplicaciones con JPA

2011-03-11 Thread hector rovira
Necesitas dar mas informacion.  Provee ejemplos de tu configuracion 
(persistence.xml y web.xml) y de las clases.  Cual es la relacion entre 
Colleciones y Editoriales?

Cual es la naturaleza del problema?  En que parte piensas que falla?  En 
"persist" o en "retrieve"?

Has utilizado JPA anteriormente, sin GAE?  Te funciona en el "dev server"?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Design question for SOA / Facebook like Platform on GAE

2011-03-11 Thread hector rovira
You don't necessarily need to host the other apps on appspot, if what they 
are providing is web UIs... you can serve them from your appspot as a proxy. 
 The pages you serve will benefit from your authentication and will be able 
to access your REST APIs.

I've developed this open source project with a similar approach for research 
apps:  http://cloud.addama.org.  It ties a variety of apps running outside 
of GAE through a service registry running on GAE.  The registry provides the 
security concerns and standardizes the REST APIs.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: UserService error

2011-03-11 Thread hector rovira
do you check if the user is logged in anywhere in your stack?  for example:

if (!userService.isUserLoggedIn()) {
response.sendRedirect(userService.createLoginURL(url));
return null;
}

there's a way to enforce this in your web.xml but you may want some of your 
content to be available for users that are not logged in.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Getting Null pointer expection

2011-03-11 Thread hector rovira
try this instead:

if (!userService.isUserLoggedIn()) {
response.sendRedirect(userService.createLoginURL(url));
return null;
}

User user = userService.getCurrentUser();

JSONObject json = new JSONObject();
json.put("email", user.getEmail());

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.