我其中有一个Servlet技术的一个了HTTPClient在它配置 - 宣布GetMethod它调用Servlet的B(基本合格的URL的Servlet B的构造函数”Servlet会话了HTTPClient
在Servlet的BI正在设置一些会话。 VAR和当在Servlet甲回来进行控制的“执行”的方法之后,但是在会话中乏的Servlet乙设定正在返回空。
的Servlet甲
doPost(req,res)
{
HTTPClient client = new HTTPClient();
GetMethod get = new GetMethod("/ServletB.do");
client.execute(get);
System.out.println("Value of a is :: " + session.getAttribute("a")) ; //gives a NULL
}
的Servlet乙
doPost(req,res)
{
HTTPSession session = req.getSession();
session.setAttibute("a",a);
session.setAttibute("b",b);
}
您能否让我知道我的选择在这里解决这个问题?