java2db

Jsp , struts 2 example in eclipse (Struts login application )



Jsp , struts 2 example in eclipseJSP (JavaServer Page) :

Jsp , struts 2 example in eclipse JavaServer Page allows programmer to embed java code directly in the HTML code.So we can easily embed java code in web pages.
Jsp , struts 2 example in eclipse Jsp can call custom java classes (taglibs) with HTML-like tags.
Jsp , struts 2 example in eclipse Separates both dynamic content(java code) and presentation(HTML code) of a Web page.

 

Jsp , struts 2 example in eclipse Struts :

Jsp , struts 2 example in eclipse Apache struts is an open source Java EE framework to develop web applications.It supports model-view-controller (MVC) architecture.It is a widely used framework for application development.

Jsp , struts 2 example in eclipse It is not an installable software , so add the struts related jar files to the lib folder.

 

Jsp , struts 2 example in eclipse Basic requirements for Jsp , struts 2 example .

 

Softwares :
Java (Download).
Oracle Database (Download).
GlassFish server (Download).
Eclipse IDE (Download).
Jar files: (Download).
commons-fileupload-1.3.1.jar
commons-io-2.2.jar
commons-lang3-3.1.jar
commons-logging-1.1.3.jar
commons-logging-api-1.1.jar
freemarker-2.3.19.jar
javassist-3.11.0.GA.jar
ognl-3.0.6.jar
struts2-core-2.3.16.3.jar
xwork-core-2.3.16.3.jar
Source files :
login.jsp
LoginActionClass.java
struts.xml
web.xml
success.jsp
error.jsp

 

Jsp , struts 2 example in eclipse Jsp , struts 2 example code :

Jsp , struts 2 example in eclipse Directory Structure in eclipse :

 

 

Jsp , struts 2 example in eclipse Execution Flow :

1 . Server accepts the request from the client window and it verifies the web.xml <url-pattern> from the web application.

2. Next it will check the <filter-name> inside the <filter-mapping>.

3. Later checks for the matching <filter-name> in the web.xml.

4. If the identical name exists , it will call the StrutsPrepareAndExecuteFilter .

5. Next it will check the action name (login) in the struts.xml .

6. After that ,it loads the class and execute the execute() method.

7. Based on the execution , it loads the appropriate response page(Exampel :success.jsp).

8. Finally the response page goes to the client window.

 

 

Jsp , struts 2 example in eclipse login.jsp

Jsp , struts 2 example in eclipse web.xml

Jsp , struts 2 example in eclipse LoginActionClass.java

Jsp , struts 2 example in eclipse struts.xml

Jsp , struts 2 example in eclipse success.jsp

Jsp , struts 2 example in eclipse error.jsp

Jsp , struts 2 example in eclipse Execution result :

Enter the User name and password in the login screen and click Login button.




Related Posts :
RESTful web service example in java using JAX-RS
Call database in Jsp (Access Oracle , MySQL , PostgerSQL ,Db2 from Jsp)
How to integrate Struts 2 and Hibernate 5 (Login example)
How to integrate Jsp , Struts 2 and hibernate 4 ( Login example )
Jsp Servlet and Hibernate 4 login example in Eclipse
Jsp , Servlet and JDBC login application example in NetBeans
Jsp,Servlet and JDBC integration example in Eclipse
Jsp-Servlet example in Eclipse,NetBeans and MyEclipse

Comments

  1. Bop says:

    Please post Spring…..

   [will not be published]



^ <