<html:link page="/login_success.do">
不用在golbal中配置aaction的,只在你的ationmapping 中配置即可,当然你的web.xml要配置对。
不用在golbal中配置aaction的,只在你的ationmapping 中配置即可,当然你的web.xml要配置对。
解决方案 »
- google map API中,iconAnchor 是什么意思
- 请教:Hibernate 中的attachDirty,attachClean,merge之间的区别?????
- 问一个白痴的问题 请大家不要笑我
- jsp
- 求个 在显示的表格列表里添加/修改/删除数据 JS&html处理代码(帮别人得的80分)
- 奇怪的文件判断
- 怎么把数据库中BLOB 格式转换成16进制啊
- 关于网页正在加载的问题
- 一个傻问题
- spring注入service到action里为何无效
- 请问jsp里如何判断select sum(XX) from .....返回的不是int类型而是null呢?
- "目前您所在的位置 "怎么写?
<html:link forward="userAction.do"> 返回</html:link>
试试还有你的ACTION位置和PACKAGE的声明检查下
按你的样子改了,还是不行。依然是那样的错误晕
web.xml相关部分:
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>struts-config相关部分:
<action-mappings>
<action
path="/login_success"
type=" 指定是哪一个包下的哪一个claas"
name="loginForm"
scope="request"
input="/logon.jsp"
validate="true" />
</action-mappings>jsp相关部分:
<html:link page="/login_success.do">
我检查过了,web.xml 设置跟你的一样的。 struts-config中除了 少了2个属性 input和validate
没写,其他的也正确。 我想问一下 input跟 validate是用户登录验证的时候才用的吧? 但是我这里是已经登录过了,并已经跳到其他的页面。现在想通过一个“返回”链接回登录成功的页面,在返回时想到 action 里面处理一下session的数据,(不是form的数据)。但是这样子,它连action都进不了
那么你jsp里面也要用这个名称啊.<html:link page="/userInfoAction.do">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
<data-sources/>
<form-beans type="org.apache.struts.action.ActionFormBean">
...
<form-bean name="userInfoForm" type="com.ipa.informationControl.userInfo.form.UserInfoForm"/>
</form-beans>
<global-forwards type="org.apache.struts.action.ActionForward">
...
<forward name="loginsuccess" path="/userInfoAction.do"/>
</global-forwards>
<action-mappings type="org.apache.struts.action.ActionMapping">
...
<action name="userInfoForm" path="/userInfoAction" scope="request" type="com.ipa.informationControl.userInfo.action.UserInfoAction">
<forward name="loginSuccess" path="/accessControl/loginSuccess.jsp"/>
</action>
...
</action-mappings>
</struts-config>a.jsp:
<%@ 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" %>
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>聊天窗口</title>
<SCRIPT language=JavaScript>
var currentpos,timer; function initialize()
{
timer=setInterval("scrollwindow()",10);
}
function sc(){
clearInterval(timer);
}
function scrollwindow()
{
//currentpos=window.frames['chatframe'].document.body.scrollTop;
//alert(currentpos);
window.frames['chatframe'].scrollTo(0,99999);
}
</script>
</head><body onload="scrollwindow();">
<table id="list">
<tr>
<td align=center width="100%">
<iframe id="chatframe" src="http://localhost:8080/ipa/chat/chatlist.jsp" width=570 height=160 scrolling="auto" style="pixelBottom: 80"><></iframe>
</td>
</tr>
</table>
<table width="460" height="301" border="0">
<tr>
<td width="713" height="30" align="center" valign="top"><p>交谈记录</p>
<html:form method="post" action="chatAction" >
<input type="text" name="sentence" size="50">
<input type="submit" name="Submit" value="提交">
</html:form>
<p>口语学习 专业学习</p>
</td>
</tr>
<TR ><td align="center"><html:link page="/userInfoAction.do"> 返回</html:link></td></TR>
</table>
</body>
</html>userInfoAction 文件:
package com.ipa.informationControl.userInfo.action;import org.apache.struts.action.*;import com.ipa.informationControl.userInfo.form.UserInfoForm;import javax.servlet.http.*;import net.sf.hibernate.HibernateException;public class UserInfoAction {
public ActionForward execute(ActionMapping mapping, ActionForm actionForm,
HttpServletRequest request,
HttpServletResponse response) throws
HibernateException {
System.out.println("-------------------------------------"); // test
HttpSession session = request.getSession();
UserInfoForm user = (UserInfoForm) session.getAttribute("userInfoForm");
System.out.println("----------------------------------++++++++---");
request.setAttribute("usetInfoForm",user);
return mapping.findForward("loginSuccess");
}
}在a.jsp点击“返回”,就抱错了