我是一个新手,请各位前辈多多关照,在此先谢谢了!
我用struts写了一个分页实现了增删改查,带了一个登录也面对登录也面(只进行了不为空和密码长度的)验证,符合条件进入查询也面,我按着要求通过了验证 、、但是进入查询页面后一点查询的链接(通过struts-config.xml到action类)怎么有回到登录验证的也面了???,我就是这没弄明白,除了把struts-config.xml中action标签中的validate属性改成false还有别的办法吗???这是config文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"> <struts-config>
<data-sources />
<form-beans >
<form-bean name="pageListForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="user" type="com.jq.struts.bean.User"/>
</form-bean> </form-beans> <global-exceptions />
<global-forwards />
<action-mappings >
<action
input="/index.jsp"
name="pageListForm"
path="/pageList"
scope="request"
type="com.jq.struts.action.PageListAction"
validate="false"
>
<forward name="go" path="/pageList.jsp" />
<forward name="go1" path="/findall.jsp" />
<forward name="error" path="/error.jsp" />
<forward name="update" path="/update.jsp" />
</action> </action-mappings> <message-resources parameter="com.jq.struts.ApplicationResources" />
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in>
</struts-config>
我用struts写了一个分页实现了增删改查,带了一个登录也面对登录也面(只进行了不为空和密码长度的)验证,符合条件进入查询也面,我按着要求通过了验证 、、但是进入查询页面后一点查询的链接(通过struts-config.xml到action类)怎么有回到登录验证的也面了???,我就是这没弄明白,除了把struts-config.xml中action标签中的validate属性改成false还有别的办法吗???这是config文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"> <struts-config>
<data-sources />
<form-beans >
<form-bean name="pageListForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="user" type="com.jq.struts.bean.User"/>
</form-bean> </form-beans> <global-exceptions />
<global-forwards />
<action-mappings >
<action
input="/index.jsp"
name="pageListForm"
path="/pageList"
scope="request"
type="com.jq.struts.action.PageListAction"
validate="false"
>
<forward name="go" path="/pageList.jsp" />
<forward name="go1" path="/findall.jsp" />
<forward name="error" path="/error.jsp" />
<forward name="update" path="/update.jsp" />
</action> </action-mappings> <message-resources parameter="com.jq.struts.ApplicationResources" />
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in>
</struts-config>
解决方案 »
- 我们爱分享---Obey the general contract when overriding equals
- 如何将一个文件夹的文件分类压缩到一个 zip 包?
- 万恶的根源:hibernate的关联,最易导致出错的地方,没有问题都能给你弄点问题出来,调试繁琐,一出错就错一片,有没有?
- unix 发布java程序中文问题
- 用struts怎么实现分页
- weblogic那有免费下的。
- googleapi.jar应该放在哪里啊?
- 用参数引用一个类的变量或方法的问题
- 第二次make时出现java.lang.OutOfMemoryError?
- 雪地跪求助:axis 浏览器输入报错,在线等,求助
- 求高手来解决tomcat启动时加载配置文件问题,高手来啊
- 关于spring中bean配置的一点疑问
看看这个可以么,超链接跳到这里
<action
input="/index.jsp"
path="/page"
scope="request"
type="com.jq.struts.action.PageListAction"
>
<forward name="show" path="/页面" />
</action>
因为你的配置中已经把action 和actionform绑定了,得通过验证才可以呀!