关于mapping.getInput和getInputForw
type= "hello.HelloWorld "
name= "HelloForm "
scope= "request "
input= "/hello.jsp ">
</action>
在这里你 配置了 input的属性 ,当Mapping.getInput()的时候就会读取到你配置的input的属性
mapping.getInput()//返回输入数据的页面,也就是你的holle.jsp
都是起跳转的作用
下面介绍下
getInputForward()
前者取出的是你的input里面的内容,针对这段代码来讲,取出的值是"testInput"
后者取出的是根据你input里面的字符串来查找转向地址,也就是在当前mapping中
input="/testInput.jsp">
你也可以这样
String path = mapping.getInput();
ActionForward forward = new ActionForward();
forward.setPath(request.getContextPath()+path);//因为是JSP,所以要加上下文根
return forward;
应该也能取得同样的效果