views:

63

answers:

1

I am interested in creating a simple web application that will take in user input, convert it to an XML file and send the file to a database.

Coding wise I feel I am okay, it is just the general setup and what implementation to use I am a bit unsure of.

At the moment I have a JSP page containing a form, the user fills out the form and on submit a POST method is sent to a servlet, in the servlet doPost() method the servlet is instantiating a java object and passing it the user inputted data. The java object then writes that data to an XML file and sends it to the database via REST.

All I would be interested to know is if this the standard/optimal way of creating such a web application.

Any and all feedback is appreciated.

Thanks

+3  A: 

For a "simple webapplication" this high level approach looks fine in general. However, if you want more critical feedback, you'd need to give more details about the low-level approach. It may for example happen that it isn't memory efficient and thus may break when the webapp is been used by over 10 users concurrently, just to give an example.

I only question the choice for the GET method. You'd normally only use it to retrieve data (SELECT), not to create/alter data (INSERT/UPDATE/DELETE). For that you'd normally use POST, so that no one can execute it "accidently" by just clicking a (bookmarked) link. Changing GET to POST isn't that hard, add method="post" to the <form> element and rename doGet() to doPost().

BalusC
Thank you for the `GET` to `POST` suggestion, I have changed my code to reflect the suggestion.
Mark R
You're welcome.
BalusC