请教一个struts问题,谢谢!急............

xuancao 2005-03-23 10:02:17
我想在ACTION操作结束返回到一个没有在struts-config.xml配置的JSP 文件,请问该如何实现??
因为我那个JSP是动态生成的,
我起初的想法:通过ACTION返回到一个通用的servlet,再在servlet实现页面流转.不知这方案是否可行,谢谢!
...全文
116 点赞 收藏 13
写回复
13 条回复
xuancao 2005年08月23日
<%@ page contentType="text/html; charset=gb2312"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<html>
<head>
<title>错误!</title>
<%
String context =request.getContextPath();
%>
<script language="JavaScript" type="text/JavaScript">
<!--
var doURL = "#";

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

</head>

<body leftMargin=0 background="<%= context %>/images/back.gif" topMargin=0 marginheight="0" marginwidth="0" >
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="70%" align="left" class="t24"></td>
<td width="30%" align="center" class="t14"><a href="#">帮助</a></td>
</tr>
<tr>
<td colspan="2" align="center" class="t24"></td>
</tr>
<tr>
<td colspan="2" align="center" class="t12"><table width="92%" height="105" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td class="t14" align="center">
<html:errors/>
<logic:present name="Error">
<bean:write name="Error"/>
</logic:present>

<logic:notPresent name="Error">
系统出错! 请与管理员联系。
</logic:notPresent>
</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" align="center" class="t24"></td>
</tr>
<tr>
<td colspan="2" align="center" class="t24"> </td>
</tr>

</table>
<br>
<br>
<center>
<table>

<a herf="<%= context %>/login/index.jsp" ><p align="center"><font color="#FF0000" size="4">返回</font></p></a>

</table>
</center>

</body>
</html>

回复 点赞
xuancao 2005年08月22日
<Connector
port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" URIEncoding="GBK" />
回复 点赞
xuancao 2005年08月22日
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<%@ 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/ictrade.tld" prefix="ictrade"%>
<ictrade:CheckRightTag module="产品信息" page="CPXX" operate="add"/>
<%
String context =request.getContextPath();
%>

<link href="<%= context %>/css/blue.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<%= context %>/js/common.js"></script>
<script language='javascript'>
function retbtn(){
document.forms[0].action="<%= context %>/repertory/product/ProductAction.do?method=listPage";
document.forms[0].submit();
}

function savebtn() {
var form = document.forms[0];
if (isDecimal(form.in_price)==false) return false;
init(form);
form.action="<%= context %>/repertory/product/ProductAction.do?method=save";
form.submit();
}
function saveretbtn() {
var form = document.forms[0];
if (isDecimal(form.in_price)==false) return false;
init(form);
form.submit();
}
function init(obj){
getText(form.type_id,form.type_name);
getText(form.type_id,form.chn_name);
getText(form.type_id,form.price_name);
getText(form.type_id,form.encap_name);
getText(form.type_id,form.manufacture_name);
getText(form.type_id,form.batch_name);
}
function getText(objId,ojbName){
var iIndex = objId.selectedIndex;
ojbName.value = objSel.options[iIndex].text;
}
</script>
<title>库存管理-新增库存信息</title>

<html>
<body class="bodybg">
<html:form method="post" action="/repertory/product/ProductAction.do?method=add">
<html:hidden property="product_id" />
<html:hidden property="type_name" />
<html:hidden property="chn_name" />
<html:hidden property="price_name" />
<html:hidden property="encap_name" />
<html:hidden property="manufacture_name" />
<html:hidden property="batch_name" />
<div align="center">
<center>
<br>
<table align="center" width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" colspan="2"><span class="TableTitleText">库存信息管理</span></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<table align="center" border="0" cellpadding="1" cellspacing="5" class="addwin">
<tr>
<td align="center">
<table width="400" align="center" cellpadding="3" cellspacing="1" border="0" class="Tablebgcccccc">

<tr class="listcellrow" height="23" >
<td nowrap class="InputLabelCell">产品型号:</td>
<td width="312" nowrap class="Tdwhite">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<html:select name="ProductForm" property="type_id" styleClass="input">
<html:options collection="TypeList" property="type_id" labelProperty="type_name"/>
</html:select>
</td>
</tr>
</table>
</td>
</tr>
<tr class="listcellrow" height="23" >
<td nowrap class="InputLabelCell">供应商:</td>
<td width="312" nowrap class="Tdwhite">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<html:select name="ProductForm" property="client_id" styleClass="input">
<html:options collection="ClientList" property="client_id" labelProperty="chn_name"/>
</html:select>
</td>
</tr>
</table>
</td>
</tr>
<tr class="listcellrow" height="23" >
<td nowrap class="InputLabelCell">封装名:</td>
<td width="312" nowrap class="Tdwhite">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<html:select name="ProductForm" property="encap_id" styleClass="input">
<html:options collection="EncapList" property="encap_id" labelProperty="encap_name"/>
</html:select>
</td>
</tr>
</table>
</td>
</tr>
<tr class="listcellrow" height="23" >
<td nowrap class="InputLabelCell">制造商:</td>
<td width="312" nowrap class="Tdwhite">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<html:select name="ProductForm" property="manufacture_id" styleClass="input">
<html:options collection="ManufactureList" property="manufacture_id" labelProperty="manufacture_name"/>
</html:select>
</td>
</tr>
</table>
</td>
</tr>
<tr class="listcellrow" height="23" >
<td nowrap class="InputLabelCell">批号:</td>
<td width="312" nowrap class="Tdwhite">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<html:select name="ProductForm" property="batch_id" styleClass="input">
<html:options collection="BatchList" property="batch_id" labelProperty="batch_name"/>
</html:select>
</td>
</tr>
</table>
</td>
</tr>
<tr class="listcellrow" height="23" >
<td nowrap class="InputLabelCell">货币单位:</td>
<td width="312" nowrap class="Tdwhite">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<html:select name="ProductForm" property="price_id" styleClass="input">
<html:options collection="PriceList" property="price_id" labelProperty="price_name"/>
</html:select>
</td>
</tr>
</table>
</td>
</tr>
<tr class="listcellrow" height="23" >
<td nowrap class="InputLabelCell">进价:</td>
<td nowrap class="Tdwhite"><html:text styleClass="input2" property="in_price" maxlength="16" size="50" dateType="float"/></td>
</tr>
<tr class="listcellrow" height="23" >
<td nowrap class="InputLabelCell">数量:</td>
<td nowrap class="Tdwhite"><html:text styleClass="input2" property="number" maxlength="5" size="50" onkeydown="checknum(this)" dateType="int"/></td>
</tr>
<tr class="listcellrow" height="23" >
<td nowrap class="InputLabelCell">描述:</td>
<td nowrap class="Tdwhite"><html:text styleClass="input2" property="description" maxlength="20" size="50"/></td>
</tr>
<tr class="listcellrow" height="23" >
<td nowrap class="InputLabelCell">日期:</td>
<td nowrap class="Tdwhite"><html:text styleClass="input2" property="reg_date" maxlength="20" size="50" readonly="true" onclick="getdate(this)" dateType="date"/></td>
</tr>
<tr class="listcellrow" height="23" >
<td nowrap class="InputLabelCell">电话:</td>
<td nowrap class="Tdwhite"><html:text styleClass="input2" property="tel" maxlength="20" size="50"/></td>
</tr>
<tr class="listcellrow" height="23" >
<td nowrap class="InputLabelCell">备注:</td>
<td nowrap class="Tdwhite"><html:textarea styleClass="input2" cols="48" rows="4" property="remark"/></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="23">
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="button" name="save" styleClass="button" style="width:50" value="保存" onclick='savebtn();'/>
<input type="button" name="subbtn" styleClass="button" style="width:100" value="保存返回" onclick='saveretbtn();'/>
<input type="button" styleClass="button" style="width:50" name="retbutn" value="返回" onclick='retbtn();'></td>
</tr>
</table>
</center>
</div>
</html:form>
</form>
</body>
</html>
回复 点赞
mingr6370 2005年08月11日
mark
回复 点赞
xuancao 2005年08月09日
/*Á´½Ó×ÖÌåÑ¡ÖÐ״̬*/
a.link4:link {
font-size: 12px;
color: #000000;
font-family: "ËÎÌå";
text-decoration: none;
}
a.link4:visited {
font-size: 12px;
color: #000000;
font-family: "ËÎÌå";
text-decoration: none;
}
a.link4:hover {
font-size: 12px;
color: #FF6600;
font-family: "ËÎÌå";
text-decoration: none;
}
回复 点赞
xuancao 2005年08月05日
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2005</p>
* <p>Company: GuangDong GEVER GEVER TECH CO.LTD</p>
* @author 李冉冉
* Created on 2005-8-3
* @version 1.0
*/
package com.carry.ictrade.dataimport.dao.impl;

import com.carry.ictrade.dataimport.dao.DataImportDAO;
import com.carry.ictrade.dataimport.dao.DataImportFactory;


public class DataImportFactoryImpl extends DataImportFactory{

/* (non-Javadoc)
* @see com.carry.ictrade.exceltodb2.dao.ExlToDB2Factory#getExlToDB2DAO()
*/
public DataImportDAO getExlToDB2DAO() {
// TODO Auto-generated method stub
return new ExlToDB2DAOImpl();
}

}
回复 点赞
mingxuan3000 2005年03月23日
学习
回复 点赞
jFresH_MaN 2005年03月23日
request.getRequestDispatch("....").forward(request,response);
回复 点赞
jFresH_MaN 2005年03月23日
没有必要!
为什么大家都被struts的架构束缚了呢?
response.sendRedirect("...");就行了啊
回复 点赞
zeq258 2005年03月23日
关注!
回复 点赞
fingertiploneliness 2005年03月23日
ActionForward af = new ActionForward("/xx/xxx.jsp");
return af;
回复 点赞
fingertiploneliness 2005年03月23日
ActionForward af = new ActionForward("/xx/xxx.jsp");
return af;
回复 点赞
KillAllError 2005年03月23日
同意jFresH_MaN(The answer is ......)(静下心来研究Tiger) 的,呵呵!
你觉得Tiger怎么样?
回复 点赞
发动态
发帖子
Java EE
创建于2007-09-28

3.7w+

社区成员

22.5w+

社区内容

J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区公告
暂无公告