报错:Parsing of JSP File '/Register.jsp' failed:
错误的报告情况:
/Register.jsp(3): Could not parse deployment descriptor: java.io.IOException: cannot resolve 'http://struts.apache.org/tags-bean' into a valid tag library
probably occurred due to an error in /Register.jsp line 3:
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
我利用weblogic作为的平台,在他的上面做了一个struts小例子,因为我是初学者例子很简单,是编写一个Register.jsp 上面有用户名,密码,重复密码,当密码和重复密码相等时跳到success.html上,否则跳转到failure.html上。
Register.jsp 页面代码如下:
<%@ page language="java" contentType="text/html;charset=gb2312"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<html:html lang="true">
<head>
<html:base />
<title>Register.jsp</title>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<p><html:form action="/register.do">
用户名:<html:text property="username"></html:text><br>
密码1:<html:text property="password1"></html:text><br>
密码2:<html:text property="password2"></html:text><br>
<html:submit value="Register"></html:submit>
</html:form></p>
</body>
</html:html>
struts-configer-xml代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources />
<form-beans >
<form-bean name="RegisterForm" type="com.yourcompany.struts.form.RegisterForm" />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings>
<action
attribute="RegisterForm"
input="/form/Register.jsp"
name="RegisterForm"
path="/register"
scope="request"
type="com.yourcompany.struts.action.RegisterAction">
<forward name="success" path="/success.html"></forward>
<forward name="failure" path="/failure.html"></forward>
</action>
</action-mappings>
<message-resources parameter="com.yourcompany.struts.ApplicationResources" />
</struts-config>