首先那个jsp是否能够正确的运行啊?有没有出现什么错误信息
<jsp:getProperty name="bookList" property="table"/>这里step into 当然是进入getTable()啊不太清楚你要调试什么方法?
<jsp:getProperty name="bookList" property="table"/>这里step into 当然是进入getTable()啊不太清楚你要调试什么方法?
package shoppingcart;
import java.text.NumberFormat;
import java.util.Locale;/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/public class Store {
private static String STRINGID="Store"; public Store() {
setLocale();
try{
setTable();
}
catch(Exception e){e.printStackTrace();}
}
//Create outstream
StringBuffer bookTable;
String[] bookPrices={
};
String[] bookTitles={
}; private void setLocale(){
} private double string2Double(String s){
} public String getTable(){
return bookTable.toString();
} public void setTable(){
bookTable=new StringBuffer();
NumberFormat nf=NumberFormat.getCurrencyInstance();
for(int i=0;i<bookTitles.length;i++){
double price=string2Double(bookTitles[i]);
bookTable.append("<tr><td><a href=cart.jsp?itemID="
+ i+">"+bookTitles[i]
+"</a></td><td align=\"right\">"
+nf.format(price)
+"</td></tr>\n");
}
} public String getPrice(String id){
} public String getTitle(String id){
}
}
这是我的jsp,如何调试bean中string2Double()方法
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<jsp:useBean id="bookList" scope="session" class="shoppingcart.Store"/>
</head>
<body>
<form method="POST" action="cart.jsp">
<table border="0" width="100%">
<jsp:getProperty name="bookList" property="table"/>
</table>
</form>
</body>
</html>