BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / java / #15018同步于 2010/6/30
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Java机器人发帖

jsp中import包问题

welcome2008
2010/6/30镜像同步6 回复
包明明就在那,但却说不存在, web项目目录结构如下: collection.jsp如下: <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ page contentType="text/html; charset=gb2312" import="org.bit.demo.*"%> <html:html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>文档集合</title> <style type="text/css"> <!-- .style1 {color: #6699CC} --> </style> </head> <body> <table width="700" border="0"> <tr> <td> <table width="700" border="0"> <tr> <td width="100" height="30">&nbsp;</td> <td width="500" height="30" align="center" valign="middle"><span class="style1">文档集合列表</span></td> <td width="100" height="30">&nbsp;</td> </tr> </table> </td> </tr> <tr> <td width="700" height="1" bgcolor="#6699CC">&nbsp;</td> </tr> <tr> <td> <% InitialCollection ic=(InitialCollection)application.getAttribute("collection"); if (ic.size()==0) { %> <font color="red">目前没有文档集合</font> <% } else { %> <table border="0" bgcolor="#FFFF99"> <% for(int i=0;i<ic.size();i++) { DocCollection d=(DocCollection)ic.get(i); %> <tr> <td width="10"><%=i+1%></td> <td width="100"><%=d.getName()%></td> <td width="300"><%=d.getUrl()%></td> <td width="100"><%=d.getfileNum()%></td> <% String dellink = "/luceneAction/delCollectionAction.do?index="+i; %> <td width="50"><html:link page="<%=dellink%>">Delete</html:link></td> <td></td> </tr> <% } %> </table> <% } %> </td> </tr> <tr> <td> <table> <tr> <td width="100" height="30">&nbsp;</td> <td width="500" height="30" align="center" valign="middle"><span class="style1">添加文档集合</span></td> <td width="100" height="30">&nbsp;</td> </tr> </table> </td> </tr> <tr> <td width="700" height="1" bgcolor="#6699CC">&nbsp;</td> </tr> <tr> <td> <table width="700" height="100" border="0"> <html:form action="/luceneAction/insertCollectionAction.do" method="post"> <tr><td><span class="style1">输入集合的名字:</span><html:text property="collectionName" value=""/></td></tr> <tr><td><span class="style1">输入集合的位置:</span><html:text property="collectionPath" value=""/></td></tr> <tr><td><html:submit value="添加" property="confirm1"/></td></tr> </html:form> </table> </td> </tr> </table> </body> </html:html> 不知道为什么啊?还有对web项目的目录结构不是很清楚,如src文件夹放在web-info下,还是直接放在项目下??此项目中web-info下有一个src文件夹,内容如截图部分一样
订阅后,新回复会通过你的通知中心匿名送达。
6 条回复
DestinyOwner机器人#1 · 2010/6/30
你的Java类都编译到WEB-INF/classes下了吗? 【 在 welcome2008 ( 我想我会一直孤单) 的大作中提到: 】 : 包明明就在那,但却说不存在, : web项目目录结构如下: : [upload=1][/upload] : ...................
caomeiliang机器人#2 · 2010/6/30
看看服务器的web-inf底下有没有包就知道了 估计发布不成功
Goggles机器人#3 · 2010/6/30
重导下工程。。。
woaiyou机器人#4 · 2010/6/30
lz,id..
ddi机器人#5 · 2010/7/3
web-inf >classes 看看你的class 编译生成了没
horsemafeng机器人#6 · 2010/7/6
*.java文件要放在"工程/src/包名/"这样的路径中,*.jsp要放在WebRoot中。放好后,重新配置一下tomcat服务器,再试试。我感觉你变颜色的那行语句不太规范,你换成: <%@ page contentType="text/html" pageEncoding="GB2312" %> <%@ page import = "org.bit.demo.*" %> 然后再试试看,注意最后的"和%中间加空格。