|
Struts 2 Non-form Tags (UItags) |
|
return password;
}
}
Create a login jsp page as shown:
loginFielderrorTag.jsp
<%@ taglib prefix=”s” uri=”/struts-tags” %>
Create a jsp page that will display your field
error messages (when fails to logged-in)
using the empty <s:fielderror/> tag as
shown:
fielderrorTag.jsp
<%@ taglib prefix=”s” uri=”/struts-tags” %>
<html>
<head>
<title>Fielderror Tag Example!</title>
<body>
<h1><s:fielderror /></h1>
<a href=”/struts2nonformuitags/
javajazzup/fieldError.action”>Go Back</a>
</body>
</html>
Create a jsp page that will display your
messages (when succeed to logged-in) using
the empty <s:actionmessage /> tag as shown:
validuser.jsp
<%@ taglib prefix=”s” uri=”/struts-tags” %>
<html>
<head>
<title>Actionerror Tag Example!</title>
<body>
<h1>
<s:actionmessage />
</h1>
</body>
</html>
Enter the correct user name and wrong
password in the login page. You will see the
output of the loginFielderrorTag.jsp as shown |
|
below:
Enter the wrong user name and correct
password in the login page. You will get the following output:
Enter incorrect values in both fields of the login
page. You will get the following output:
Enter correct values in both fields of the login page. You will get the following output:
4. TabbedPanel (Ajax Tag) Example
This is an Ajax component, where each tab is
either a local content or a remote content
(refreshed each time when user selects that
|
|
Mar
2008 | Java Jazz Up |33 |
|
|
|
View All Topics |
All Pages of this Issue |
Pages:
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53 ,
54,
55,
56,
57,
58,
59,
Download PDF |
|
|
|
|
|
|
|
|
|