PDA

View Full Version : Java Servlet Problem



Lorenxo
21 Apr 2010, 1:33 AM
Hello, I am a new member of this forum and I want to use extjs to do a project but I don't know how to move my first steps.
I am using Aptana Studio 2.0. and I learn about extjs finding a very powerful API resource.
I have already realize simple web applications, but this is my first complicated one.
I have searched in the forum and in the learning center, but I have not find something very usuful.
I am quite good with javascript and java, but with extjs, ajax and the servlet is my first time.
For this project I have to realize a 2.0. web application using Javascript, ajax, obviously extjs and java with tomcat 6.0 using a servlet with methods like doPost and doGet.
I am quite confused, so I hope that you can help me.
My question is:
1)I have to do everything using the java servlet, or I have to use this only for my server-side application?

Every useful assistance is really good accepted

Thanks,
Lorenxo

CrazyEnigma
21 Apr 2010, 10:49 AM
Web Technologies haven't changed much. Evolving from just serving up simple web pages that formatted your data into an HTML page. I think you have all the necessary tools to do your work.

The only difference with AJAX is that you are developing a UI in Javascript to serve data that you send through from the server. So your server essentially serves up the data in several forms: SOAP, XML, JSON. Your choice. The query should be the same as what you have done before, only that you are formatting the data on the client side with javascript.

It's unfortunate that you find that there is little useful on this site. There are ton of examples, tutorials, and don't forget the API. These are a huge help to understand this framework. The API (http://www.extjs.com/deploy/dev/docs/) has a lot of links that I use on a daily basis. It is not limited to just Java, or PHP or ASP.NET, so maybe you misunderstand what AJAX is trying to accomplish. If you are trying to look at a sample with a specific technology, you might have to extrapolate the basic concepts to use with your technology.

Lorenxo
21 Apr 2010, 11:58 PM
Hello, thank you very much for the answer; Don't misunderstand me, the extjs documentation is very useful and practice and through that I have created a lot of interesting things, but I was not able to find something than could solve my specific problem that was about the use of servlet in Aptana Studio with all other tecnology. Now I can say that the servlet is like another server-side situation, so I have to use it in order to resolve the requests from the clint-side.
I think that now the problem is solved.
Reply me if I don't understand correctly.
Thanks,
Lorenxo

Animal
22 Apr 2010, 12:03 AM
I assume you are a student, and this is a college assignment?

Lorenxo
22 Apr 2010, 6:29 AM
Yes Animal, you are right. I am a student of computer science and I am doing a project of Web technologies.

Animal
22 Apr 2010, 6:33 AM
Then the object of your assignment is in fact to research the technologies, and show your supervisor that you are able to perform your own research and learning.

The end product is not that important, it's how you get there, and the initiative and innovation that you display while getting there.

You simply state "a 2.0. web application using Javascript". You have to define your goals better than that as the very first step.

What is your application to do? Decide that. Then decide how to begin realizing it.

You'll get help here, but I would very much hope, not be given code/

Lorenxo
22 Apr 2010, 7:29 AM
I want nobody write code for me, I want to write my own code, because I want to learn how to program with this technologies. The problem infact is how to use what I have at disposition.
I have to do an application where a user can use my client-side app to require documents written in differet languages (stored in a server (java servlet)) and visualize one or more of them at the same time to compare or analize them.
For example I have a page where there is a list of all documents the users can utilize,the list must be created dinamically using the files contained in the server, but I don't know how to interact the ajax requests with the java servlet.
Do you know some useful links where I can learn (possibly not so diffucult) how to interact my ajax request with a servlet?
I am writing the code since a couple of days, so I don't really already know how I have to work.

Thanks
Lorenxo

Animal
22 Apr 2010, 7:31 AM
You might want to investigate Ext Direct and the Java server side engine which provides RPC type capabilities.

http://www.extjs.com/forum/showthread.php?73027-Ext-Direct-Java-based-implementation

Animal
22 Apr 2010, 7:33 AM
Or, if you don't want to tie yourself to that, but must use servlets, then use the JSON classes from http://json.org/ and send back JSON in response to Ajax requests.