Pages

Wednesday, 11 September 2013

Struts2 Login Application Example

Let us see the simple login application using struts2, but friends am giving with out validations, we will see in depth validations very soon :-)
  • success.jsp
  • error.jsp
  • index.jsp
  • LogingEx.java [ in java4s package ]
  • web.xml [ in web-inf ]
  • struts.xml [ in web-inf/classes folder ]


index.jsp

success.jsp

error.jsp

LogingEx.java

web.xml

struts.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?xml version="1.0" encoding="UTF-8"?>
 
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
 
<struts>
<include file="struts-default.xml"/>
<package name="a" extends="struts-default">
<action name="verify" class="java4s.LogingEx">
<result name="success">/success.jsp</result>
<result name="error">/error.jsp</result>
</action>
</package>
</struts>

No comments:

Post a Comment