学struts2都要崩溃了,错误s:form tag declares that it accepts dynamic。。。求指点

wqzhang 2011-12-15 09:57:56
org.apache.jasper.JasperException: /stu_login.jsp(30,2) The s:form tag declares that it accepts dynamic attributes but does not implement the required interface
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:802)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
。。。。。

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>

<%@taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'stu_login.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>
<s:form action="stu_login" method="post" namespace="/stu">
<s:textfield name="student.name" label="用户名" />
<s:textfield name="student.stu_no" label="密 码" />
<s:submit />
<s:reset />
</s:form>

</body>
</html>


请求热心人给指点
昨天晚上还好好的,今天用就悲剧了,服务器也重启过了,myeclipse也重启过了
难道我s:form标签真的用错了吗???
...全文
541 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
guoyu0454 2012-07-20
  • 打赏
  • 举报
回复
哦,发现了不是标签错了,是我考的struts-tags.tld 的版本不对,谢谢大家的支持
guoyu0454 2012-07-20
  • 打赏
  • 举报
回复
哦,发现了不是标签错了,是我考的struts-tags.tld 的版本不对,谢谢大家的支持
xiaoshan_1988 2011-12-16
  • 打赏
  • 举报
回复
<s:form action="stu_login" method="post" namespace="/stu">
我一般不是这样写的,改为<s:form action="stu/stu_login.action" method="post">试试
jk_3699 2011-12-15
  • 打赏
  • 举报
回复
org.apache.jasper.JasperException: /stu_login.jsp(30,2) The s:form tag declares that it accepts
struts 标签错误 , 仔细更改
  • 打赏
  • 举报
回复
<action name="index">
<result>/stu_login.jsp</result>
</action>
把class 跟 method属性 写完
  • 打赏
  • 举报
回复
stu_login.jsp(30,2) The s:form tag declares that it accepts dynamic attributes but does not implement the required interface

翻译过来的大概意思就是 你的S:form标签声明了冰且能够接收动态的属性 但是没有实现一个必须得接口

namespace是命名空间 这个 你知道的

既然报的事JSP页面异常 就在这漫漫找把 LZ好运
Xylon_V 2011-12-15
  • 打赏
  • 举报
回复
强哥,对于你目前的各种代码,俺都没看出问题啊!!! 或许不是程序的事,是配置的事呢 ?
wqzhang 2011-12-15
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 cwy5310 的回复:]

default.properties 说错了
[/Quote]
没有改过啊,这样简单的东西,不需要改吧,我之前的项目也没改啊
驿凡 2011-12-15
  • 打赏
  • 举报
回复
default.properties 说错了
驿凡 2011-12-15
  • 打赏
  • 举报
回复
测试的时候把其他不相关的项目CLOSE了 试试
还有你改过struts.properties文件了?
wqzhang 2011-12-15
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 flyfeifei66 的回复:]

<s:form action="stu_login" method="post" namespace="/stu">

namespace是干啥的?另外action 不加 / 吗?
[/Quote]

因为我配置文件里面namespace就是“/stu”

<?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.enable.DynamicMethodInvocation" value="true" />
<constant name="struts.devMode" value="false" />

<package name="student" namespace="/stu" extends="struts-default">

<action name="index">
<result>/stu_login.jsp</result>
</action>

<action name="stu_login" class="com.city.action.StudentAction" method="stu_login">
<result name="success">/stu_load.jsp</result>
<result name="input">/stu_error.jsp</result>
</action>

<action name="stu_update" class="com.city.action.StudentAction" method="stu_update">
<result name="success">/stu_update.jsp</result>
</action>

</package>



<!-- Add packages here -->

</struts>

action里面不用加/吧,我其他练习都好用的
济南大飞哥 2011-12-15
  • 打赏
  • 举报
回复
<s:form action="stu_login" method="post" namespace="/stu">

namespace是干啥的?另外action 不加 / 吗?
wqzhang 2011-12-15
  • 打赏
  • 举报
回复
沙发自己坐,需要其他代码请留言

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧