我jsp是这样写的
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %> <!DOCTYPE html> <meta http-equiv="X-UA-Compatible" content="IE=7,8,9,10,11" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <meta http-equiv="X-UA-Compatible" content="IE=7,8,9,10,11" /> <link rel="stylesheet" type="text/css" href="<%=basePath %>Resource/css/public.css"> <link rel="stylesheet" type="text/css" href="<%=basePath %>Resource/js/easyui/themes/default/easyui.css">
运行项目 提示这些资源文件都找不到404错误 我手动加了项目名称什么的都没用 设置了me.add(new ContextPathHandler("contextPath")); 把上面的
<%=basePath %>改成${contextPath}也没用 这个是咋回事啊 刚刚接触这个框架 本来想把原来的项目移植过去 求有好心人看到帮忙解决下不胜感激
项目:JFinal
注意启动项目的方式参考 jfinal 手册,在首页有下载