一个小问题~~急!!~~万分感谢~~
boolean b = false;
for(Collection c:cList){
if(c!=null&&c.getISBN().equals(isbn)){
b = true;
break;
}
}
if(b){
request.setAttribute("colcheak","已收藏过该商品!!");
return XXXXXX
我想在return后面画X的地方调用buy.do?isbn=<bean:write name="goods" property="ISBN"/>方法,java页面的语法应该怎么写??万分感谢~~~
------解决方案--------------------RequestDispatcher rd = request.getRequestDispatcher("/buy.do");
rd.forward(request, response);
------解决方案--------------------在你return的地方可以直接方法啊
buy.do?isbn=${goods.ISBN}
------解决方案--------------------response.sendRedirect("/buy.do?isbn=test1111");
或者
request.getRequestDispatcher("/buy.do?isbn=test1111").forward(request,response);
------解决方案--------------------strust1:
request.getRequestDispatcher("/buy.do?isbn=test1111").forward(request,response);
strust2:
<action name="xx" class="xx"
method="xx">
<result type="chain" name="buy">buy</result>
....
</action>
<action name="buy" class="xx"
method="xx">
<result >/xx.jsp</result>
....
</action>