Posts

Java Struts2 Tutorial - Introduction

Image
    Java Struts2 Tutorial - Introduction   What is Struts in Java? Apache Struts is an open-source web application framework for developing an enterprise-level web applications in Java EE. It is  built on model–view–controller architecture. It uses and extends the Java Servlet API and also uses other Java technologies like JSP, XML, JSTL etc. It was originally created by Craig McClanahan. Latter, it is given to the Apache Foundation in May 2000.   The latest version of struts is Struts 2.5.22. Struts web-MVC framework allows separating Model, View, Controller components easily. Struts, written in java. It works with different technologies such as Java Servlets, JavaBeans, XML, and many more. Controller : maps user request  to action . Incoming request of the application are processed by Controller. Model : In struts, usually it is ActionServlet (FilterDispatcher in Struts 2.x). Hold business Logic of an application. Creates a bean to access data o...

JSTL -XML Tags

Image
JSTL - XML Tags JSP Home      There are different types of XML tags are available in JSTL under XML tags. Using these tags we can perform task like read XML file, iterate the nodes and also select/choose  a specific node from XML file and so on.  Many of the XML tags, in JSTL, are very much the same as the 'core' tags. For example,  < x: forEach>, < x: if >, < x: when> etc. books.xml <?xml version= "1.0" ?> <books> <book> <title>Java</title> <author>roy</author> </book> <book> <title>JavaScript</title> <author>herbert</author> </book> <book> <title>C PlusPlus</title> <author>robert</author> </book> <book> <title>HTML</title> <author>allaire</au...

JSTL - SQL-Tags

Image
Java JSTL SQL-Tags     JSPHome       query. html <html> <body> <form method=post action= "query.jsp" > <textarea name= ' area1 ' rows= 10 cols= 30 > </textarea> <input type=submit> </form> </body> </html> query. jsp is given below. In the standard JDBC code, we begin by asking for the availability of the driver. "jdbc.odbc.JdbcOdbcDriver" . And then, we specify the URL of the database as ' jdbc:odbc: telephone ' . Similarly, in JSTL also, we begin with SQL. < sql: setDataSource tag. var driver url < c: set var= "s" value= "${param.area1}" /> < c: out value= "${s}" /> ' < sql: query ' tag, takes three attributes., such as, symbolic name: var= "query1" datasource= "${db} sql=" ${s} query. jsp <% @ taglib prefix= "c" %>uri= "http:/...