「javaee配置」javaee开发环境

博主:adminadmin 2023-03-19 10:45:11 444

今天给各位分享javaee配置的知识,其中也会对javaee开发环境进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

零基础如何自学java?

关于自学,先提几条建议,望采纳!

找一个行业当中的师傅进行规划和指导。

每天规划好学习时间,不要中断。

先掌握了解知识体系后编写项目,边抓细节。

俗话说态度决定一切,一个人的学习态度相当重要,而一个良好的态度不仅会提高你的效率,而且还会影响效果。

学习编程是一个漫长而痛苦的过程,需要持之以恒的耐心,千自万不能急于求成。对于一名初学者来说,最重要的还是打好基础。

另外,所有语言的知识体系分为三大块:

数据存储 (内存,文件,数据库,分布式,集群, 关系型 ,非关系型 。。)

业务逻辑 (业务需求,语言语法,算法,类库框架,性能优化等)

信息交互(展示)(多端,app,小程序,公众号,移动端,pc端,web开发等。。)

这三块知识作为学习来说,可以有侧重,但是不能有某一块完全不懂。

一般的初学者

javase

数据库 mysql

web开发(html,css,JavaScript,ajax)

javaee jspservlet

spring springMVC mybatis

项目实战

最后附上学习路线,供你参考:

如需自学的资料,私聊回复“java”即可获取~、

希望能帮到你,望采纳~

tomcat配置多项目多域名访问,给怎么配置,路径怎么搞

在Tomcat的安装目录下有一个conf文件夹

在这个文件夹里面打开server.xml文件

在里面添加上一句话:

Context path="/sell" reloadable="true" docBase="D:\eclipse of JavaEE\workspace02\sell" workDir="D:\eclipse of JavaEE\workspace02\sell\work" /

其中 path="/你的工程名" docBase="你的工程的绝对路径" workDir="你的工程的绝对路径/work"

其他都不变 ,这样就可以部署很多域名访问配置了

如何使用eclipse创建一个jdbc+spring+springmvc项目,本人菜鸟一枚,还望高手指教。

SpringMVC+MyBatis+Freemarker 简单框架搭建(一)

一、开发环境:

Eclipse、Tomcat、SVN等请参见如下的帖子,很详细了。

svn和maven插件的安装:

1、先安装gef插件

地址:

2、安装svn插件

地址:

3、maven插件

m2eclipse-core Update 地址:

m2eclipse-extras Update 地市:

4、安装可能出现的问题

直接在线安装maven2 会出现依赖插件找不到的问题,无法安装。必须先安装gef 插件后才能安 装m2eclipse-core 插件,然而安装m2eclipse-extras 插件又依赖subclipse 插件。所以,三个插 件的正确的安装顺序是:gef插件 》subclipse插件 》m2eclipse插件

二、web.xml 和 applicationContext.xml 配置

1、web.xml文件配置:

?xml version="1.0" encoding="UTF-8"?

web-app xmlns:xsi=""

xmlns="" xmlns:web=""

xsi:schemaLocation=" "

version="2.5"

context-param

param-namecontextConfigLocation/param-name

param-valueclasspath:applicationContext.xml/param-value

/context-param

!-- Spring MVC 配置 --

servlet

servlet-namespringServlet/servlet-name

servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class

init-param

param-namecontextConfigLocation/param-name

param-valueclasspath:contextConfigLocation-springService.xml/param-value

/init-param

load-on-startup0/load-on-startup

/servlet

servlet-mapping

servlet-namespringServlet/servlet-name

url-pattern//url-pattern

/servlet-mapping

!-- 事件监听器 --

listener

listener-classorg.springframework.web.context.ContextLoaderListener/listener-class

/listener

!-- shiro 权限控制的过滤器 --

!-- Spring 刷新Introspector防止内存泄露 --

listener

listener-classorg.springframework.web.util.IntrospectorCleanupListener/listener-class

/listener

!-- session超时定义,单位为分钟 --

session-config

session-timeout20/session-timeout

/session-config

welcome-file-list

welcome-fileindex.jsp/welcome-file

/welcome-file-list

!-- 设置servlet编码开始 --

filter

filter-nameSet Character Encoding/filter-name

filter-classorg.springframework.web.filter.CharacterEncodingFilter/filter-class

init-param

param-nameencoding/param-name

param-valueGB2312/param-value

/init-param

init-param

param-nameforceEncoding/param-name

param-valuetrue/param-value

/init-param

/filter

filter-mapping

filter-nameSet Character Encoding/filter-name

url-pattern//url-pattern

/filter-mapping

!-- 设置servlet编码结束 --

display-nameArchetype Created Web Application/display-name

/web-app

context-param节点和listener节点是web项目启动时最先读取的两个节点,所以这两个节点里面所配置的内容是web项目启动时最先加载的部分。

context-param节点中配置的applicationContext.xml里面主要是数据库的配置信息,以及事务等等

listener节点配置的是web请求的监听器

2、applicationContext.xml 内容如下:

?xml version="1.0" encoding="UTF-8"?

beans xmlns=""

xmlns:xsi="" xmlns:aop=""

xmlns:tx="" xmlns:context=""

xmlns:p=""

xsi:schemaLocation="

"

!-- 自动注解除Controller以外的Component --

context:component-scan base-package="com.weiluo.example"

context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/

/context:component-scan

!-- 此配置可以让我们以${xxx}的形式来读取property.properties里面的信息 --

!-- context:property-placeholder/ --

bean id="propertyConfigurer"

class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"

property name="locations"

list

valueclasspath:jdbc.properties/value

/list

/property

/bean

!-- 配置数据源 --

bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"

property name="driverClassName" value="${jdbc.driver}"/property

property name="url"

value="${jdbc.url}"/property

property name="username" value="${jdbc.username}"/property

property name="password" value="${jdbc.password}"/property

!-- Connection Pooling Info --

property name="maxActive" value="${dbcp.maxActive}" /

property name="maxIdle" value="${dbcp.maxIdle}" /

property name="defaultAutoCommit" value="false" /

!-- 连接Idle一个小时后超时 --

property name="timeBetweenEvictionRunsMillis" value="360000" /

property name="minEvictableIdleTimeMillis" value="360000" /

/bean

!-- 配置SessionFactory --

bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"

p:dataSource-ref = "dataSource"

p:configLocation = "classpath:sqlMapConfig.xml" /

!-- 采用spring与mybatis整合的第二种方法 --

bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate"

constructor-arg index="0" ref="sqlSessionFactory" /

/bean

!-- 配置事务管理器 --

bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"

p:dataSource-ref = "dataSource" /

!-- MapperScanner配置,自动搜索mapper里面的对象,并注入 --

bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"

p:basePackage = "com.weiluo.example.entity" /

!-- 启动Spring注解事务 --

tx:annotation-driven/

/beans

3、web.xml中的servlet节点配置的是与请求处理相关的一些内容,主要是 url路由处理器,视图解析器,等等,如下:

beans xmlns=""

xmlns:xsi="" xmlns:p=""

xmlns:context=""

xmlns:util="" xmlns:mvc=""

xsi:schemaLocation="

"

!-- url映射拦截器 --

bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"

property name="order" value="1" /

/bean

!-- 配置数据格式转换器 --

bean

class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"

property name="messageConverters"

list

ref bean="jsonHttpMessageConverter" /

/list

/property

/bean

bean id="jsonHttpMessageConverter"

class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"

/bean

!-- 开启controller注解支持 --

!-- 注:如果base-package=cn.javass 则注解事务不起作用 TODO 读源码 --

context:component-scan base-package="com.weiluo.example.controller"

context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/

/context:component-scan

!-- 因为web-inf目录下面的静态资源文件是不能直接通过目录过去的,所以需要特殊声明--

mvc:resources location="/static/" mapping="/static/**" /

!-- 视图解析器 --

bean id="viewResolver"

class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"

property name="cache" value="true" /

property name="prefix" value="" /

property name="suffix" value=".html" /

property name="exposeSpringMacroHelpers" value="true" /

property name="exposeRequestAttributes" value="true" /

property name="exposeSessionAttributes" value="true" /

property name="requestContextAttribute" value="rc" /

property name="contentType" value="text/html;charset=GB2312" /

property name="order" value="0"/

/bean

j2ee的关键技术是什么?

J2EE里 我在达内学习时,

主要的技术有:

1 Core java就不说了

2 Servlet

3 JSP

4 JDBC

5 框架类

SSH——Spring Struts2(WebWork内核) Hibernate

EJB

6 Oracle PLSQL

7 Js XML等....

javaee配置的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于javaee开发环境、javaee配置的信息别忘了在本站进行查找喔。