Construction of Tiny Web project

Source: Internet
Author: User

Friendly reminder: Read this article requires Java, MAVEN environment building skills, about the Java development environment and MAVEN Environment building please consult Google and degrees Niang . It is very simple to build a Tinyweb project environment to build a tinyweb development environment.
If you have not downloaded the tiny framework, enter the following command on the command line:

1 MVN archetype:generate-darchetypegroupid=org.tinygroup-darchetypeartifactid=webappproject-darchetypeversion= 0.0.13-snapshot-dgroupid=org.tinygroup-dartifactid=webhello-dversion=1.0-snapshot



The middle will let you confirm the input is correct, answer Y, after running, will be in the current directory to generate a Webhello directory, containing the tiny Web project directory.
If you have already installed the tiny framework locally, simply enter the following command at the command line:

1 MVN archetype:generate-darchetypecatalog=local



A menu is displayed, as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21st
22
23
24
25
26
27
28
D:\STUDYTINY>MVN archetype:generate-darchetypecatalog=local

D:\studytiny>set maven_opts=-xms2560m-xmx4048m
[INFO] Scanning for projects ...
[INFO]
[INFO]------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO]------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (DEFAULT-CLI) @ standalone-pom >>
>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (DEFAULT-CLI) @ standalone-pom <<
<
[INFO]
[INFO]---maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom--
-
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using Maven-archetype-quickstart (Org.apache.maven.
archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1:local-Org.tinygroup:flowcomponent (flowcomponent)
2:local-Org.tinygroup:uicomponent-archetype (Uicomponent-archetype)
3:local-Org.tinygroup:plugincomponent (plugincomponent)
4:local-Org.tinygroup:webappproject (Webappproject)
5:local-Org.tinygroup:servicecomponent (servicecomponent)
Choose a number or Apply filter (format: [Groupid:]artifactid, Case sensitive Co
Ntains)::



Very simple, just choose 4, you can:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21st
22
23
24
25
26
27
28
29
30
31
32
33
34
Define value for property ' GroupId ':: Org.tinygroup
Define value for property ' Artifactid ':: Webhello
Define value for property ' version ': 1.0-snapshot::
Define value for property ' package ': Org.tinygroup::
Confirm Properties Configuration:
GroupId:org.tinygroup
Artifactid:webhello
Version:1.0-snapshot
Package:org.tinygroup
Y:: Y
[INFO]-------------------------------------------------------------------------
---
[INFO] Using following parameters for creating project from Archetype:webapppro
Ject:0.0.13-snapshot
[INFO]-------------------------------------------------------------------------
---
[INFO] Parameter:groupid, Value:org.tinygroup
[INFO] Parameter:artifactid, Value:webhello
[INFO] Parameter:version, Value:1.0-snapshot
[INFO] Parameter:package, Value:org.tinygroup
[INFO] Parameter:packageinpathformat, Value:org/tinygroup
[INFO] Parameter:package, Value:org.tinygroup
[INFO] Parameter:version, Value:1.0-snapshot
[INFO] Parameter:groupid, Value:org.tinygroup
[INFO] Parameter:artifactid, Value:webhello
[WARNING] Don ' t override file D:\studytiny\webhello\pom.xml
[INFO] project created from archetype in Dir:d:\studytiny\webhello
[INFO]------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]------------------------------------------------------------------------
[INFO] Total time:2:29.134s
[INFO] Finished at:wed Mar 09:54:30 CST 2014
[INFO] Final memory:21m/2453m
[INFO]------------------------------------------------------------------------



OK, this introduces the interactive way, you can also create a Tinyweb project. Of course, in the first way, also can, the reason is only in the local time to recommend the way of interaction, is because, the central warehouse has a lot of templates, looking up blurred.
Import Maven project to IDE
Not much how to import Maven project into the IDE, please continue to consult Google, degree Niang.
[/URL]
In idea, it's probably the way it looks.
Run Web project Enter the following command in the directory where the project Pom.xml is located:

1 MVN Jetty:run



You can start the Web app normally.
Verify that the run is correctly entered in the browser:

1 Http://localhost:8080/webhello/default.page



If the following content appears, congratulations Qiao, has successfully built the tiny web development environment.
[Url=http://static.oschina.net/uploads/space/2014/0305/102740_hqxv_1245989.png]
a little bit of a cool one? create a new in the Src/main/webapp directory
Hello.page file, encoding format UTF-8
The contents are:

1 Hello,$!name



Then access in the browser: http://localhost:8080/webhello/hello.page
The result is:

1 Hello



Then access in the browser: Http://localhost:8080/webhello/hello.page?name=world
The result is:

1 Hello,world



If everything is as described above, congratulate you on the way to HelloWorld.
In fact, frankly, there are quite a lot of nonsense, the simple point is that command line following three commands, you can directly to the browser test:

1
2
3
4
5
6
MVN Archetype:generate-darchetypegroupid=or
G.tinygroup-darchetypeartifactid=webappproject-darchetypeversion=0.0.13-snapsh
Ot-dgroupid=org.tinygroup-dartifactid=webhello-dversion=1.0-sna
Pshot
CD Webhello
MVN Jetty:run

Construction of Tiny Web project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.