为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

struts2容易的登陆界面不能有效进行验证用户和密码,纠结了好久,求指导

2018-04-16 5页 doc 17KB 19阅读

用户头像

is_219945

暂无简介

举报
struts2容易的登陆界面不能有效进行验证用户和密码,纠结了好久,求指导struts2容易的登陆界面不能有效进行验证用户和密码,纠结了好久,求指导 struts2简单的登陆界面,不能有效进行验证用户和密码,纠结了好久,求指导 struts.xml配置如下 ?xml version= 1.0 encoding= UTF-8 ? !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts Configuration 2.1//EN struts package name= default namespace= / ex...
struts2容易的登陆界面不能有效进行验证用户和密码,纠结了好久,求指导
struts2容易的登陆界面不能有效进行验证用户和密码,纠结了好久,求指导 struts2简单的登陆界面,不能有效进行验证用户和密码,纠结了好久,求指导 struts.xml配置如下 ?xml version= 1.0 encoding= UTF-8 ? !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts Configuration 2.1//EN struts package name= default namespace= / extends= struts-default action name= Login class= com.LoginAction result name= success /welcome.jsp /result result name= error /error.jsp /result /action /package /struts web.xml配置如下 ?xml version= 1.0 encoding= UTF-8 ? web-app version= 2.5 xmlns= xmlns:xsi= xsi:schemaLocation= filter filter-name struts2 /filter-name filter-class org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter /filter-class /filter filter-mapping filter-name struts2 /filter-name url-pattern *.action /url-pattern /filter-mapping /web-app login.jsp如下 %@ page language= java contentType= text/html;charset=GBK % html head title 登陆页面 /title /head body !--提交请求参数的表单-- form action= Login.action method= post table align= center caption 用户登录 /caption tr !--用户登录表单域-- td 用户名: input type= text name= useranme / /td /tr tr !--用户表单域-- td 密 nbsp; nbsp;码: input type= password name= password / /td /tr tr align= center td colspan= 2 input type= submit value= 登陆 / input type= reset value= 重填 / /td /tr /table /form /body /html welcome.jsp如下: %@ page language= java contentType= text/html;charset=GBK % html head title 成功页面 /title body 您已经成功登陆 /body /html error.jsp如下 %@ page language= java contentType= text/html;charset=GBK % html head title 失败页面 /title body 登陆不成功 /body /html LoginAction.java如下 package com; public class LoginAction { private String username; private String password; public void setUsername(String username) { this.username=username; } public String getUsername() { return username; } public void setPassword(String password) { this.password=password; } public String getPassword() { return password; } public String execute() throws Exception { if(( ha .equals(username)) ( wei .equals(password))) { return error ; } return null; } } 以上就是所有的信息,登陆界面框能出现,但是提交之后,总是转到error.jsp,貌似条件判断不起啥作用 (没有连接数据库,就是简单的验证),为什么输入的用户和密码正确却不能转到success.jsp页面,
/
本文档为【struts2容易的登陆界面不能有效进行验证用户和密码,纠结了好久,求指导】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索