------------------------------------------------------------------------------------------------------------------
<?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.0.dtd"><struts>
<constant name="struts.devMode" value="true" />
<package name="default" namespace="/actions" extends="struts-default">
<action name="Student*" class="com.jiezongzhen.StudentAction" method="{1}">
<result>/Student{1}_success.jsp </result>
</action>
<action name="*_*" class="com.jiezongzhen.{1}Action" method="{2}">
<result>/{1}_{2}_success.jsp </result>
</action>
</package>
<!-- Add packages here -->
</struts>
------------------------------------------------------------------------------------------------------------------
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<a href="actions/Studentadd_success">添加学生1</a>
<br>
<a href="actions/Student_add_success">添加学生</a> <a href="actions/Student_delete_success">删除学生</a>
</body>
</html>
-------------------------------------------------------------------------------------------------------------------package com.jiezongzhen;public class StudentAction {
public String add(){
return "success";
}
public String delete(){
return "success";
}
}
----------------------------------------------------------------------------------------------------------------
<?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.0.dtd"><struts>
<constant name="struts.devMode" value="true" />
<package name="default" namespace="/actions" extends="struts-default">
<action name="Student*" class="com.jiezongzhen.StudentAction" method="{1}">
<result>/Student{1}_success.jsp </result>
</action>
<action name="*_*" class="com.jiezongzhen.{1}Action" method="{2}">
<result>/{1}_{2}_success.jsp </result>
</action>
</package>
<!-- Add packages here -->
</struts>
------------------------------------------------------------------------------------------------------------------
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<a href="actions/Studentadd_success">添加学生1</a>
<br>
<a href="actions/Student_add_success">添加学生</a> <a href="actions/Student_delete_success">删除学生</a>
</body>
</html>
-------------------------------------------------------------------------------------------------------------------package com.jiezongzhen;public class StudentAction {
public String add(){
return "success";
}
public String delete(){
return "success";
}
}
----------------------------------------------------------------------------------------------------------------
解决方案 »
- Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your
- 为什么这个JavaScript动态注入table 在火狐可以显示,在ie不行?(代码已简化)
- struts1上传文件的大小限制
- 请问在SSH框架下,怎么使用JSP页面对数据库进行增删改,最好有源码,谢谢
- struts2中如何刷新父页面
- 动态的sql怎样使用prepareStatement?请各位大侠赐教!
- servlet里面可以自己随意的定义函数吗???
- SQL Server存储过程里有个 print '字符串' ,在JSP里如何接收这个字符串啊?
- 在JSP下如何计算时间差
- 请问论坛里的显示登陆后在线人员是怎么做的!(不用cookie)
- 在java程序中调用linux命令
- hibernate高手请进,这个问题有点无语
public class StudentAction extends ActionSupport[/color] {
public String add(){
return "success";
}
public String delete(){
return "success";
}
}
public class StudentAction extends ActionSupport {
public String add(){
return "success";
}
public String delete(){
return "success";
}
}
发下错误
<action name="Student*" class="com.jiezongzhen.StudentAction" method="{1}">
<result>/Student{1}_success.jsp </result>
</action>2、将JSP
<a href="actions/Studentadd_success">添加学生1</a>
<br>
<a href="actions/Student_add_success">添加学生</a> <a href="actions/Student_delete_success">删除学生</a>改为:
<a href="actions/Student_add_success">添加学生1</a>
<br>
<a href="actions/Student_add.action">添加学生</a> <a href="actions/Student_delete.action">删除学生</a>