跳转到发帖页classid有值 到下面就为空了 该怎么写啊
//跳转到发帖页
}else if(method.equals("sendoutarticle")){
String Classid = request.getParameter("classid");
System.out.println("ppID"+request.getParameter("classid"));
BBSService us = new BBSService();
ArrayList article = us.getAllSpecial();
System.out.println("营业员"+article);
request.getSession().setAttribute("article",article);
request.getRequestDispatcher("/SendOutArticle.jsp").forward(request, response);
//帖子写完后实现上传
}else if(method.equals("send")){
Article article = new Article();
String classid = request.getParameter("classid");
System.out.println("classID"+request.getParameter("classid"));
UserInfo userInfo = (UserInfo)request.getSession().getAttribute("userinfo");
article.setTitle(request.getParameter("title"));
article.setContent(request.getParameter("content"));
article.setUserid(userInfo.getId());
article.setClassid(Special.grtClassid());
System.out.println("yyy栏目ID"+Special.grtClassid());
System.out.println("我的ID"+userInfo.getId());
article.setAuthor(userInfo.getUsername());
BBSService bs = new BBSService();
boolean result = bs.SendOutArticle(article);
System.out.println("帖子"+article);
if(result){
request.getRequestDispatcher("/SendArticleTo.jsp").forward(request, response);
}else{
request.getRequestDispatcher("/Error.jsp").forward(request, response);
}
------解决方案--------------------把参数再带下去/SendArticleTo.jsp?classid=1
------解决方案--------------------楼上正解,在url上面把参数传过去