pictrueclass.jsp页面(pictrueclass.html是转后的)
<form name="w" action="saveXiangCe.htm?" method="post" target="_parent" onSubmit="return CheckForm();">
<div class="blogname"><h3><a href="#" target="_blank">我要提问</a></h3>创建相册分类名称:<input type="text" name="siteinfo" maxlength="12" /><span>最大长度为12个汉字</span></div>
<button type="submit">保存</button><button type="reset">取消</button>
</form>我在action里面写了
String siteinfo=request.getParameter("siteinfo");
Company com=this.companBiz.byLoginUser(request.getSession().getAttribute("username").toString());
String Time=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new java.util.Date());
BlogXiangCe blogXiangCe=new BlogXiangCe();
blogXiangCe.setCompany(com);
blogXiangCe.setXxiangCe(siteinfo);
blogXiangCe.setXtime(Time);
this.blogXiangCeBiz.save(blogXiangCe);
response.sendRedirect("blog/system/pictrueclass.html");
applicationContext.xml 里面的设置
<bean name="/saveXiangCe" class="com.fanna.struts.action.ToBlogSaveXiangCAction">
<property name="blogArticlesBiz" ref="blogArticlesBiz"></property>
<property name="blogXiangCeBiz" ref="blogXiangCeBiz"></property>
<property name="companBiz" ref="companyBiz"></property>
</bean>是保存进去了,就下面不显示!我在怎么弄下让它下面刷出来!!!!!在线等!!

解决方案 »

  1.   

    额 不明白 你想怎么个刷法?? 在pictrueclass.html上显示??
      

  2.   

    response.sendRedirect("blog/system/pictrueclass.html");
    好像是servlet的写法,struts貌似不可以这么用。
      

  3.   

    你试下:request.getRequestDispatcher("blog/system/pictrueclass.html").forward(request,response);
    带有数据的转发;是servlet的写法,如果用struts你在struts-config.xml中有没有forward转发路径;
    有的话直接mapping.findForward("path_name");