NutzCN Logo
问答 spring传参失败
发布于 2705天前 作者 qq_B961929188CCD397673F9505827728CB 2652 次浏览 复制 上一个帖子 下一个帖子
标签: spring
<action type="com.use.jrxx.bas.season.action.SeasonAction" scope="request" path="/SeasonAction" parameter="cmd">
		
		<!--查询全部页面的跳转,被其它方法调用-->
		<forward name="toQueryAll" path="/SeasonAction.do?cmd=queryAll" redirect="true"/>
		
		<!--查询全部页面的跳转,跳到最终页面-->
		<forward name="listPage" path="/jsp/jrxx/bas/season/list.jsp"/>
		
		<!--插入页面的跳转-->
		<forward name="insertPage" path="/jsp/jrxx/bas/season/insert.jsp?isInsert=1"/>
		
		<!--修改页面的跳转-->
		<forward name="updatePage" path="/jsp/jrxx/bas/season/insert.jsp?isModify=1"/>
		
		<!--参照页面的跳转-->
		<forward name="referencePage" path="/jsp/jrxx/bas/season/ref_search.jsp"/>
		
	</action>
public IForward onQuery(DefaultForm formBean, IRequest request,
			IResponse response) throws Exception {
		request.setAttribute(REQUEST_QUERY_CONDITION, "");
		System.out.println("referenceInputType===>" + request.getAttribute("referenceInputType"));
		simpleQuery(formBean, request, response);
		return request.findForward(FORWARD_REFERENCE_PAGE);
	}

strust2配置


GET /leishi/SeasonAction.do?cmd=onQuery&elementID=formElementsDiv&referenceInputType=checkbox HTTP/1.1 Accept */* Referer http://117.41.0.1:7001/leishi/jsp/include/globalReference.jsp Accept-Language zh-CN User-Agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E) Accept-Encoding gzip, deflate Host 117.41.187.75:7001 DNT 1 Connection Keep-Alive Cookie JSESSIONID=mLKQY0ChJpVbh9hWBKplj4FpLdVJGnGpvpgWd4lyKwjy5N26Q7WB!-1137957458

用GET方法请求,System.out.println("referenceInputType===>" + request.getAttribute("referenceInputType"));这行打印出来为null,参数没有传成功,这是为什么?

1 回复

request.getParameter("referenceInputType")

添加回复
请先登陆
回到顶部