this is my first post here, so i say hi to everyone and many thanks to everyone, who contributes to developing this amazing society and everyone that could and would eventually enlighten me about web applications.
A few months ago i literally woke up with this great idea about a web application. I must say it is purely about the sport, about developing the sport and nothing to do with getting richer or earning money from it. If it had - i would invest some money into a company that can make this application for me and not bother to write here. My main goal is to learn and understand how web applications are created and maintained as I am a 2nd year student in Informatics department and this is what I am interested in. Secondary - it would significantly improve the situation in my sports federation - the sport I've been practicing for years now.
So basically - i would like to create a hybrid between a Article Portal - a place where someone would write articles, news, game rules and much more and people would just read them(which is easy, could be done from scratch or with systems like Drupal, Joompla, etc.) and a web application that would allow registered users to create events(limited by many descriptions), these events would appear at a table and anyone would be able to open and view more information about these events. Also - the event itself would be e rather complex thing to program but I could do it in JAVA SE with Swing interface for local use only.
I've been trying to google more about web applications but most of the information is above all amateur-unfriendly. Many terms I don't understand and many technologies I've never heard before. From what I understand - I could either write a Servlet or Java Server Pages or Applet or just try and do it in PHP
So - can anyone please giude with simple words - what is the difference between these 3, is there another way to do it or any other suggestions or material for reading? And what are the basics of a web application? Is it a java class that does its work back on a server, stores some data in DB and gets and sends values with POST/GET from html forms and back to html to present the results of the application's calculations for the users? If it is THAT simple, i could write the applications as I would for local use, test its functionality and then remodel it so it can be used on a server. I've seen a basic hello world app and probably following that pattern wont be too hard.
Kalin Varbanov wrote:I could either write a Servlet or Java Server Pages or Applet or just try and do it in PHP what is the difference between these 3
Not Servlet or JSP, but Servlet and JSP. A Java web application uses both.
A web application written in Java is not like any other Java program. There is no main() and you use the APIs of Servlets and JSP to create the application. The application must be hosted on a server running a "servlet container" (.e.g Tomcat, Glassfish, Resin et al).
Applets are older technology that is disfavored. It's a way to create programs that download to the browser and run on the client rather than on a server like a web application. If you are going to go this route, use JavaFX rather than Applets; though most people think that even JavaFX is DOA.
PHP is obviously not Java so, that's its own ball of wax.
Is it a java class that does its work back on a server, stores some data in DB and gets and sends values with POST/GET from html forms and back to html to present the results of the application's calculations for the users?
Pretty much, though you've got some of the details wrong. But...
If it is THAT simple, i could write the applications as I would for local use
No you can't. As I said above, you'll need to use the Servlets and JSP APIs, and that has nothing at all to do with writing local Java applications.
If you want to learn how to write Java web apps, I suggest Head First Servlets and JSP. (Disclaimer: I was a tech reviewer of the book.)
Kalin Varbanov wrote:Is it a java class that does its work back on a server, stores some data in DB and gets and sends values with POST/GET from html forms and back to html to present the results of the application's calculations for the users?
It is not just one Java class as Bear pointed out already. Few PHP pages if you do it in PHP or few servlets, JSPs and plain Java classes if you do it (in a better way) in Java.
The capture-store-retrieve you mentioned is trivial for most of the applications on the web. The complexity does not lie in what is implemented, it lies in how it is implemented.
Kalin Varbanov wrote: i could write the applications as I would for local use, test its functionality and then remodel it so it can be used on a server.
Well if you carefully design the application and have business logic totally decoupled from presentation, you could do this albeit with remodeling.
Be advised, not all applications can be transformed from local version to web. Like there is no similarity between Hello World on desktop app and that on JSP.
If you want to understand how web applications work and how you can create one using Servlets and JSP's I will recommend you to read Head First Servlets. Having said that let me try to answer your questions.
First of all if you plan to use Java technology to create your web application then you will need a good understanding of Servlet technology. A web application indeed does the tasks you rightly mentioned i.e. handle user requests, process it (which can involve database also ) and then provide response in the form of an HTML page. But then there are patterns also which help you to create a maintainable and scalable application.
Most of the features you are talking about are easily available out of the box by using a Portal solution like Liferay. Features like blogs, Wikis and Calendars for creating events are available out of box.
Give it a try at www.liferay.com Just download the CE version and run it.