亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

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 關注
  • 1173 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號