• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ajax and Servlet

 
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I got myself comfortable reading/creating javascript code so I jump on to study with Ajax technology.

I am currently trying to learn ajax from this site... Coreservlets Site

I am able to experiment on some of the sample exercise.

Now, I am having some question about this
As per their samples, you could always return a string/xml/json.

My question is, is this how we will always code our servlet code?



cities-xml.jsp



cities-jsonl.jsp


We always create a separate jsp file and always include it in the call to the requestdispatcher?




I have asked this question because, I look at some of the sample chapters of the books about ajax and majority of the book uses PHP as the server side technology.
In my case, I need to use JAVA. So I need to know how to apply it in Servlet and not JSP and code also the client side html.
I think ajax request should submit to a servlet rather than a JSP as per the tutorial

I am not sure but I am hoping I could use Jquery with Spring later after I had a good grasp of AJAX technology in my next project
Most of the Ajax books, discusses about using ajax framework. But as I have checked with my book, Pro Spring 2.5, it discusses about DWR. I have checked with the net
but cant find resource regarding Spring support for Jquery . Though I will think about this later.

Hopefully somebody could suggest an answer on my initial question. Sorry for the lengthy post.
 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I guess, nobody responded because of the lenthy post.

I will try again.

Suppose I prefer to return xml data to each ajax request. Is there only two way to do this?

I only see this one:



And this pattern, create a jsp and include it in the call to the request dispatcher


I am not sure, but is this the only way to do this? And which one is better approach.

 
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic