This is an example project based on tinystruct framework, it supports both C/S application and B/S web application development.
$ bin/dispatcher --version
_/ ' _ _/ _ _ _/
/ / /) (/ _) / / (/ ( / 1.2.3
/
$ bin/dispatcher --help
Usage: bin/dispatcher COMMAND [OPTIONS]
Commands:
download Download a resource from other servers
exec To execute native command(s)
generate POJO object generator
install Install a package
open Start a default browser to open the specific URL
say Output words
set Set system property
sql-execute Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.
sql-query Executes the given SQL statement, which returns a single ResultSet object.
update Update for latest version
Options:
--allow-remote-access Allow to be accessed remotely
--help Help command
--host Host name / IP
--import Import application
--logo Print logo
--settings Print settings
--version Print version
Run 'bin/dispatcher COMMAND --help' for more information on a command.
$ bin/dispatcher say/"Praise to the Lord"
Praise to the Lord
# bin/dispatcher start --import org.tinystruct.system.TomcatServer
# wget https://github.com/tinystruct/tinystruct2.0/archive/master.zip
# unzip master.zip
# mv tinystruct2.0-master/Dockerfile .
# docker build -t tinystruct-based:1.0 -f Dockerfile .
# docker run -d -p 777:777 tinystruct-based:1.0
You can access the below URLs after deployed the project in Tomcat 6.0+ :
- http://localhost:777/?q=say/Praise%20to%20the%20Lord!
- http://localhost:777/?q=praise
- http://localhost:777/?q=youhappy
- http://localhost:777/?q=say/%E4%BD%A0%E7%9F%A5%E9%81%93%E5%85%A8%E4%B8%96%E7%95%8C%E6%9C%80%E7%95%85%E9%94%80%E7%9A%84%E4%B9%A6%E6%98%AF%E5%93%AA%E4%B8%80%E6%9C%AC%E4%B9%A6%E5%90%97%EF%BC%9F
A demonstration for comet technology, without any websocket and support any web browser:
Live Demo Site:
- https://tinystruct.herokuapp.com/
- https://tinystruct.herokuapp.com/?q=say/Praise%20to%20the%20Lord!
- https://tinystruct.herokuapp.com/?q=praise
- https://tinystruct.herokuapp.com/?q=youhappy
- https://tinystruct.herokuapp.com/?q=say/%E4%BD%A0%E7%9F%A5%E9%81%93%E5%85%A8%E4%B8%96%E7%95%8C%E6%9C%80%E7%95%85%E9%94%80%E7%9A%84%E4%B9%A6%E6%98%AF%E5%93%AA%E4%B8%80%E6%9C%AC%E4%B9%A6%E5%90%97%EF%BC%9F
Results in your browser should be:
Praise to the Lord! true
- Please read more example code in the project.
- Also please see this project: https://github.com/m0ver/mobile1.0 http://ingod.asia
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.