login screen in struts and mysql database

This coding is used for only jsp page like login screen. Now i want to use this coding in struts and mysql. will u please help how can i use this coding in struts. please help me

Index.jsp

Admin : <input type="text" name="admin_name" size="22" value="">

Password : <input type="password" name="admin_password" size="22">

<input value="Login" name="login" type="submit" value="Login">

<input value="Cancel" name="login" type="submit" value="Cancel">

admincheck.jsp

try

{

Class.forName("com.mysql.jdbc.Driver").newInstance();

conn = DriverManager.getConnection

("Jdbc:mysql://localhost:3306/domaininform","root","");

String admnName = request.getParameter("admin_name") ;// Get

the User Name

String admnPwd = request.getParameter("admin_password") ;

statement = conn.createStatement();

String Query = ("select * from admin " ) ;

rs = statement.executeQuery(Query);

while(rs.next())

{

admn = rs.getString(1);

pwd = rs.getString(2);

}

if( (admnName.equals(admn)) && (admnPwd.equals(pwd)))

{ %>

<jsp:forward page="selectTable.jsp?butType=normal"/>

<% } %>

<% if( (admnName != admn) && (admnPwd !=pwd ))

{%>

<jsp:forward page="index.jsp">

<jsp:param name="errMsg"

value="Sorry Your UserName and Password is Mismatch" />

</jsp:forward>

<% } %>

[1538 byte] By [mill3prog7a] at [2007-10-2 17:52:28]
# 1
its not that easy tast mill3..u have to get to know the basic of struts and its classes..regardsShanu
mshanua at 2007-7-13 19:10:50 > top of Java-index,Enterprise & Remote Computing,AVK Portability...
# 2
i know struts. but i don't know exactly send the textbox values in form page, action page and database. if u give coding like this i can easily manage. please help me.
mill3prog7a at 2007-7-13 19:10:50 > top of Java-index,Enterprise & Remote Computing,AVK Portability...
# 3
> its not that easy tast mill3..u have to get to know> the basic of struts and its classes..> regards> ShanuBut it's easy to type complete words, even if you are lazy.
xHackera at 2007-7-13 19:10:50 > top of Java-index,Enterprise & Remote Computing,AVK Portability...
# 4

> i know struts. but i don't know exactly send the

> textbox values in form page, action page and

> database. if u give coding like this i can easily

> manage. please help me.

Read up on form beans, action classes and how they are associated in struts configuration files. You database level code (usually DAOs) can be called from action classes unless your architecture chooses to have some other layers.

x

xHackera at 2007-7-13 19:10:50 > top of Java-index,Enterprise & Remote Computing,AVK Portability...
# 5
Sorry..i will take it up your advice here after...Thanks & RegardsShanu
mshanua at 2007-7-13 19:10:50 > top of Java-index,Enterprise & Remote Computing,AVK Portability...