Action关键代码如下,其他都是set,get方法public String execute() throws Exception {
// TODO Auto-generated method stub
if(username!=null)
{
System.out.println("Action信息,正在执行Action.........");
return SUCCESS;
}
else{
System.out.println("Action信息,正在执行Action.........");
return INPUT;
}
}
struts.xml配置 <action name="reg" class="com.test.InterceptorTest.Reg">
<result name="success">/MyIntreSuccess.jsp</result>
<result name="input">/MyReg.jsp</result>
MyReg.jsp <s:form action="reg">
<s:textfield name="username" label="用户名"></s:textfield>
<s:submit label="注册"></s:submit>
</s:form>就这么几行代码,不管我在用户名里输入内容,或不输入内容,结果都会转到成功的那个页面,也就是MyIntreSuccess.jsp,搞了半天,还是不明白哪里出错了
// TODO Auto-generated method stub
if(username!=null)
{
System.out.println("Action信息,正在执行Action.........");
return SUCCESS;
}
else{
System.out.println("Action信息,正在执行Action.........");
return INPUT;
}
}
struts.xml配置 <action name="reg" class="com.test.InterceptorTest.Reg">
<result name="success">/MyIntreSuccess.jsp</result>
<result name="input">/MyReg.jsp</result>
MyReg.jsp <s:form action="reg">
<s:textfield name="username" label="用户名"></s:textfield>
<s:submit label="注册"></s:submit>
</s:form>就这么几行代码,不管我在用户名里输入内容,或不输入内容,结果都会转到成功的那个页面,也就是MyIntreSuccess.jsp,搞了半天,还是不明白哪里出错了
解决方案 »
- 求助!jsp页面迭代ArrayList问题!
- 乱码问题
- 我的api,compareTo明明没有public,为什么重写时非加public不可?
- String的存储地址
- 关于toString
- gbk(系列)的编码方法,并没有涵盖iso8859-1,而只是涵盖了ascii?高手也进来看看
- 请教:如何判断鼠标在窗口空白处右击的事件?
- ftpClient连接局域网中另一台电脑上的FTP server时的连接超时问题
- 如何监听JInternalFrame的最大化最小话和关闭操作
- 小问题,大家帮忙看看这个程序为什么不能退出?难道java也要手动释放资源吗?
- 请教一个动态生成数组的问题。
- blowfish解密密钥长度修改
web.xml里配置了吗?
System.out.println(username);
// TODO Auto-generated method stub
if(username!=null)
{
System.out.println("Action信息,正在执行Action.........");
return SUCCESS;
}
else{
System.out.println("Action信息,正在执行Action.........");
return INPUT;
}
}