[appengine-java] Servelts versus JSPS

2009-10-19 Thread Hung

So i've been a little confused about the different responsibilities of
Servlets versus JSP.  I'm very new the GAE and got confused when
looking at the guestbook tutorial.  It seems that
GuestBookServlet.java has no responsibilities after guestbook.jsp was
created.  However, the mapping of it in the xml says otherwise.  I
know we should keep responsibilities between levels separate and it
seems to me that the JSP should be responsible purely with the user
interface and the servlets should be in charge of compiling all the
data and deciding which datastore object i should be storing it to.

If anyone could help clear this up for me that would be really
helpful.

Thanks

--~--~-~--~~~---~--~~
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: Servelts versus JSPS

2009-10-21 Thread Hung

Thanks both for the quick responses.

Leszek you are right with the MVC.  I'm not great at writing web
applications since i am fairly new to the whole situation but all of
my web applications have been written with ASP.NET MVC.
It seems then so far the way i have been writting my applications is
correct.  I do have a few more questions that still have to do with
Servlets/JSP design and functionality.

I'm having a hard time finding a way to get back from the servlet to
the JSP.  I have a path that gets called to /results.jsp.   I have a
resultsServlet that has a doGet method for the JSP results in which
the servlet gets and compiles all the information needed for the
results i want to display.  However, i cant seem to find out how to
get back to the JSP code.  All the doGet method should be doing is
doing a datastore call and getting a bunch of information and
compiling it into a List.  and then my JSP function is
suppose to be taking list and displaying it.  I cant seem to get out
of this doGet method though.  When i hit link it just displays a blank
page since my doGet method does no displays.

I saw in other forums that they ask how many JSP files and Servlet
files they have.  Dont you need to have a Servlet file for every JSP
file?  It seems to be that GAE is working more with a Model View
archicture.

Lastly, in ASP.NET MVC there is a site.master page that holds the
style template that all the pages will be using.  Does GAE have
something similar to this?

Thanks.


On Oct 21, 3:59 am, leszek  wrote:
> JSP is nothing more than servlet code woven with html and some tags to
> make generating html pages more easy. Almost everything you can do in
> sevlet code you can do also in JSP page. So it is a design decision
> what logic should be kept in JSP and what logic should tackled in a
> classic servlet code.
> I think that what you have written is very sound and follow MVC
> approach. JSP should be responsible only for user interface ("view"
> part) and be separated from any persistent logic, and servlet code
> should keep "model" and "control" part and be separated from any
> interface code. Servlet code should also be the only to communicate
> with the persistence layer.
>
> But why use pure JSP and servlet ? There are a lot of good frameworks
> at hand.  There are successful stories with JSF 2.0 and Spring MVC
> running gently with Google App Engine.
>
> http://groups.google.com/group/google-appengine-java/web/will-it-play...
>
> Also GWT is running very nicely - I'm personally very fond of it. But
> GWT is completely different, Ajax-style, approach.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---