productsaction.java
来自「交易撮合系统是一套买卖信息沟通的平台」· Java 代码 · 共 46 行
JAVA
46 行
package struts.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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 dao.OffersDao;
import domain.Offers;
import domain.TitleLei;
public class ProductsAction extends Action{
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request ,HttpServletResponse response){
String productname = request.getParameter("ming");
String name = null;
try{
name = new String(productname.getBytes("ISO-8859-1"),"GBK");
System.out.println(name + "");
}catch(Exception e){
e.printStackTrace();
}
OffersDao ofo = new OffersDao();
List<Offers> olist = ofo.getElements(name);
ofo.changeHits(name);
int productsid = olist.get(0).getProductsid();
List<TitleLei> tlist = ofo.chaCha(productsid);
System.out.println(" my size is "+tlist.size());
request.getSession().setAttribute("keyi", tlist);
request.getSession().setAttribute("olist", olist);
return mapping.findForward("gentie");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?