Trang 32 / 37 FirstFirst ... 2729303132333435 ... LastLast
Hiển thị kết quả từ 311 đến 320 / 369
  1. #311
    Tham gia
    16-07-2009
    Bài viết
    9
    Like
    0
    Thanked 0 Times in 0 Posts
    Họ tên
    - Địa chỉ (option):Hồ Chí Minh
    - Email: skyspace_as@yahoo.com
    - YM: skyspace_as
    - Nghê nghiệp: Sinh Viên
    - Trình độ Java: Chưa có kiến thức về JaVa
    - Mục đích gia nhập : Học tập và được trao đổi thẳng thắn
    - Những đóng góp : Tất cả những gì tôi có thể
    - Yêu cầu trợ giúp : Kiến thức về JaVa
    - Các mặt mạnh : Kiến thức chuyên ngành
    - Các mặt còn yếu: Java

  2. #312
    Tham gia
    06-09-2008
    Bài viết
    5
    Like
    0
    Thanked 0 Times in 0 Posts

    Tệ thật !

    - Họ tên: Trần Ngọc Tú
    - Địa chỉ: Hà Nội
    - Email:tranngoctu11@gmail.com
    - YM:tranngoctu_sd05@yahoo.com.vn(onl 24/24)
    - Nghê nghiệp: sinh viên
    - Trình độ Java: sơ nhập
    - Mục đích gia nhập :học tập và trao đổi kiến thức về java
    - Những đóng góp : tất cả những gì mình biết mang ra trao đổi
    - Yêu cầu trợ giúp :những mặt còn yếu kém
    - Các mặt mạnh :online nhiều, năng động yêu thích cntt
    - Các mặt còn yếu :do mới học nên còn nhiều điều không biết muốn tham gia để học hỏi

  3. #313
    Tham gia
    15-03-2009
    Bài viết
    8
    Like
    0
    Thanked 0 Times in 0 Posts
    Họ tên ****
    - Địa chỉ : Hải Dương
    - Email: pluto_kute@yahoo.com
    - YM: pluto_kute
    - Nghê nghiệp: Sinh Viên
    - Trình độ Java: mới học
    - Mục đích gia nhập : Học tập và được trao đổi thẳng thắn
    - Những đóng góp : Tất cả những gì tôi có thể
    - Yêu cầu trợ giúp : Kiến thức về JaVa
    - Các mặt mạnh : oline thường xuyên (trừ những lúc ngủ )thích lập trình,tk web
    - Các mặt còn yếu: Java

  4. #314
    Tham gia
    14-09-2006
    Bài viết
    8
    Like
    0
    Thanked 0 Times in 0 Posts
    - Họ tên : Trần Thế Nhựt
    - Địa chỉ (option) : 64 Chu Văn An, Mỹ Long, Long Xuyên, An Giang
    - Email : tranthenhut@gmail.com
    - YM : anh_1988_ne
    - Nghê nghiệp : SV
    - Trình độ Java: biết cũng nhiều nhưng chưa biết trình độ thế nào
    - Mục đích gia nhập : có thể trao đổi học hõi kinh nghiệm từ các thành viên
    - Những đóng góp : có thể giải đáp thắc mắc cho người mới
    - Yêu cầu trợ giúp : mong được giải đáp thắc mắc
    - Các mặt mạnh : hiểu rõ về Java căn bản, biết vài framework
    - Các mặt còn yếu : chưa rành EJB, Servlet

  5. #315
    Tham gia
    28-11-2009
    Bài viết
    3
    Like
    0
    Thanked 0 Times in 0 Posts
    cac ban gui giup minh link jdk voi thank nge. tien the neu co javapro thi gui lun cho minh voi nha co ***** cang tot

  6. #316
    Tham gia
    16-07-2008
    Bài viết
    4
    Like
    0
    Thanked 0 Times in 0 Posts
    - Họ tên : Hoàng Xuân Dương
    - Địa chỉ (option) :
    - Email : xuanduong89@gmail.com
    - YM : xuanduong_1607
    - Nghê nghiệp : SV
    - Trình độ Java: Beginner
    - Mục đích gia nhập : có thể trao đổi học hỏi kinh nghiệm từ các thành viên
    - Những đóng góp : những gì có thể ^^
    - Yêu cầu trợ giúp : mong được giải đáp thắc mắc

  7. #317
    Tham gia
    08-07-2009
    Bài viết
    1
    Like
    0
    Thanked 0 Times in 0 Posts
    - Họ tên : Lê Hoàng Minh
    - Địa chỉ (option) :
    - Email : hoangminhpr@gmail.com
    - YM : hoangminh_pr
    - Nghê nghiệp : SV
    - Trình độ Java: Beginner
    - Mục đích gia nhập : có thể trao đổi học hỏi kinh nghiệm từ các thành viên
    - Những đóng góp : những gì có thể ^^
    - Yêu cầu trợ giúp : mong được giải đáp thắc mắc

  8. #318
    Tham gia
    08-07-2008
    Bài viết
    3
    Like
    0
    Thanked 0 Times in 0 Posts
    ÑOÁI TÖÔÏNG REQUEST
    Khi muoán laáy giaù trò töø moät theû nhaäp lieäu ñeä trình (submit) töø form hay töø chuoãi QueryString, ñieàu naøy coù nghóa laø cho pheùp laáy giaù trò töø client gôûi leân server, ñoái tröôøng hôïp naøy baïn söû duïng ñoái töôïng Request. Ñoái töôïng naøy thuoäc lôùp javax.servlet.ServletRequest.
    Request vôùi töø theû nhaäp lieäu
    Ví duï chuùng ta khai baùo trang HTML hay JSP coù theû form, beân trong theû form khai baùo caùc theû nhaäp lieäu nhö input, select, textarea nhö ví duï 4-1.
    <%@ page contentType="text/html; charset=UTF-8" %>
    <html>
    <head>
    <title>JSP's Objects</title>
    <LINK href="style.css" rel=stylesheet>
    <LINK href="newstyle.css" rel=stylesheet>
    <META HTTP-EQUIV="Content-Type"
    CONTENT="text/html ; charset=utf-8">
    </head>
    <body leftmargin="0" topmargin="0" >
    <tr><td></td><td>Registration</td></tr>
    <form name=form1 action=ex2.jsp method=post>
    <table border=0>
    <tr>
    <td>Name: </td><td><input type=text name=txtname></td></tr>
    <tr><td>Province: </td><td><select name=province>
    <option value=HAN> Ha Noi </option>
    <option value=HUE> Hue </option>
    <option value=HCM> Ho Chi Minh </option>
    </select></td></tr>
    <tr><td>Description: </td><td>
    <textarea name=txtdesc cols=30 rows=5></textarea></td>
    </tr>
    <tr><td></td><td><input type=submit value="Submit"></td></tr>
    </table>
    </form>
    </body>
    </html>

    [=========> Bổ sung bài viết <=========]

    Ñeå laáy ñöôïc giaù trò cuûa caùc phaàn ñaõ nhaäp treân hình 4-1, chuùng ta söû duïng phöông thöùc getParameter cuûa ñoái töôïng request nhö ví duï 4-2.
    <%@ page contentType="text/html; charset=UTF-8" %>
    <html>
    <head>
    <title>JSP</title>
    <LINK href="style.css" rel=stylesheet>
    <LINK href="newstyle.css" rel=stylesheet>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html ; charset=utf-8">
    </head>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <h4>Confirmation</h4>
    <hr size=1><br>
    <%
    String name=request.getParameter("txtname");
    String province=request.getParameter("province");
    String desc=request.getParameter("txtdesc");
    out.println("Name is "+ name +"<br>");
    out.println("Province is " + province +"<br>");
    out.println("Description is " + desc +"<br>");
    %>
    </body>
    </html>

    [=========> Bổ sung bài viết <=========]

    Request vôùi töø tham soá treân QueryString
    Töông töï nhö treân, trong tröôøng hôïp baïn muoán laáy caùc giaù trò cuûa caùc tham soá treân QueryString, baïn cuõng söû duïng phöông thöùc getParameter cuûa ñoái töôïng rquest. Chaúng haïn, chuùng ta khai baùo trang JSP coù theû input vaø söû duïng phöông thöùc get trong theû form nhö ví duï 4-3.
    <%@ page contentType="text/html; charset=UTF-8" %>
    <html>
    <head>
    <title>JSP's Objects</title>
    <LINK href="style.css" rel=stylesheet>
    <LINK href="newstyle.css" rel=stylesheet>
    <META HTTP-EQUIV="Content-Type"
    CONTENT="text/html ; charset=utf-8">
    </head>
    <body leftmargin="0" topmargin="0" >
    <tr><td></td><td><b>Tim kiem va Liet ket</b></td></tr>
    <form name=form1 action=ex4.jsp method=get>
    <table border=0>
    <tr>
    <td>Keyword: </td><td><input type=text name=keyword></td></tr>
    <tr><td></td><td><input type=submit value="Submit"></td></tr>
    </table>
    </form>
    </body>
    </html>
    Khi ngöôøi söû duïng nhaäp moät töø khoaù naøo ñoù vaø nhaán Sub

    [=========> Bổ sung bài viết <=========]

    Ñeå laáy giaù trò töø chuoãi QueryString, chuùng ta söû duïng phöông thöùc getParemeter cuûa ñoái töôïng request nhö ví duï 4-4.
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%
    huukhang@yahoo.com 3-4
    COMPUTER LEARNING CENTER WWW.HUUKHANG.COM
    // Laáy giaù trò keyword töø trang ex3.jsp
    String keyword=request.getParameter("keyword");
    // Laáy giaù trò sort töø trang QueryString
    String sort=request.getParameter("sort");
    %>
    <html>
    <head>
    <title>JSP</title>
    <LINK href="style.css" rel=stylesheet>
    <LINK href="newstyle.css" rel=stylesheet>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html ; charset=utf-8">
    </head>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <h4>Result</h4>
    <!--Khai baùo caùc link ñeå giöõ laïi keyword
    vaø khai baùo giaù trò cho tham soá sort-->
    <a href="ex4.jsp?keyword=<%=keyword%>&sort=ItemName"> ItemName</a>
    <a href="ex4.jsp?keyword=<%=keyword%>&sort=UnitPrice" >Unit Price</a>
    <br>
    <hr size=1><br>
    <%
    // xuaát giaù trò laáy ñöôïc
    out.println("Keyword is "+ keyword +"<br>");
    sort=(sort==null)?"ItemName":sort;
    out.println("Sort by " + sort +"<br>");
    %>
    </body>
    </html>
    Request

    [=========> Bổ sung bài viết <=========]

    Neáu username laø khang vaø password laø 123456 thì trang myaccount.jsp seõ ñöôïc trieäu goïi. Tröôùc khi trieäu goïi trang myaccount.jsp, chuùng ta khôûi taïo moät soá session duøng ñeå söû duïng cho phieân laøm vieäc naøy chaúng haïn userid, username, fullname, email nhö ví duï 5-2 (login_authentication.jsp).
    <%
    String username="";
    String password="";
    username= request.getParameter("username");
    password= request.getParameter("password");
    if (username.equals("khang")){
    if(password.equals("123456")){
    session.putValue("userid","123");
    session.putValue("username",username);
    session.putValue("fullname","huukhang.com");
    session.putValue("email","admin@huukhang.com");
    response.sendRedirect("myaccount.jsp");
    }
    else{
    /*sai password*/
    response.sendRedirect("login.jsp");
    }
    }
    else{
    /*sai user*/
    response.sendRedirect("login.jsp");
    }
    %>

    [=========> Bổ sung bài viết <=========]

    Ñeå laáy giaù trò töø caùc session khai baùo trong trang login_authentication.jsp vaø trình baøy treân trang myaccount.jsp, baïn khai baùo nhö ví duï 5-3.
    <%@ page contentType="text/html; charset=UTF-8" %>
    <html>
    <head>
    <title>JSP</title>
    <LINK href="style.css" rel=stylesheet>
    <LINK href="newstyle.css" rel=stylesheet>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html ; charset=utf-8">
    </head>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <table width="100%" border="0" cellspacing="5" cellpadding="5">
    <tr><td>
    <h4>Welcome to JSP</h4>
    </td></tr>
    <tr><td><a href="logout.jsp">logout</a></td></tr>
    <tr><td>userid: =<%=session.getValue("userid")%></td></tr>
    <tr><td>username: =<%=session.getValue("username")%></td></tr>
    <tr><td>fullname: =<%=session.getValue("fullname")%></td></tr>
    <tr><td>email: =<%=session.getValue("email")%>
    </td></tr>
    </table>
    </body>
    </html>

    [=========> Bổ sung bài viết <=========]

    Huyû session
    Sau khi khoâng söû duïng ñoái töôïng session, baïn caàn söû duïng phöông thöùc ñeå huyø session ñoù thaøy vì ñeå chuùng toàn taïi, bôûi ví neáu chuùng khoâng söû duïng maø vaãn toàn thì web server vaãn phaûi quaûnl lyù. Chaúng haïn, khi chuùng ta logout khoûi öùng duïng website thì trang logout.jsp seõ ñöôïc tieäu goïi, ba72ng caùch söû duïng caùc phöông thöùc removeValue ví duï 5-4.
    huukhang@yahoo.com 3-4
    COMPUTER LEARNING CENTER WWW.HUUKHANG.COM
    <%
    session.removeValue("userid");
    session.removeValue("username");
    session.removeValue("fullname");
    session.removeValue("email");
    response.sendRedirect("login.jsp");
    %>

    [=========> Bổ sung bài viết <=========]

    Nhö hình treân, khi session chöa taïo ra, neáu baïn truy caäp ñeán giaù trò cuûa chuùng thì giaù trò ñoù laø null, chính vì vaäy trong moät soá trang baét buoäc ngöôøi söû duïng phaûi ñaêng nhaäp roài môùi söû duïng thì baïn caàn phaûi kieåm tra session, neáu session baèng null thì troû ñeán trang login.jsp.
    Chaúng haïn trong tröôøng hôïp naøy chuùng ta coù ví duï 5-5, cho pheùp söû duïng khi ngöôøi söû duïng ñaõ ñaêng nhaäp, ñieàu naøy coù nghóa laø session coù teân userid phaûi toàn taïi.
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%
    if (session.getValue("userid")==null)
    response.sendRedirect("login.jsp");
    %>
    <html>
    <head>
    <title>JSP</title>
    <LINK href="style.css" rel=stylesheet> huukhang@yahoo.com 3-5
    COMPUTER LEARNING CENTER WWW.HUUKHANG.COM
    <LINK href="newstyle.css" rel=stylesheet>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html ; charset=utf-8">
    </head>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <table width="100%" border="0" cellspacing="5" cellpadding="5">
    <tr><td>
    <h4>Welcome to JSP</h4>
    </td></tr>
    </table>
    </body>
    </html>

    [=========> Bổ sung bài viết <=========]

    /*
    * Generated by MyEclipse Struts
    * Template path: templates/java/JavaClass.vtl
    */
    package org.batch27.struts.action;

    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;

    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.batch27.cmp.interfaces.CategoriesCMPData;
    import org.batch27.common.SessionBeanFactory;
    import org.batch27.session.interfaces.CategorySession;
    import org.batch27.struts.form.CreateCategoryForm;

    /**
    * MyEclipse Struts
    * Creation date: 12-05-2008
    *
    * XDoclet definition:
    * @struts.action path="/createCategory" name="createCategory" scope="request" validate="true"
    */
    public class CreateCategoryAdminAction extends Action {
    /*
    * Create record in Category table
    */

    /**
    * Method execute
    * @param mapping
    * @param form
    * @param request
    * @param response
    * @return ActionForward
    */
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
    HttpSession session = request.getSession();
    if (!session.getAttribute("isAdmin").equals("Admin") ) {
    System.out.println("You must login !");
    return mapping.findForward("index");
    }
    CreateCategoryForm createCategory = (CreateCategoryForm) form;
    String categoryID=createCategory.getCategoryID();
    String name=createCategory.getName();
    String type=createCategory.getType();
    try {
    CategorySession categorySession=SessionBeanFactory.getCategoryCMPR emoteObject();
    CategoriesCMPData category=new CategoriesCMPData();
    category.setCategoryID(categoryID);
    category.setName(name);
    category.setType(type);
    categorySession.addNewCategory(category);
    return mapping.findForward("success");
    } catch (Exception e) {

    e.printStackTrace();
    }

    return mapping.findForward("error");
    }
    }

    [=========> Bổ sung bài viết <=========]

    package org.batch27.struts.action;

    import java.util.Date;
    import org.apache.struts.action.Action;

    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.batch27.cmp.interfaces.ContactUsCMPData;
    import org.batch27.common.SessionBeanFactory;
    import org.batch27.session.interfaces.ContactUsSession;
    import org.batch27.struts.form.CreateContactUsForm;

    public class CreateContactUsAction extends Action{
    /*
    * Create record in ContactUs table
    */
    /**
    * Method execute
    * @param mapping
    * @param form
    * @param request
    * @param response
    * @return ActionForward
    */
    public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)
    {
    try {
    CreateContactUsForm contactus=(CreateContactUsForm)form;
    String contactUsID=contactus.getContactUsID();
    String name=contactus.getName();
    String email=contactus.getEmail();
    String title=contactus.getTitle();
    String content=contactus.getContent();
    ContactUsSession contactussession=SessionBeanFactory.getContactUsCM PRemoteObject();
    ContactUsCMPData contactusdata=new ContactUsCMPData();
    Date date = new Date();
    contactusdata.setContactUsID(contactUsID+date.getD ay()+date.getMonth()+date.getYear()+date.getHours( )+date.getMinutes()+date.getSeconds());
    contactusdata.setName(name);
    contactusdata.setEmail(email);
    contactusdata.setTitle(title);
    contactusdata.setContent(content);
    contactussession.addNewContactUs(contactusdata);
    } catch (Exception e) {

    e.printStackTrace();
    }
    return mapping.findForward("success");
    }


    }

    [=========> Bổ sung bài viết <=========]

    package org.batch27.struts.action;

    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;

    import org.apache.struts.action.Action;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;

    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.batch27.cmp.interfaces.CustomerCMPData;
    import org.batch27.common.SessionBeanFactory;
    import org.batch27.session.interfaces.CustomerSession;
    import org.batch27.struts.form.CreateCustomerForm;

    public class CreateCustomerAction extends Action {
    /*
    * Create customer in Customers table
    */
    /**
    * Method execute
    *
    * @param mapping
    * @param form
    * @param request
    * @param response
    * @return ActionForward
    */
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
    HttpSession session = request.getSession();
    CreateCustomerForm cusform = (CreateCustomerForm) form;

    try {
    if (cusform != null) {
    DateFormat dateFormatter = new SimpleDateFormat("dd/MM/yyyy");

    String customerID = cusform.getCustomerID();
    String employeeID = cusform.getEmployeeID();
    String fullname = cusform.getFullName();
    String gender = cusform.getGender();
    Date dob = dateFormatter.parse(cusform.getDob());
    String email = cusform.getEmail();
    String address = cusform.getAddress();
    String tel = cusform.getTel();

    CustomerCMPData data = new CustomerCMPData();
    CustomerSession cus;
    cus = SessionBeanFactory.getCusCMPRemoteObject();
    data.setFullName(fullname);
    if (cus.i***isted(data) == false) {
    Date date = new Date();
    data.setCustomerID(customerID + date.getDay()
    + date.getMonth() + date.getYear()
    + date.getHours() + date.getMinutes()
    + date.getSeconds());
    data.setEmployeeID(employeeID);
    data.setFullName(fullname);
    data.setGender(gender);
    data.setDob(dob);
    data.setEmail(email);
    data.setAddress(address);
    data.setTel(tel);
    cus.addNewCustomer(data);
    return mapping.findForward("success");
    }
    else{
    String alert = "Name is exited !";
    session.setAttribute("Check", alert);
    return mapping.findForward("error");
    }
    } else {
    return mapping.findForward("index");
    }
    } catch (Exception e) {
    e.printStackTrace();
    }
    return mapping.findForward("success");
    }
    }

    [=========> Bổ sung bài viết <=========]

    /*
    * Generated by MyEclipse Struts
    * Template path: templates/java/JavaClass.vtl
    */
    package org.batch27.struts.action;

    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;

    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;

    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.batch27.cmp.interfaces.EmployeeCMPData;
    import org.batch27.common.SessionBeanFactory;
    import org.batch27.session.interfaces.EmployeeSession;
    import org.batch27.struts.form.CreateEmployeeForm;

    /**
    * MyEclipse Struts
    * Creation date: 12-05-2008
    *
    * XDoclet definition:
    * @struts.action path="/editEmp" name="createemployee" scope="request" validate="true"
    * @struts.action-forward name="error" path="page.admin.editEmployeeError"
    * @struts.action-forward name="success" path="/viewEmployee.do"
    */
    public class EditEmpAdminAction extends Action {
    /*
    * Edit Employees table by employeeID
    */

    /**
    * Method execute
    * @param mapping
    * @param form
    * @param request
    * @param response
    * @return ActionForward
    */
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
    DateFormat dateFormatter = new SimpleDateFormat("dd/MM/yyyy");
    HttpSession session = request.getSession();
    if (!session.getAttribute("isAdmin").equals("Admin")) {
    System.out.println("You must login to View OrderDetail !");
    return mapping.findForward("index");
    }
    try {
    CreateEmployeeForm createemployee = (CreateEmployeeForm) form;
    String employeeID = createemployee.getEmployeeID();
    String roleID = createemployee.getRoleID();
    String password=createemployee.getPassword();
    String fullName=createemployee.getFullName();
    String gender=createemployee.getGender();
    Date dob = dateFormatter.parse(createemployee.getDob());
    String email=createemployee.getEmail();
    String address=createemployee.getAddress();
    String homePhone=createemployee.getHomePhone();
    String tel=createemployee.getTel();

    EmployeeSession empSession=SessionBeanFactory.getEmpCMPRemoteObjec t();
    EmployeeCMPData employeedata=new EmployeeCMPData();
    employeedata.setEmployeeID(employeeID);
    employeedata.setRoleID(roleID);
    employeedata.setPassword(password);
    employeedata.setFullName(fullName);
    employeedata.setGender(gender);
    employeedata.setDob(dob);
    employeedata.setEmail(email);
    employeedata.setAddress(address);
    employeedata.setHomePhone(homePhone);
    employeedata.setTel(tel);
    System.out.println("So dien thoai cua ban la "+tel);
    empSession.updateEmp(employeedata);
    return mapping.findForward("success");
    }catch (Exception e) {
    e.printStackTrace();
    }
    return mapping.findForward("error");
    }
    }

    [=========> Bổ sung bài viết <=========]

    //edit customer.jsp
    <link href="agency.css" rel="stylesheet" type="text/css" />
    <link href="calendar/dhtmlxcalendar.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript1.2" type="text/javascript" src='calendar/dhtmlxcalendar.js' ></script>
    <script language="JavaScript1.2" type="text/javascript" src='calendar/dhtmlxcommon.js' ></script>
    <script>
    window.dhx_globalImgPath="calendar/imgs/";
    </script>
    <script>
    var cal1, mCal, mDCal, newStyleSheet;

    var dateFrom = null;
    var dateTo = null;

    window.onload = function () {
    cal1 = new dhtmlxCalendarObject('calendar1', false, {isYearEditable: true});
    cal1.setYearsRange(1900, 2200);
    cal1.draw();
    cal1.setOnClickHandler(selectDate1);

    mCal = new dhtmlxCalendarObject('dhtmlxCalendar', false, {isYearEditable: true});
    mCal.setYearsRange(2000, 2500);
    mCal.draw();
    }

    function setFrom() {
    dateFrom = new Date(cal1.date);
    mCal.setSensitive(dateFrom, dateTo);
    return true;
    }

    function selectDate1(date) {
    document.getElementById('dob').value = cal1.getFormatedDate(null,date);
    document.getElementById('calendar1').style.display = 'none';
    dateTo = new Date(date);
    mCal.setSensitive(dateFrom, dateTo);
    return true;
    }



    function showCalendar(k) {
    document.getElementById('calendar'+k).style.displa y = 'block';
    }

    function phoneFormat(obj){newValue = obj.value.replace(/\D/g,'');
    if (newValue.length < 10 || newValue.length > 10){
    newValue = '';alert('Please enter a valid phone number ex : ***-***-***x');
    }
    if (newValue != '' && newValue.length == 10){
    newValue = "(" + newValue.substring(0,3) + ")" + newValue.substring(3,6) + "-" + newValue.substring(6,10);
    }
    return newValue;
    }

    </script>
    <%@ page language="java" pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

    <style type="text/css">
    <!--
    .style1 {
    color: #FF0000;
    font-size: 18px;
    }
    -->
    </style>
    <%String obj =(String) session.getAttribute("isLogin");
    String empobj =(String) session.getAttribute("isEmployee");
    if (obj != null && empobj.equals("Employee")){
    %>
    <html:javascript formName="CreateCustomerForm" dynamicJavascript="true" staticJavascript="true"/>
    <table width="564" border="0" cellpadding="0" cellspacing="0"
    background="images/bg_body.jpg" style="background-repeat:repeat-y">
    <tr>
    <th height="30" background="images/main_01.jpg" class="tieudebody"
    scope="col">
    EDIT CUSTOMER
    </th>
    </tr>
    <tr>
    <td height="613" align="left" valign="top"
    background="images/main_05.jpg" style="padding: 5px 15px;">
    <form name="CreateCustomerForm" method="post" action="editcustomer.do" onsubmit="return validateCreateCustomerForm(this);">
    <table width="100%" border="0" cellpadding="2" cellspacing="2">

    <tr>
    <td width="111" align="left" valign="top">&nbsp; </td>
    <td width="121" align="left" valign="top">&nbsp;</td>
    <td width="282" colspan="2" align="left" valign="top">
    <input name="customerID" type="hidden" id="customerID" value='<bean:write name="createcustomer" property="customerID" />'
    size="25" />
    <input name="employeeID" type="hidden" id="employeeID" value='<bean:write name="createcustomer" property="employeeID" />' size="25"
    readonly="true" /> </td>
    </tr>

    <tr>
    <td align="left" valign="top">&nbsp;</td>
    <td align="left" valign="top">Full Name : </td>
    <td align="left" valign="top">
    <input name="fullName" type="text" class="textfield" id="fullName" value='<bean:write name="createcustomer" property="fullName" />' size="25" /> </td>
    <html:errors property="fullName"/>
    </tr>
    <tr>
    <td align="left" valign="top">&nbsp;</td>

    <td align="left" valign="top">Gender : </td>
    <td align="left" valign="top">
    <html:radio name="createcustomer" value="Male" property="gender"/>
    Male
    <html:radio name="createcustomer" value="FeMale" property="gender"/>
    FeMale </td>
    </tr>
    <tr>
    <td align="left" valign="top">&nbsp;</td>
    <td align="left" valign="top">DOB : </td>
    <td align="left" valign="top">
    <input name="dob" type="text" class="textfield" id="dob" readonly="true" value='<bean:write name="createcustomer" property="dob" />' size="25" />
    <img src="calendar/imgs/calendar.gif" align="absmiddle" style="cursor:pointer;" onClick="showCalendar(1)" />
    <div id="calendar1" style="position:absolute;width:200px;height:115px; z-index:1;left: 433px;top: 403px; display:none"></div> </td>
    <html:errors property="dob"/>
    </tr>
    <tr>
    <td align="left" valign="top">&nbsp;</td>

    <td align="left" valign="top">Emai l: </td>
    <td align="left" valign="top">
    <input name="email" type="text" class="textfield" id="email" value='<bean:write name="createcustomer" property="email" />' size="25" /> </td>
    <html:errors property="email"/>
    </tr>
    <tr>
    <td align="left" valign="top">&nbsp;</td>
    <td align="left" valign="top">Address : </td>
    <td align="left" valign="top">
    <textarea name="address" class="textareas" id="address" rows="6"><bean:write name="createcustomer" property="address" /></textarea> </td>
    <html:errors property="address"/>
    </tr>
    <tr>
    <td align="left" valign="top">&nbsp;</td>

    <td align="left" valign="top">Tel : </td>
    <td align="left" valign="top">
    <input name="tel" type="text" class="textfield" id="tel" value='<bean:write name="createcustomer" property="tel" />' onblur=this.value=phoneFormat(this) maxLength=13 size=13 /></td>
    </tr>
    <tr>
    <td>&nbsp; </td>
    <td>&nbsp;</td>
    <td colspan="2" align="left" valign="top">
    <input name="submit" type="submit" class="button" id="submit" value="Submit" />
    <a href="viewcustomer.do"><img src="images/cancel.jpg" alt="Cancel" border="0" align="absmiddle" /></a> </td>
    </tr>
    </table>
    </form>
    </td>
    </tr>

    <tr background="images/bg_body.jpg">
    <td valign="top">
    <img src="images/main_09.jpg" width="564" height="10" /></td>
    </tr>

    </table>
    <%

    } else {
    %>
    <table width="564" border="0" cellpadding="0" cellspacing="0"
    background="images/bg_body.jpg" style="background-repeat:repeat-y">
    <tr>
    <th height="30" background="images/main_01.jpg" class="tieudebody"
    scope="col">
    ERROR
    </th>
    </tr>
    <tr>
    <td align="center" valign="top" background="images/main_05.jpg" height="613" style="padding-top:3px;padding-bottom:3px;padding-left:10px;padding-right:5px">
    <p>&nbsp;</p>
    <p><font size="2" color="blue">Please Login !
    </font>
    </td>
    </tr>

    <tr background="images/bg_body.jpg">
    <td valign="top">
    <img src="images/main_09.jpg" width="564" height="10" /></td>
    </tr>

    </table>
    <%}%>
    Được sửa bởi nhenden lúc 07:41 ngày 29-12-2009 Reason: Bổ sung bài viết

  9. #319
    Tham gia
    08-07-2008
    Bài viết
    3
    Like
    0
    Thanked 0 Times in 0 Posts
    //view customer.jsp

    <link href="agency.css" rel="stylesheet" type="text/css" />
    <%@ page language="java" pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <style type="text/css">
    <!--
    .style20 {font-size: 10px; font-family: Verdana, "Times New Roman", Tahoma; }
    .style22 {font-size: 10; }
    -->
    </style>
    <%String obj =(String) session.getAttribute("isLogin");
    String empobj =(String) session.getAttribute("isEmployee");
    if (obj != null && empobj.equals("Employee")){
    %>
    <table width="564" border="0" cellpadding="0" cellspacing="0"
    background="images/bg_body.jpg" style="background-repeat:repeat-y">
    <tr>
    <th height="30" background="images/main_01.jpg" class="tieudebody"
    scope="col">
    CUSTOMER </th>
    </tr>
    <tr>
    <td align="center" valign="top" height="613"
    background="images/main_05.jpg" style="padding: 5px 8px 0px 15px;">
    <table width="100%" class="tablebody">
    <tr>
    <td align="right">
    <table width="100%" border="0" cellpadding="1" cellspacing="1">
    <tr bgcolor="#777777">
    <th width="20%" height="25" align="center" bgcolor="#FF9933" scope="col">NAME</th>
    <th width="11%" align="center" bgcolor="#FF9933" scope="col">GENDER</th>
    <th width="34%" align="center" bgcolor="#FF9933" scope="col">
    <span class="style20">ADDRESS</span> </th>
    <th width="11%" align="center" bgcolor="#FF9933" scope="col">EMAIL</th>
    <th width="7%" align="center" bgcolor="#FF9933" scope="col">
    <span class="style20">TEL</span> </th>
    <th colspan="2" align="center" bgcolor="#FF9933" scope="col"></th>
    </tr>
    <logic:present name="listcustemp">
    <logic:iterate id="itemcus" name="listcustemp">
    <tr>
    <td align="center" bgcolor="#FFCF31" class="style20">
    <bean:write name="itemcus" property="fullName" /></td>
    <td align="center" bgcolor="#EEEEEE" class="style20">
    <bean:write name="itemcus" property="gender" /></td>
    <td align="center" bgcolor="#FFCC33" class="style20">
    <bean:write name="itemcus" property="address" /></td>
    <td align="center" bgcolor="#EEEEEE" class="style20"><img src="images/email.png" title='<bean:write name="itemcus" property="email" />' width="50" height="20" /></td>
    <td align="center" bgcolor="#EEEEEE" class="style20">
    <img src="images/tel.png" title='<bean:write name="itemcus" property="tel" />' /></td>
    <td width="9%" align="center" bgcolor="#FFCC33" class="style20"><html:link action="vieweditcustomer.do?action=edit&customerID =${itemcus.customerID}">Edit</html:link></td>
    <td width="8%" align="center" bgcolor="#FFCC33" class="style20"><html:link action="deletecustomer.do?action=delete&customerID =${itemcus.customerID}">Delete</html:link></td>
    </tr>
    </logic:iterate>
    </logic:present>
    </table>
    </td>
    </tr>
    </table>
    </td>
    </tr>

    <tr background="images/bg_body.jpg">
    <td valign="top"><img src="images/main_09.jpg" width="564"/></td>
    </tr>
    </table>
    <%
    }else{
    %>
    <table width="564" border="0" cellpadding="0" cellspacing="0"
    background="images/bg_body.jpg" style="background-repeat:repeat-y">
    <tr>
    <th height="30" background="images/main_01.jpg" class="tieudebody"
    scope="col">
    ERROR
    </th>
    </tr>
    <tr>
    <td align="center" valign="top" background="images/main_05.jpg" height="613" style="padding-top:3px;padding-bottom:3px;padding-left:10px;padding-right:5px">
    <p>&nbsp;</p>
    <p><font size="2" color="blue">Please Login !
    </font>
    </td>
    </tr>

    <tr background="images/bg_body.jpg">
    <td valign="top">
    <img src="images/main_09.jpg" width="564" height="10" /></td>
    </tr>

    </table>
    <%}%>

    [=========> Bổ sung bài viết <=========]

    //registerAction

    package suongtra;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.*;
    import org.omg.CORBA.Request;

    import suongtra.RegisterForm;


    import javax.servlet.http.*;
    public class RegisterAction extends Action{
    public ActionForward execute (ActionMapping mapping,ActionForm form,
    HttpServletRequest req,HttpServletResponse res){
    RegisterForm rtf=(RegisterForm) form;
    String hoten=rtf.getHoten();
    String gioitinh=rtf.getGioitinh();
    String tuoi=rtf.getTuoi();
    String tendangnhap=rtf.getTendangnhap();
    String matkhau=rtf.getMatkhau();
    String cauhoibimat=rtf.getCauhoibimat();
    String traloi=rtf.getTraloi();
    String sothich=rtf.getSothich();

    req.setAttribute("hoten", hoten);
    req.setAttribute("gioitinh", gioitinh);
    req.setAttribute("tuoi", tuoi);
    req.setAttribute("tendangnhap", tendangnhap);
    req.setAttribute("matkhau", matkhau);
    req.setAttribute("cauhoibimat", cauhoibimat);
    req.setAttribute("traloi", traloi);
    req.setAttribute("sothich", sothich);

    return mapping.findForward("success");

    }
    }

    [=========> Bổ sung bài viết <=========]

    //RegisterForm

    package suongtra;

    import org.apache.struts.action.ActionForm;

    public class RegisterForm extends ActionForm{
    private String hoten;
    public String getHoten() {
    return hoten;
    }
    public void setHoten(String hoten) {
    this.hoten = hoten;
    }
    public String getGioitinh() {
    return gioitinh;
    }
    public void setGioitinh(String gioitinh) {
    this.gioitinh = gioitinh;
    }
    public String getTuoi() {
    return tuoi;
    }
    public void setTuoi(String tuoi) {
    this.tuoi = tuoi;
    }
    public String getTendangnhap() {
    return tendangnhap;
    }
    public void setTendangnhap(String tendangnhap) {
    this.tendangnhap = tendangnhap;
    }
    public String getMatkhau() {
    return matkhau;
    }
    public void setMatkhau(String matkhau) {
    this.matkhau = matkhau;
    }
    public String getCauhoibimat() {
    return cauhoibimat;
    }
    public void setCauhoibimat(String cauhoibimat) {
    this.cauhoibimat = cauhoibimat;
    }
    public String getTraloi() {
    return traloi;
    }
    public void setTraloi(String traloi) {
    this.traloi = traloi;
    }
    public String getSothich() {
    return sothich;
    }
    public void setSothich(String sothich) {
    this.sothich = sothich;
    }
    private String gioitinh;
    private String tuoi;
    private String tendangnhap;
    private String matkhau;
    private String cauhoibimat;
    private String traloi;
    private String sothich;



    }

    [=========> Bổ sung bài viết <=========]

    //home.html

    <%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    Welcome to my homepage<br>
    <html:link href="register2.jsp">Nhan vao day de dang ki</html:link>

    [=========> Bổ sung bài viết <=========]

    //register.jsp

    <%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>



    <form:form action="/RegisterAction">
    Thong tin chi tiet<br>
    Ho ten : <html:text property="hoten"></html:text><br>
    Gioi tinh : <html:text property="gioitinh"></html:text><br>
    Tuoi : <html:text property="tuoi"></html:text><br>
    Thong tin tai khoan<br>
    Ten dang nhap : <html:text property="tendangnhap"></html:text><br>
    Mat khau : <html:text property="matkhau"></html:text><br>
    Cau hoi bi mat : <html:select property="cauhoibimat">
    <html:option value="Ten truong cap 1?"></html:option>
    <html:option value="Con vat ban yeu thich?"></html:option>
    <html:option value="Ten ban gai dau tien?"></html:option>
    </html:select>
    Tra loi : <html:text property="traloi"></html:text><br>
    So thich
    Tra loi : <html:textarea property="sothich"></html:textarea><br>
    <form:submit>Register</form:submit>
    <form:reset>Reset</form:reset>
    </form:form>

    [=========> Bổ sung bài viết <=========]

    //result.jsp

    <%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <form:form action="/RegisterAction">
    Thong tin chi tiet<br>
    <% if(!request.getAttribute("hoten").equals(""))
    {
    %>
    Ho ten:<%=request.getAttribute("hoten") %>
    <%
    }
    else
    {
    %>Ho ten:<html:text property="hoten"></html:text><br><%
    }%><br>


    <% if(!request.getAttribute("gioitinh").equals(""))
    {
    %>
    Gioi tinh :<%=request.getAttribute("gioitinh") %>
    <%
    }
    else
    {
    %>Gioi tinh :<html:text property="gioitinh"></html:text><br><%
    }%><br>


    <% if(!request.getAttribute("tuoi").equals(""))
    {
    %>
    Tuoi:<%=request.getAttribute("tuoi") %>
    <%
    }
    else
    {
    %>Tuoi :<html:text property="tuoi"></html:text><br><%
    }%><br>

    Thong tin tai khoan<br>
    <% if(!request.getAttribute("tendangnhap").equals("") )
    {
    %>
    Ten dang nhap :<%=request.getAttribute("tendangnhap") %>
    <%
    }
    else
    {
    %>Ten dang nhap :<html:text property="tendangnhap"></html:text><br><%
    }%><br>

    <% if(!request.getAttribute("matkhau").equals(""))
    {
    %>
    Mat khau :<%=request.getAttribute("matkhau") %>
    <%
    }
    else
    {
    %>Mat khau :<html:text property="matkhau"></html:text><br><%
    }%><br>

    <% if(!request.getAttribute("cauhoibimat").equals("") )
    {
    %>
    Cau hoi bi mat :<%=request.getAttribute("cauhoibimat") %>
    <%
    }
    else
    {
    %>Cau hoi bi mat :<html:text property="cauhoibimat"></html:text><br><%
    }%><br>
    <% if(!request.getAttribute("traloi").equals(""))
    {
    %>
    Tra loi :<%=request.getAttribute("traloi") %>
    <%
    }
    else
    {
    %>Tra loi :<html:text property="traloi"></html:text><br><%
    }%><br>
    So thich
    <% if(!request.getAttribute("sothich").equals(""))
    {
    %>
    So thich :<%=request.getAttribute("sothich") %>
    <%
    }
    else
    {
    %>So thich :<html:text property="sothich"></html:text><br><%
    }%><br>
    <form:submit>Tiep tuc dang ki</form:submit>
    <form:reset>Reset</form:reset>


    </form:form>
    Được sửa bởi nhenden lúc 15:14 ngày 29-12-2009 Reason: Bổ sung bài viết

  10. #320
    Tham gia
    29-10-2008
    Bài viết
    21
    Like
    0
    Thanked 0 Times in 0 Posts
    - Họ tên: Nguyễn Thúy Hồng
    - Địa chỉ (option): Đại học Thủy Lợi Hà Nội
    - Email: thuyhong47th@yahoo.com
    - YM: thuyhong47th
    - Nghê nghiệp: Sinh viên IT
    - Trình độ Java: ở mức độ cơ bản
    - Mục đích gia nhập :Tôi muốn trao đổi để hiểu thêm về Java
    - Những đóng góp :
    - Yêu cầu trợ giúp :Tôi đang vướng mắc về vấn đề : Tìm kiếm hình ảnh bằng Java. Cụ thể như sau: Khi tôi có một hình ảnh nào đó,chỉ cần tôi bấm nút Search thì tất cả các hình ảnh trong CSDL tương đồng với ảnh này sẽ được hiện lên
    - Các mặt mạnh :
    - Các mặt còn yếu :Xử lý ảnh trong Java

Trang 32 / 37 FirstFirst ... 2729303132333435 ... LastLast

Bookmarks

Quy định

  • Bạn không thể tạo chủ đề mới
  • Bạn không thể trả lời bài viết
  • Bạn không thể gửi file đính kèm
  • Bạn không thể sửa bài viết của mình
  •