: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in
What a framework means?
• an extensible/generic/flexible architecture following set of standards and patterns
• Focuses on a specific domain (web / j2ee applications etc)
• Provides extension points
• Can be customized and used on projectsWhat is Struts Framework?
• Provide APIs those are used to create web applications
• Uses Java Beans, Java Servlets, and Java Server pages (JSP)
• Based on the MVC design pattern
• Rich set of tag libraries provided for presentation tier
• ExtensibleStruts API Zoo
• Most of the times we will extend ActionForm for making input page form beans and Action class for
putting the business logic like we did in servlet.
• We can customize controller parts also.
• Most of the API and tags works in internationalized fashion, so they will take data to display as a key
and we will define these key-values into properties file. So by default our application will be
• We can define our validation rules on user inputs into xml, means highly configurable and reusable
• We can break our look and feel into tiles and each tile can be configured through xml, means making the
• We define the flow inside the struts-config.xml that makes our application flow highly configurable.
So waiting for what this is the right time to write HelloWorld…..
For accessing the application type following URL in your browserhttp://localhost:8080/hello/welcome.do1.
Since the request ends at .do so the ActionServlet will get called. This servlet works as Front
ActionServlet will take out /welcome from /welcome.do and look for mapping3.
it will found direct forward rule and will forward the request to /hello.jsp4.
when you submit the hello.jsp page in action it calls /hello.do5.
again step 1 and 2 will be repeated6.
Now this time it founds an action class and form associated with this action.7.
instantiate the form bean object, called the setter method for properties name matched and then called
the validate method which returns ActionErrors object8.
it check this object if empty then execution goes to HelloAction execute() method else it forward the
request to input="/hello.jsp"9.
in execute we cast the form, fetch the value and then added into request
request.setAttribute("message", "Your Message " + msg + " received!!!");
execute() returns ActionForward that hold the logical name of the page to be forwarded.
<forward name="success" path="/success.jsp"></forward>
And finally we see the success.jsp as a final output.