我是Java新手。 localhost的位置是什么?
我将我的css文件放在此位置 C:\ Test Workspace \ MyApp \ cssFiles
Test Workspace是我的eclipse工作区的名称。
在我使用css文件的jsp(在MyApp中)中,我写了:
<link rel="stylesheet" type="text/css" href="/MyApp/cssFiles/BackgroundIMGE.css" media="screen">
但是在Chrome中运行应用程序时,错误就像这样
获取http://localhost:8080/MyApp/cssFiles/BackgroundIMGE.css http://localhost:8080/MyApp/cssFiles/BackgroundIMGE.css无法加载资源:服务器响应状态为404(未找到)
也许我在提供正确的位置时犯了错误。
答案 0 :(得分:0)
如果您使用的是Eclipse,那么您应该将<ListView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:id="@+id/subjectListView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"/>
文件夹放在cssFiles
文件夹下。构建项目后,MyApp/WebContent
文件夹应直接位于您的Web应用程序根目录(MyApp)下。