Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Servlet/JSP/JSF/JavaFX Script  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
reply to postflat modethreaded modego to previous topicgo to next topicgo to back
作者 JBulder中JSP与actionForm的数据传输问题
corelwing





发贴: 2
于 2005-06-02 09:53 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
请各位帮帮忙!
我采用的开发工具是JBuider2005 update4,JDK1.5.0,服务器是:JBoss4.01,数据库是MySql4.1.11,采用J2EE架构。
  我现在已经做好了EJB和action、actionForm,其中EJB和action已经测试成功。现在的问题是在这个JSP页面中写代码时用到的是数组循环显示,在其中我要添加一个链接,用于传递一个参数值到actionForm中,我现在在用的方法在以前bean write显示时用到的方法一样的,在那里是可以的,但在这就不行了。它不能将数据传输到Form,action返回的值为空。怎样解决这个问题?请各位指教!

代码如下:其中findkCategoryAction1的作用是:按actionForm传递过来的参数查找数据库中kCategory参数值相同的记录并将结果返回给Form。

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.util.Enumeration" %>
<%@ page import="java.util.ArrayList" %>

<html>
<head>
<title>新闻分类</title>
<style type="text/css">
<!--
body {
  background-image: url(images/BG.jpg);
}
.style1 {
  font-family: "宋体";
  font-size: medium;
  color: #0000FF;
  font-style: italic;
}
-->
</style>
<script src="bws_chk.js" type="text/javascript"></script>
<script src="tv_cnt.js" type="text/javascript"></script>
</head>

<body>

<script type="text/javascript">
USEFRAMES = 1;
HIGHLIGHT = 1;
USETEXTLINKS = 1; //replace 0 with 1 for hyperlinks
STARTALLOPEN = 0; //replace 0 with 1 to show the whole tree
ICONPATH = 'images/'; //change if the gif's folder is a subfolder, for example: 'images/'
foldersTree = gFld("<i>fenlei</i>");
KCategory =insFld(foldersTree,gFld("all"));
</script>
<%
StringBuffer s= new StringBuffer();
s.append("<script type=\"text/javascript\">");
ArrayList rsl=(ArrayList)request.getAttribute("Messages");
for(java.util.Iterator iter=rsl.iterator();iter.hasNext()Wink
{
String str = (String)iter.next();
s.append("insFld(KCategory,gFld(\"");
s.append(str);
s.append("\",'\findkCategoryAction1.do?KCategory=");
s.append(str);
s.append("'));");

}
s.append("initializeDocument();</script>");
out.printMoon;
%>
</body>
</html>

其中, s.append("\",'\findkCategoryAction1.do?KCategory=");
s.append(str);
s.append("'));");
就是用来链接的。




话题树型展开
人气 标题 作者 字数 发贴时间
2555 JBulder中JSP与actionForm的数据传输问题 corelwing 2233 2005-06-02 09:53
2063 Re:JBulder中JSP与actionForm的数据传输问题 YuLimin 44 2005-06-17 08:56

reply to postflat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923