I wrote the post about how to connect JSP applications and your Database, and in this post I’ll write the post that has same purpose but in the different way. we’ll connect the database via JSTL.
The basic structure of Decision-Making in PHP programming Language and JSP Programming language is exactly the same. ‘Decision-Making in JSP also use IF…ELSE and SWITCH…CASE statements.
IF … ELSE statement
Most of decision-making structure refer to this statement. This statement is suitable for small case (one/two condition(s)) of decision making until big case decision-making (nested if/more than 2 conditions).
Structure : Continue reading
I miss this blog so much, another work loads. some applications to make, teaching schedule, and family’s event. And in this post I’ll show you how to process your data from form you made.
Before read the following tutorial, you should have basic knowledge about HTML, and Basic JSP.(about what to do with your computer before start to code in JSP)
At some point it feels familiar, and it will get more like family now. so come on.
- Insert and view data
To access data that has been inserted into form basically you just need request.getParameter(“variable_name”) for example :
<input name=address id=address type=text /> //text box in HTML
String addr; //declare variable addr as String
addr = request.getParameter("address"); // assign the form variable address into variable addr
out.println(addr); //print the value of variable addr
the syntax above will take data that has been inserted into address text box and print it into your page. All data that inserted into form is in String form. so when you want to insert an integer value you need to convert the value unto integer. For example :
<input name=frprice id=frprice type=text />
int price = Integer.parseInt(request.getParameter("frprice")); //define price variable as integer and convert the value of form variable frprice from string into integer.
count = price - (price * 5%);
syntax above will convert string data from form variable named frprice into Integer and assign it into variable named price.
Integer.parseInt(variable_name)in charge of converting string variable into integer.
have I told you that I am both a Programming teacher in Vocational High School and Lecturer in one of college in town. So, now in vocational high school we are in the second semester this year and based on the teaching subject that shared among the teachers, I -again- assigned to teach Java Server Page. I am a Web-Based-Application freak and I love web Programming. Web Programming allow me make the Program and designed the page at the same time. but I am more like a PHP Girl rather than a Java Woman, and I don’t want to cheat him… I don’t know, it isn’t like I hate Java, I just not so get along with him…. sorry Mr. Java.
But if the boss said that I have to teach it, so be it. When the First semester of the third class was learn about the basic of JSP, now this semester I will connect their application with the Database.
Application you might need : Continue reading