• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to start making my Web Application  RSS feed

 
bhav patel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I need some help starting my assignment and was hoping you wonderful people could help me out.

So when thinking of how to create my web application i did some reading and decided I wanted to create a Java web application, where HTML is the front-end and Java back end.


I would like to create a booking system that makes use of a mysql database.
During the initial submission I created a Java EE - Maven web application but found it quite overwhelming as I had no idea how it all works but for my first submission I only needed to show a general layout of my website.

So i created a bunch of .jsp pages (which I read are similar to html) and designed my website with a simple stylesheet and some pages whilst using images for designing and navigation buttons, and forms for creating simple forms. (and was planning to use jquery for animations and such later on)

Now I am at a stage where I am struggling to understand how I can implement java functionality to do the processing of the website, e.g. How to take the inputs from a form and process the info using the database and return something back. I've been trying to look at some tutorials that mention GET and POST but still quite confused.

Overall, I am struggling on how to create a Java web application correctly and hoping that I can get some guidance on where to start, possibly a step by step tutorial/walk-through guide somewhere showing a full website being developed, or something of the sorts to help me understand all this.


Really appreciate all your time in helping me, thank you!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
144
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Firstly, JSP is not "similar" to HTML; JSP is a template that produces HTML. What is sent to the browser is still HTML -- it's just been dynamically generated using Java on the server before being sent to the browser.

Read this article to understand what JSP is all about.

Also, be aware that many tutorials for JSP you might find on the web put Java code into the JSP. This is an obsolete and bad practice that you should not emulate. Be sure any material you follow uses modern JSP with the EL (Expression Language) and JSTL (JSP Standard Tag Library).
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
144
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Secondly, read this article to understand how to properly structure a Java web application.

The emphasis is on using JSP only for view generation, and servlets for control.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
144
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And thirdly, an alternative structure is to not use JSP and servlets at all but to create your server as a Java RESTful API, and to create your pages using pure HTML and JavaScript using a client-side MVC framework such as Backbone, Ember or AngularJS.

It all depends what it is you are trying to learn, and what artificial limitations there may be on your assignment.
 
bhav patel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:And thirdly, an alternative structure is to not use JSP and servlets at all but to create your server as a Java RESTful API, and to create your pages using pure HTML and JavaScript using a client-side MVC framework such as Backbone, Ember or AngularJS.

It all depends what it is you are trying to learn, and what artificial limitations there may be on your assignment.


Thank you for all of this, I'll definitely read up on your links.


Unfortunately I will have to go on the JSP/Servlets path as I've already stated that during the first submission of my assignment.

Also I did see some tutorials where java code was used <% %> inside a .jsp and it seemed odd to me so i ignored it.

_
I'll read up on all this let you know how I get on with understanding this, thank you.
If there are any more resources that you think will help me, please do let me know.


Thanks again!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
144
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bhav patel wrote:Unfortunately I will have to go on the JSP/Servlets path as I've already stated that during the first submission of my assignment.

That's fine. You could go wither way -- as I said, depends upon your requirements.

Also I did see some tutorials where java code was used <% %> inside a .jsp and it seemed odd to me so i ignored it.

Yes; that's technology that's been obsolete for over 15 years, but many people still use it because they find these tutorials and think it's acceptable. It's not.

Modern JSP will have EL expressions that look like ${some-expression-here}, and JSTL tags such as <c:forEach>

If there are any more resources that you think will help me, please do let me know.

https://docs.oracle.com/javaee/6/tutorial/doc/bnafd.html

Though beware that Oracle will try to steer you to JSF (JavaServer Faces). That's a whole 'nother tarball (in my opinion) that you do not want to stick your thumb in.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!