It is my Computer Notes. Using Guide : object-key or object-key-key e.g. Step 1 Blog Search : [mysql-run] and then Step 2 ctrl+F [mysql-run] {bookMark me : Ctrl+D}
2013年12月5日 星期四
java-javabean servlet-javabean
java get javabean
servlet get javabean
Showparameters.java
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import com.hr.utils.CompanyProfile;
public class ShowParameters extends HttpServlet {
static tableWrite2 MySql = new tableWrite2();
CompanyProfile CompanyProfile=new CompanyProfile();
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
out.println(CompanyProfile.getCompanyName());
}
}
CompanyProfile.java //<< BEAN
package com.hr.utils;
import java.util.Date;
public class CompanyProfile implements java.io.Serializable {
protected static String companyName;
public CompanyProfile(){}
public void setCompanyName(String newValue){companyName = newValue;}
public String getCompanyName(){return companyName;}
}
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言