web-inf

(一)SpringMVC之配置DispatcherServlet的一些坑

匿名 (未验证) 提交于 2019-12-03 00:22:01
DispatcherServlet是SpringMVC的核心控制器,就像是SpringMVC的心脏,几乎所有的请求都会经过这个控制器,通过它,大大的降低了模块之间的耦合度。所有学SpringMVC的同学们第一步肯定都是先配置这个Servlet,不然还写啥SpringMVC啊。 那其实我第一次写SpringMVC的时候就遇到了好多坑,这里记录一下,只是冰山一角,但希望能帮助一些人。 为了更好的说明情况,我先写一些代码 首先新建一个MyController继承自Controller public class MyController implements Controller { @Override public ModelAndView handleRequest (HttpServletRequest arg0, HttpServletResponse arg1) throws Exception { ModelAndView mav = new ModelAndView(); // 增加一个属性到model中,底层是调用了request.setAttribute()方法 mav.addObject( "hello" , "hello springmvc" ); // 为这个模型视图起一个逻辑视图名 mav.setViewName( "hello" ); return mav; }

springmvc学习――学完ssm之后spring笔记整理

匿名 (未验证) 提交于 2019-12-02 23:43:01
文章目录 Spring MVC Spring MVC配置 Spring MVC 前端控制器 Spring MVC配置 配置jar包 在 WEB-INF 目录下配置 web.xml 核心配置文件 dispatcherservice 在 WEB-INF 目录下配置springmvc映射文件 springmvc-servlet.xml Controller扫描 视图解析 通过 ModeAndView 对象把模型和视图结合在一起 文章来源: https://blog.csdn.net/qq_36730158/article/details/92426707

Classes not seeing each other in JSP

旧时模样 提交于 2019-12-02 19:30:49
问题 In a tomcat JSP application I have this directory layout: webapps/ myProjectName/ index.jsp WEB-INF/ classes/ mypackage/ class1.java class2.java I'm trying to compile class1.java which references class2.java. It's coded in a form sort of like this: package mypackage; public class class1 extends class2 {} and class2 looks like this: package mypackage; public class class2 {} however, I get an error on class1 saying that class2 cannot be found. First I compiled class2, which compiled just fine,

Referencing a resource placed in WEB-INF folder in JSP file returns HTTP 404 on resource

∥☆過路亽.° 提交于 2019-12-02 19:13:12
问题 I have a dynamic web project called BookShopWeb which I created in eclipse, with the following directory structure /BookShopWeb/| |--src |---WebContent | |---META-INF |----WEB-INF---web.xml | |--css--styles.css |--jsp---index.jsp In web.xml I set the start page as <welcome-file-list> <welcome-file>/WEB-INF/jsp/index.jsp</welcome-file> In the index.jsp I am including the css as <head> <link rel="stylesheet" type="text/css" href="../css/styles.css" /> </head> The index page when loaded however

What does WEB-INF stand for in a Java EE web application? [closed]

﹥>﹥吖頭↗ 提交于 2019-12-02 18:58:32
Most of the places on the internet say it stands for WEB INF ormation. I rather doubt it. The folder contains executables. Information is not a suitable name for it. Andy White As far as I know, "INF" stands for "Information", as you said. It probably was named WEB-INF for similarity with the META-INF directory in JAR files. Sometimes the meaning of a directory changes so much over time that it no longer makes sense. For example, bin directories in Unix/Linux often contain non-binary "executable" files, such as shell scripts. I believe it's really named WEB-INF to mirror the META-INF directory

SQL Profiler 无法连接 P6SPY 问题

独自空忆成欢 提交于 2019-12-02 14:40:28
虽然我按照步骤如下安装了SQLProfiler,但在启动SQLProfiler再启动服务后仍然显示Not connected to P6SPY。 使用步骤 首先,你的应用系统同样也应当是基于数据库的,然后你需要去获取 SQL Profiler 相关的文件(在 参考资源 中可以找到下载链接,您可以直接下载软件包)。下面介绍 SQL Profiler 的安装与使用的详细操作过程: 下载 SQL Profiler 的文件包进行安装; 把 p6spy.jar 及 sqlprofiler.jar 放到 CLASSPATH 中,如果是 Web 应用程序则放在 YourWebApp/WEB-INF/lib/ 目录下; 把 spy.properties 放到 CLASSPATH 目录下,如果是 Web 应用程序就放在 YourWebApp/WEB-INF/classess/ 目录下,注意不是 lib/ 目录; 修改你应用系统中的数据库驱动名称为 P6Spy 的驱动程序名称 com.p6spy.engine.spy.P6SpyDriver 其它的全部使用默认值,暂时不用修改; 打开 spy.properties 文件,把 realdriver 的值改为你的程序的数据库驱动名称; 注意要先运行 java -jar sqlprofiler.jar 来启动 SQL Profiler,并成功看到启动界面;

how can i have access to my files that placed in WEB-INF folder

你说的曾经没有我的故事 提交于 2019-12-02 13:59:25
问题 i'm new to java and have a strange problem. i create some folder(theme, js, css) in WEB-INF folder and put my files to this folders. in index.jsp i use a css file by following way: <style type="text/css"> <%@include file="WEB-INF/css/style.css" %> </style> it works good. but in style.css file i have a div tag that set a background for header tag by following way: #header{ background: url(../theme/violet/header.jpg) repeat-x; } oh. my problem is here. it doesn't work. since other css command

MyEclipse部署外部引用的jar到web-inf的lib目录下

微笑、不失礼 提交于 2019-12-02 12:31:19
在用MyEclipse开发java web项目的时候,引入了外部jar,都是以library的形式存在左边的explore中的,调试没有问题,但是部署之后呢,经常遇到个非常头疼的问题就是,这些jar不会被copy到web-inf的lib目录下,在MyEclipse界面呢,直接拖也是不可拖进去的,可采用的办法就是手工copy到web-inf的lib下,非常麻烦,在网上找了个好的办法解决这个问题: 1.右键自己的项目,选择configure build path 2.在文本框中输入“deploy”,程序自动检索,会出来一个菜单 3.点击进入,然后Add你所要用的jar library 4.重新部署,成功! 来源: https://www.cnblogs.com/chenbg2001/p/11745388.html

myeclipse 在web-inf/lib中导入包

守給你的承諾、 提交于 2019-12-02 12:27:54
今天用myeclipse的时候发现无法在web-inf/lib导入包,如果直接在工程上导入,则进入了一个referenced libraries的文件夹里,而web-inf/lib里面是没有jar包的。 在网上找了一些答案,下面的方法解决了疑惑: 你应该尽量避免使用外部包。 正确并且规范的做法是:在你的项目下单独创建一个lib目录(也可在WEB-INF下建lib,放到这里的话它会自动导入),把你需要的jar拷贝到这里来,并导入(工程右键refresh)。这样就不再依赖外部包了。独立。解耦。多好。 不依赖外部包。 来源: https://www.cnblogs.com/chenbg2001/p/11745356.html

Is it possible to submit a form that has been rendered from a JSF page location in WEB-INF?

假装没事ソ 提交于 2019-12-02 09:12:39
The JSF 2.2 web based application I am developing makes use of various error pages which are located in the WEB-INF directory and are displayed when an HTTP error or Java exception is encountered based on the configuration in the web.xml file. On some error pages I would like to include a form which allows the user to report the issue and include various attributes that would be helpful when investigating the issue such as the request URI and the error message. The issue I've got is when the user attempts to submit the form it fails with a page not found error as the HTTP post request method