Play Framework有自带的服务器,也可部署到其他服务器上。这里讲解下如何将Play的项目部署到Tomcat。
1.准备war包
首先进入play目录:
比如我的:
cd C:\play-1.2.5\play-1.2.5
然后利用命令:play war [项目所在绝对路径] -o [生成的war包名称(包括路径)]
这里要注意生成的war包最好指定到其他目录,比如C盘根目录。
比如我的项目:
C:\play-1.2.5\play-1.2.5>play war C:\msysgit\msysgit\git\gitrep7\applyful\module s\applyful.appserver_v2 -o c:\applyful.war ~ _ _ ~ _ __ | | __ _ _ _| | ~ | '_ \| |/ _' | || |_| ~ | __/|_|\____|\__ (_) ~ |_| |__/ ~ ~ play! 1.2.5, http://www.playframework.org ~ CompilerOracle: exclude jregex/Pretokenizer.next Listening for transport dt_socket at address: 8000 17:19:22,085 INFO ~ Starting C:\msysgit\msysgit\git\gitrep7\applyful\modules\ap plyful.appserver_v2 17:19:22,085 INFO ~ Module japid is available (C:\msysgit\msysgit\git\gitrep7\a pplyful\modules\applyful.appserver_v2\modules\japid-0.9.4.3) 17:19:22,085 INFO ~ Module morphia is available (C:\msysgit\msysgit\git\gitrep7 \applyful\modules\applyful.appserver_v2\modules\morphia-1.2.9a) 17:19:22,101 INFO ~ Module press is available (C:\msysgit\msysgit\git\gitrep7\a pplyful\modules\applyful.appserver_v2\modules\press-1.0.25) 17:19:24,191 INFO ~ JapidPlugin.onload(). 17:19:24,191 INFO ~ [Japid] play in DEV mode. Detecting changes... [Japid] Processing 15 templates in directory tree: C:\msysgit\msysgit\git\gitrep 7\applyful\modules\applyful.appserver_v2\app [Japid] Transforming template: japidviews\OnboardingController\step2.html to: st ep2.java [Japid] Transforming template: japidviews\OnboardingController\step5.html to: st ep5.java [Japid] Transforming template: japidviews\OnboardingController\step4.html to: st ep4.java [Japid] Transforming template: japidviews\PageController\about.html to: about.ja va [Japid] Transforming template: japidviews\SchoolController\page_more_info.html t o: page_more_info.java [Japid] Transforming template: japidviews\Landing\index.html to: index.java [Japid] Transforming template: japidviews\PageController\createPage.html to: cre atePage.java [Japid] Transforming template: japidviews\OnboardingController\finishedProfile.h tml to: finishedProfile.java [Japid] Transforming template: japidviews\_tags\pagelike.html to: pagelike.java [Japid] Transforming template: japidviews\AccountController\signupresult.html to : signupresult.java [Japid] Transforming template: japidviews\_layouts\step_layout.html to: step_lay out.java [Japid] Transforming template: japidviews\_layouts\new_signupresult_layout.html to: new_signupresult_layout.java [Japid] Transforming template: japidviews\_layouts\signupresult_layout.html to: signupresult_layout.java [Japid] Transforming template: japidviews\OnboardingController\step3.html to: st ep3.java [Japid] Transforming template: japidviews\OnboardingController\step1.html to: st ep1.java 17:19:24,847 INFO ~ Precompiling ... 17:19:44,440 INFO ~ Done. ~ Packaging current version of the framework and the application to c:\applyful. war ... ~ Done ! ~ ~ You can now load c:\applyful.war as a standard WAR into your servlet container ~ You can't use play standard commands to run/stop/debug the WAR application... ~ ... just use your servlet container commands instead ~ ~ Have fun! ~ C:\play-1.2.5\play-1.2.5>mongod
2. 部署到Tomcat
将得到的war文件夹里的WEB-INF文件复制到Tomcat目录下的ROOT下,直接覆盖。
启动Tomcat即可访问:http://localhost:8080/
用dedecms织梦程序如何做中英文网站?今天就给大家来一个详细的图文教程,希望能帮助到大家。
以下所讲的和截图是本人用dedecms织梦程序制作过的一个5国预言网站,下面开始教程。
一、首先在后台建栏目,有三点需要注意
1.需要做几种语言就加几个大的栏目,我把这个栏目叫做封面栏目,里面都是自己语言的导航栏目
2.封面栏目“常规选项”的文件保存目录设置为cn或者en
3.封面栏目“高级选项”的列表模板设置为cn_index.htm或者en_index.htm
二、网站代码的调用
每种语言的封面栏目和每种语言下的导航栏目都是单独调用的,用{dede:type typeid='*'}单独调用,请看图
三、剩下的就是分别建设每种语言下的栏目
模板文件建议用cn_、en_、jp_等这些前缀区分一下,一种语言就是一个网站,做好一种语言模板,然后复制改下文字图片
希望这次的图文教程够详细,做多种语言也是同样的道理,以此类推。
Bacth processes are hard to write-especially when using ageneral language like Java. Batch jobs run every night, making it easy formillions of people to do things like banking, online shopping, querying billinginformation.
Spring Batch is Java Framework that makes it easy to writebatch applications. Batch applications invlove reliably and efficientlyprocessing large volumes of data to and from various data sources (files,databases, and so on). Spring Batch is great at doing this and provides thenecessary foundation to meet the stringent requirements of batch appliocations.Sir Isaac Newton said, “If I have seen further it is only by standing on theshoulders of giants.” Spring batch builds on the shoulders of one giant inpraticular: the Spring Framework. Spring is the framework of choice for asignificant segment of the Enterprise Java development market. Spring Batchmakes the Spring programming model – based on simplicity and efficiency –easier to apply for batch applications.
What are batch applications? Batch applications processlarge amounts of data without human intervention. You’d opt to use bacthapplications to compute data for generating monthly financial statements,calculating statistics, and indexing files.
The most common scenario for a batch application isexporting data to files from one system and processing them in another. A batchapplication processes data automatically, so it must be robust and reliablebecause there is no human interaction to recover from an error. The greater thevolume of data a batch application must process, the longer it takes tocomplete. This means you must also consider performance in your batchapplication because it’s often restricted to execute within a specific timewindow. Every day, large and complex calculations take place to index billionsof documents, using cutting-edge algorithms like MapReduce. For data exchange,message-based solutions are also popular, having the advantage over batchapplications of being(close to) real time.
The goal of the Spring Batch project is to provide an opensource batch-oritened framework that effectively addresses the most common needsof batch applications.
Spring Batch isn’t a scheduler!
Spring Batch drives batch jobs (we use the terms job, batch,and process interchangeably) but doesn’t provide advanced support to launchthem according to a schedule. Spring Batch leaves this task to dedicatedschedulers like Quartz and cron. A scheduler triggers the launching of SpringBatch jobs by accessing the Spring Batch runtime ( like Quartz because it’s ajava solution) or by launching a dedicated JVM process( in the case of cron).Sometimes a scheduler launches batch jobs in sequence; first job A, and thenjob B if A succeeded, or job C if A failed. The scheduler can use the filesgenerated by the jobs or exit codes to orchestrate the sequence. Spring Batchcan aslo orchestrate such sequences itself; Spring Batch jobs are made ofsteps, and you can easily configure the sequence by using Spring Batch XML.
Should a whole batch fail because of one badly formattedline? Not always. The decision to skip an incorrect line or an incorrect itemis declarative in Spring Batch. It’s all about configuration. Components can trackeverything they do, and the framework provides them with the execution data onrestart. The components then know ehre they left off and can restart processingat the right place.
Spring Batch processes items in chunks. A job reads andwrites items in small chunks. Chunk processing allows streaming data instead ofloading all the data in memory. By default, chunk processing is single threadedand susally performs well. But some batch jobs need to execute faster, soSpring Batch provides ways to make chunk processing multi-threaded and todistribute processing on multiple physical nodes.
Partitioning splits a step into substeps, each of whichhandles a specific portion of the data. This implies that you know thestructure of the input data and that you know in advance how to distribute databetween substeps. Distribution can take place by ranges of primary key valuesfor database records or by directories for files. The substeps can executelocally or remotely, and Spring Batch provides support for multi-threadedsubsteps.
Spring Batch and grid computing
When dealing with large amounts of data—petabytes-a popularsolution to scaling is to divide the enormous amounts of computations intosmaller chunks, compute them in parallel(usually on different nodes), and thengather the results. Some open source frameworks(Haddop, GridGain, andHazelcast, for example) have appeared in the last few years to deal with theburden of distributing units of work so that developers can focus on developingthe computations themselves. How does Spring Batch compare to thesegrid-computing frameworks? Spring Batch is a loghtweight solution: all it needsis the Java Runtime installed, whereas grid-computing frameworks need a moreadvanced infrastucture. As an example, Hadoop usually works on top of its owndistributed fle system, HDFS. In terms of features, Spring Batch provides a lotof support to work with flat files, XML files, and relational database.