dispatchaction中接收 jsp传递的参数问题

来源:百度知道 编辑:UC知道 时间:2024/05/14 02:39:59
jsp页面向DispatchAction传递参数为何没用
我用request.setAttribute或者
直接在url后面加参数都不行啊
在DispatchAction里这么取:
request.getParameter()
或者request.getAttribute()都不行....
struts里的DispatchAction是Action的继承类,为何实现不了action能实现的功能....
这个类里面的方法能正常执行,问题就处在取出来的参数为空....
qq83534146
谁能解决200分奉上


session 看看

由jsp页面向Action传递参数至少要用session,当然如果反过来的话则可以用request.与你用什么Action作为父类无关.

add.jsp
<%@page contentType="text/html;charset=gbk" %>
<html>
<head>
<title>add</title>
</head>
<body>
<h3 align="center">Student Add</h3>
<hr>
<form method="post" action="<%= request.getContextPath()%>/service.do">
<input type="hidden" name="method" value="add" >
<table align="center" border="1" width="450" cellpadding="5" cellspacing="0">
<tr>
<td>姓名</td>
<td>
<input type="text" name="name" size="15">
</td>
<td>生日</td>
<td>
<input type="text" name="birthday" size="10&qu