打开首页的时候,怎样做才能向struts2的action提交请求,使left.jsp和main.jsp得到数据库的数据
首页代码:
index.html<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<title>Shopping Online</title>
</head><frameset rows="21,*,63" framespacing="0" border="0" frameborder="0">
  <frame name="top" scrolling="no" noresize target="contents" src="top.html" marginwidth="0" marginheight="0">
  <frameset cols="183,*">
    <frame name="contents" target="main" src="left.html" scrolling="no">
    <frame name="main" src="main.jsp">
  </frameset>
  <frame name="bottom" scrolling="no" noresize target="contents" src="bottom.html">
  <noframes>
  <body>
  
  </body>
  </noframes>
</frameset>打开首页的时候,怎样做才能向struts2的action提交请求,使left.jsp和main.jsp得到数据库的数据

解决方案 »

  1.   

    struts不知道,一般用javabean,或者ajax填充,如果你用jsf的话,就比较方便了,backbean可以轻松搞定。
      

  2.   

    <frame name="contents" target="main" src="action的路径" scrolling="no">
      

  3.   

    <%@ taglib prefix="s" uri="/struts-tags" %>
    <html>
      <head>
      <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
      <title>Shopping Online</title>
      </head>  <frameset rows="21,*,63" framespacing="0" border="0" frameborder="0">
      <frame name="top" scrolling="no" noresize target="contents"
      src="top.html" marginwidth="0" marginheight="0">
      <frameset cols="183,*">
      <frame name="contents" target="main" src="<s:url action="请求名1" namespace="命名空间" />" scrolling="no">
      <frame name="main" src="<s:url action="请求名2" namespace="命名空间" />">
      </frameset>
      <frame name="bottom" scrolling="no" noresize target="contents"
      src="bottom.html">
      <noframes>
      <body>  </body>
      </noframes>
      </frameset></html>
      

  4.   

    在struts.xml中写个到main.jsp的请求路径<result name="main">/main.jsp</result>,然后把<frame name="main" src="main.action">改成这样,应该可以拿到main.jsp的值,至于left.jsp,也可以这样请求。