当编译器尝试基于 Java Bean 构建自定义 JSP 标记时出错
我正在尝试在 jsp 页面中使用自定义标记,但到目前为止出现编译错误。 下面是自定义 jsp 标记代码以及尝试使用它的 jsp 页面。
address.tag
<%--
Document : address
Created on : Feb 21, 2012, 1:47:19 PM
Author : skiabox
--%>
<%@tag description="Address Input Field" pageEncoding="UTF-8"%>
<jsp:useBean id="addressBean" scope="session" class="com.ensode.netbeansbook.AddressBean" />
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- The list of normal or fragment attributes can be specified here: --%>
<%@attribute name="addressType" required="true"%>
<%-- any content can be specified here e.g.: --%>
<table border="0">
<tr>
<td>Line 1: </td>
<td>
<input type="text" size="20" name="${addressType}_line1" id="${addressType}_line1" value="${addressBean.line1}" />
</td>
</tr>
<tr>
<td>Line 2: </td>
<td>
<input type="text" size="20" name="${addressType}_line2" id="${addressType}_line2" value="${addressBean.line2}" />
</td>
</tr>
<tr>
<td>City: </td>
<td>
<input type="text" size="20" name="${addressType}_city" id="${addressType}_city" value="${addressBean.city}" />
</td>
</tr>
<tr>
<td>State: </td>
<td>
<select name="${addressType}_state" id="${addressType}_state">
<option value=""></option>
<option value="AL"
<c:if test="${addressBean.state == 'AL'}">selected</c:if> >
Alabama
</option>
<option value="AK"
<c:if test="${addressBean.state == 'AK'}">selected</c:if> >
Alaska
</option>
<option value="AZ"
<c:if test="${addressBean.state == 'AZ'}">selected</c:if> >
Arizona
</option>
<option value="AR"
<c:if test="${addressBean.state == 'AR'}">selected</c:if> >
Arkansas
</option>
<option value="CA"
<c:if test="${addressBean.state == 'CA'}">selected</c:if> >
California
</option>
</select>
</td>
</tr>
<tr>
<td>Zip: </td>
<td>
<input type="text" name="${addressType}_zip" id="${addressType}_zip" value="${addressBean.zip}" />
</td>
</tr>
</table>
index6.jsp
<%--
Document : index6
Created on : Feb 21, 2012, 3:25:43 PM
Author : skiabox
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@taglib prefix="ct" tagdir="/WEB-INF/tags/" %>
<%@page import="com.ensode.netbeansbook.AddressBean" %>
<%
AddressBean addressBean = new AddressBean();
addressBean.setAddressType("home");
addressBean.setLine1("123 Tennis Ct");
addressBean.setCity("Phoenix");
addressBean.setState("AZ");
addressBean.setZip("85001");
session.setAttribute("addressBean", addressBean);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form>
<ct:address addressType="home"/>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="width: 65px;"></td>
<td>
<input type="submit" value="Submit" />
</td>
</tr>
</table>
</form>
</body>
</html>
AddressBean.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.ensode.netbeansbook;
/**
*
* @author skiabox
*/
public class AddressBean {
private String addressType;
private String line1;
private String line2;
private String city;
private String state;
private String zip;
public String getAddressType() {
return addressType;
}
public void setAddressType(String addressType) {
this.addressType = addressType;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getLine1() {
return line1;
}
public void setLine1(String line1) {
this.line1 = line1;
}
public String getLine2() {
return line2;
}
public void setLine2(String line2) {
this.line2 = line2;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getZip() {
return zip;
}
public void setZip(String zip) {
this.zip = zip;
}
}
下面是 Netbeans 在尝试编译自定义标记时给我的错误日志:
org.apache.jasper.JasperException: PWC6033: Javac 编译时出错 对于JSP
PWC6197:jsp 文件中的第 48 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:215: 无法访问 javax.servlet.jsp.jstl.core.ConditionalTagSupport 类文件 找不到 javax.servlet.jsp.jstl.core.ConditionalTagSupport
PWC6197:jsp 文件中的第 48 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:216:找不到符号符号:方法 setPageContext(javax.servlet.jsp.PageContext) 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6197:jsp 文件中的第 48 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:217:找不到符号符号:方法 setParent() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6197:jsp 文件中的第 48 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:219:找不到符号符号:方法 doStartTag() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:223: 找不到符号符号:方法 doAfterBody() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:228: 找不到符号符号:方法 doEndTag() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:229: 重用(javax.servlet.jsp.tagext.Tag) org.apache.jasper.runtime.TagHandlerPool 无法应用于 (org.apache.taglibs.standard.tag.rt.core.IfTag)
PWC6199:生成的 servlet 错误:string:///address_tag.java:232: 重用(javax.servlet.jsp.tagext.Tag) org.apache.jasper.runtime.TagHandlerPool 无法应用于 (org.apache.taglibs.standard.tag.rt.core.IfTag)
PWC6197:jsp 文件中的第 52 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:241: 找不到符号 符号 : 方法 setPageContext(javax.servlet.jsp.PageContext) 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6197:jsp 文件中的第 52 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:242: 找不到符号 符号 : 方法 setParent() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6197:jsp 文件中的第 52 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:244: 找不到符号 符号 : 方法 doStartTag() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:248: 找不到符号符号:方法 doAfterBody() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:253: 找不到符号符号:方法 doEndTag() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:254: 重用(javax.servlet.jsp.tagext.Tag) org.apache.jasper.runtime.TagHandlerPool 无法应用于 (org.apache.taglibs.standard.tag.rt.core.IfTag)
PWC6199:生成的 servlet 错误:string:///address_tag.java:257: 重用(javax.servlet.jsp.tagext.Tag) org.apache.jasper.runtime.TagHandlerPool 无法应用于 (org.apache.taglibs.standard.tag.rt.core.IfTag)
PWC6197:jsp 文件中的第 56 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:266:找不到符号符号:方法 setPageContext(javax.servlet.jsp.PageContext) 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6197:jsp 文件中的第 56 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:267: 找不到符号 符号 : 方法 setParent() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6197:jsp 文件中的第 56 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:269:找不到符号符号:方法 doStartTag() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:273: 找不到符号符号:方法 doAfterBody() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:278: 找不到符号符号:方法 doEndTag() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:279: 重用(javax.servlet.jsp.tagext.Tag) org.apache.jasper.runtime.TagHandlerPool 无法应用于 (org.apache.taglibs.standard.tag.rt.core.IfTag)
PWC6199:生成的 servlet 错误:string:///address_tag.java:282: 重用(javax.servlet.jsp.tagext.Tag) org.apache.jasper.runtime.TagHandlerPool 无法应用于 (org.apache.taglibs.standard.tag.rt.core.IfTag)
PWC6197:jsp 文件中的第 60 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:291:找不到符号符号:方法 setPageContext(javax.servlet.jsp.PageContext) 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6197:jsp 文件中的第 60 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:292: 找不到符号 符号 : 方法 setParent() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6197:jsp 文件中的第 60 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:294:找不到符号符号:方法 doStartTag() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:298: 找不到符号符号:方法 doAfterBody() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:303: 找不到符号符号:方法 doEndTag() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:304: 重用(javax.servlet.jsp.tagext.Tag) org.apache.jasper.runtime.TagHandlerPool 无法应用于 (org.apache.taglibs.standard.tag.rt.core.IfTag)
PWC6199:生成的 servlet 错误:string:///address_tag.java:307: 重用(javax.servlet.jsp.tagext.Tag) org.apache.jasper.runtime.TagHandlerPool 无法应用于 (org.apache.taglibs.standard.tag.rt.core.IfTag)
PWC6197:jsp 文件中的第 64 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:316:找不到符号符号:方法 setPageContext(javax.servlet.jsp.PageContext) 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6197:jsp 文件中的第 64 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:317:找不到符号符号:方法 setParent() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6197:jsp 文件中的第 64 行发生错误: /WEB-INF/tags/address.tag PWC6199:生成的 servlet 错误: string:///address_tag.java:319:找不到符号符号:方法 doStartTag() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:323: 找不到符号符号:方法 doAfterBody() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:328: 找不到符号符号:方法 doEndTag() 位置:类 org.apache.taglibs.standard.tag.rt.core.IfTag
PWC6199:生成的 servlet 错误:string:///address_tag.java:329: 重用(javax.servlet.jsp.tagext.Tag) org.apache.jasper.runtime.TagHandlerPool 无法应用于 (org.apache.taglibs.standard.tag.rt.core.IfTag)
PWC6199:生成的 servlet 错误:string:///address_tag.java:332: 重用(javax.servlet.jsp.tagext.Tag) org.apache.jasper.runtime.TagHandlerPool 无法应用于 (org.apache.taglibs.standard.tag.rt.core.IfTag)
/Users/skiabox/NetBeansProjects/simplewebapp2/nbproject/build-impl.xml:612: Java 返回:1 BUILD FAILED(总时间:2 秒)
如您所见,当代码尝试访问 addressBean.state 时发生第一个错误 关于如何解决这个问题或者我做错了什么有什么想法吗? 谢谢。
I am trying to use a custom tag in a jsp page but I get compilation errors so far.
Here is the custom jsp tag code along with the jsp page that is trying to use it.
address.tag
<%--
Document : address
Created on : Feb 21, 2012, 1:47:19 PM
Author : skiabox
--%>
<%@tag description="Address Input Field" pageEncoding="UTF-8"%>
<jsp:useBean id="addressBean" scope="session" class="com.ensode.netbeansbook.AddressBean" />
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- The list of normal or fragment attributes can be specified here: --%>
<%@attribute name="addressType" required="true"%>
<%-- any content can be specified here e.g.: --%>
<table border="0">
<tr>
<td>Line 1: </td>
<td>
<input type="text" size="20" name="${addressType}_line1" id="${addressType}_line1" value="${addressBean.line1}" />
</td>
</tr>
<tr>
<td>Line 2: </td>
<td>
<input type="text" size="20" name="${addressType}_line2" id="${addressType}_line2" value="${addressBean.line2}" />
</td>
</tr>
<tr>
<td>City: </td>
<td>
<input type="text" size="20" name="${addressType}_city" id="${addressType}_city" value="${addressBean.city}" />
</td>
</tr>
<tr>
<td>State: </td>
<td>
<select name="${addressType}_state" id="${addressType}_state">
<option value=""></option>
<option value="AL"
<c:if test="${addressBean.state == 'AL'}">selected</c:if> >
Alabama
</option>
<option value="AK"
<c:if test="${addressBean.state == 'AK'}">selected</c:if> >
Alaska
</option>
<option value="AZ"
<c:if test="${addressBean.state == 'AZ'}">selected</c:if> >
Arizona
</option>
<option value="AR"
<c:if test="${addressBean.state == 'AR'}">selected</c:if> >
Arkansas
</option>
<option value="CA"
<c:if test="${addressBean.state == 'CA'}">selected</c:if> >
California
</option>
</select>
</td>
</tr>
<tr>
<td>Zip: </td>
<td>
<input type="text" name="${addressType}_zip" id="${addressType}_zip" value="${addressBean.zip}" />
</td>
</tr>
</table>
index6.jsp
<%--
Document : index6
Created on : Feb 21, 2012, 3:25:43 PM
Author : skiabox
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@taglib prefix="ct" tagdir="/WEB-INF/tags/" %>
<%@page import="com.ensode.netbeansbook.AddressBean" %>
<%
AddressBean addressBean = new AddressBean();
addressBean.setAddressType("home");
addressBean.setLine1("123 Tennis Ct");
addressBean.setCity("Phoenix");
addressBean.setState("AZ");
addressBean.setZip("85001");
session.setAttribute("addressBean", addressBean);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form>
<ct:address addressType="home"/>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="width: 65px;"></td>
<td>
<input type="submit" value="Submit" />
</td>
</tr>
</table>
</form>
</body>
</html>
AddressBean.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.ensode.netbeansbook;
/**
*
* @author skiabox
*/
public class AddressBean {
private String addressType;
private String line1;
private String line2;
private String city;
private String state;
private String zip;
public String getAddressType() {
return addressType;
}
public void setAddressType(String addressType) {
this.addressType = addressType;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getLine1() {
return line1;
}
public void setLine1(String line1) {
this.line1 = line1;
}
public String getLine2() {
return line2;
}
public void setLine2(String line2) {
this.line2 = line2;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getZip() {
return zip;
}
public void setZip(String zip) {
this.zip = zip;
}
}
And here is the error log that Netbeans give me when it tries to compile the custom tag :
org.apache.jasper.JasperException: PWC6033: Error in Javac compilation
for JSPPWC6197: An error occurred at line: 48 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:215: cannot access
javax.servlet.jsp.jstl.core.ConditionalTagSupport class file for
javax.servlet.jsp.jstl.core.ConditionalTagSupport not foundPWC6197: An error occurred at line: 48 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:216: cannot find symbol symbol : method
setPageContext(javax.servlet.jsp.PageContext) location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6197: An error occurred at line: 48 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:217: cannot find symbol symbol : method
setParent() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6197: An error occurred at line: 48 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:219: cannot find symbol symbol : method
doStartTag() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:223:
cannot find symbol symbol : method doAfterBody() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:228:
cannot find symbol symbol : method doEndTag() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:229:
reuse(javax.servlet.jsp.tagext.Tag) in
org.apache.jasper.runtime.TagHandlerPool cannot be applied to
(org.apache.taglibs.standard.tag.rt.core.IfTag)PWC6199: Generated servlet error: string:///address_tag.java:232:
reuse(javax.servlet.jsp.tagext.Tag) in
org.apache.jasper.runtime.TagHandlerPool cannot be applied to
(org.apache.taglibs.standard.tag.rt.core.IfTag)PWC6197: An error occurred at line: 52 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:241: cannot find symbol symbol : method
setPageContext(javax.servlet.jsp.PageContext) location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6197: An error occurred at line: 52 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:242: cannot find symbol symbol : method
setParent() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6197: An error occurred at line: 52 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:244: cannot find symbol symbol : method
doStartTag() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:248:
cannot find symbol symbol : method doAfterBody() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:253:
cannot find symbol symbol : method doEndTag() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:254:
reuse(javax.servlet.jsp.tagext.Tag) in
org.apache.jasper.runtime.TagHandlerPool cannot be applied to
(org.apache.taglibs.standard.tag.rt.core.IfTag)PWC6199: Generated servlet error: string:///address_tag.java:257:
reuse(javax.servlet.jsp.tagext.Tag) in
org.apache.jasper.runtime.TagHandlerPool cannot be applied to
(org.apache.taglibs.standard.tag.rt.core.IfTag)PWC6197: An error occurred at line: 56 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:266: cannot find symbol symbol : method
setPageContext(javax.servlet.jsp.PageContext) location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6197: An error occurred at line: 56 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:267: cannot find symbol symbol : method
setParent() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6197: An error occurred at line: 56 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:269: cannot find symbol symbol : method
doStartTag() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:273:
cannot find symbol symbol : method doAfterBody() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:278:
cannot find symbol symbol : method doEndTag() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:279:
reuse(javax.servlet.jsp.tagext.Tag) in
org.apache.jasper.runtime.TagHandlerPool cannot be applied to
(org.apache.taglibs.standard.tag.rt.core.IfTag)PWC6199: Generated servlet error: string:///address_tag.java:282:
reuse(javax.servlet.jsp.tagext.Tag) in
org.apache.jasper.runtime.TagHandlerPool cannot be applied to
(org.apache.taglibs.standard.tag.rt.core.IfTag)PWC6197: An error occurred at line: 60 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:291: cannot find symbol symbol : method
setPageContext(javax.servlet.jsp.PageContext) location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6197: An error occurred at line: 60 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:292: cannot find symbol symbol : method
setParent() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6197: An error occurred at line: 60 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:294: cannot find symbol symbol : method
doStartTag() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:298:
cannot find symbol symbol : method doAfterBody() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:303:
cannot find symbol symbol : method doEndTag() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:304:
reuse(javax.servlet.jsp.tagext.Tag) in
org.apache.jasper.runtime.TagHandlerPool cannot be applied to
(org.apache.taglibs.standard.tag.rt.core.IfTag)PWC6199: Generated servlet error: string:///address_tag.java:307:
reuse(javax.servlet.jsp.tagext.Tag) in
org.apache.jasper.runtime.TagHandlerPool cannot be applied to
(org.apache.taglibs.standard.tag.rt.core.IfTag)PWC6197: An error occurred at line: 64 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:316: cannot find symbol symbol : method
setPageContext(javax.servlet.jsp.PageContext) location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6197: An error occurred at line: 64 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:317: cannot find symbol symbol : method
setParent() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6197: An error occurred at line: 64 in the jsp file:
/WEB-INF/tags/address.tag PWC6199: Generated servlet error:
string:///address_tag.java:319: cannot find symbol symbol : method
doStartTag() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:323:
cannot find symbol symbol : method doAfterBody() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:328:
cannot find symbol symbol : method doEndTag() location: class
org.apache.taglibs.standard.tag.rt.core.IfTagPWC6199: Generated servlet error: string:///address_tag.java:329:
reuse(javax.servlet.jsp.tagext.Tag) in
org.apache.jasper.runtime.TagHandlerPool cannot be applied to
(org.apache.taglibs.standard.tag.rt.core.IfTag)PWC6199: Generated servlet error: string:///address_tag.java:332:
reuse(javax.servlet.jsp.tagext.Tag) in
org.apache.jasper.runtime.TagHandlerPool cannot be applied to
(org.apache.taglibs.standard.tag.rt.core.IfTag)/Users/skiabox/NetBeansProjects/simplewebapp2/nbproject/build-impl.xml:612:
Java returned: 1 BUILD FAILED (total time: 2 seconds)
As you can see the first error occurs when the code is trying to access addressBean.state
Any ideas on how to fix that or what am I doing wrong?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道现在回答这个问题已经很晚了(三年多了)。我也遇到过这个问题。显然,解决方案是“清理并构建项目”或按 SHIFT+F11 并再次运行该项目。
I know it is very late (over 3 years) to answer this question. I have also had this problem. Apparently the solution is "Clean and Build Project" or press SHIFT+F11 and run again the project.