为了账号安全,请及时绑定邮箱和手机立即绑定

struts界面无法跳转

struts界面无法跳转

好好认真学习 2017-04-02 23:38:15
这是登录界面<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Insert title here</title></head><body><from action="LoginAction.action" method="post">用户名:<input  type="text" name="user.username"><br/>密码:<input type="password" name="user.password"><br/><input type="submit" value="提交"/></from></body></html><?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts PUBLIC        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"        "http://struts.apache.org/dtds/struts-2.3.dtd"><struts>    <package name="default" extends="struts-default">        <default-action-ref name="index"></default-action-ref>        <action name="index">    <result>/error.jsp</result>      </action>           <action name="helloworld" class="an.cm.HelloWorldAction">              <result>/result.jsp</result>                    </action>                <action name="addAction" method="add" class="an.cm.HelloWorldAction">            <result>/add.jsp</result>    </action>        <action name="updateAction" method="update" class="an.cm.HelloWorldAction">            <result >/update.jsp</result>        </action>                <action name=" LoginAction" method="login" class="an.cm.LoginAction">               <result >/success.jsp</result>        </action>          </package>    </struts>package an.cm;import com.opensymphony.xwork2.ActionSupport;import an.cm.User;public class LoginAction extends ActionSupport {   private User user; public String login(){ System.out.println(user.getUsername()); return SUCCESS; } public User getUser() { return user; } public void setUser(User user) { this.user = user; }}package an.cm;public class User { private String username; private String password; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }代码我都是根据视频写的 点击提交按钮 界面无法调转到另外一个界面
查看完整描述

1 回答

已采纳
?
sep123

TA贡献2条经验 获得超1个赞

Form表单路径后缀.action去掉,或者在web配置文件加后缀?
查看完整回答
反对 回复 2017-04-03
  • 1 回答
  • 0 关注
  • 1117 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信