{"id":29835571,"url":"https://github.com/astamuse/asta4d","last_synced_at":"2026-02-23T21:09:29.086Z","repository":{"id":5982255,"uuid":"7204443","full_name":"astamuse/asta4d","owner":"astamuse","description":"View first web application framework","archived":false,"fork":false,"pushed_at":"2020-02-11T03:37:00.000Z","size":17688,"stargazers_count":164,"open_issues_count":15,"forks_count":56,"subscribers_count":39,"default_branch":"develop","last_synced_at":"2026-02-15T06:00:09.971Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astamuse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-17T12:30:57.000Z","updated_at":"2026-01-09T05:51:52.000Z","dependencies_parsed_at":"2022-09-16T22:24:57.164Z","dependency_job_id":null,"html_url":"https://github.com/astamuse/asta4d","commit_stats":null,"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/astamuse/asta4d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astamuse%2Fasta4d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astamuse%2Fasta4d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astamuse%2Fasta4d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astamuse%2Fasta4d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astamuse","download_url":"https://codeload.github.com/astamuse/asta4d/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astamuse%2Fasta4d/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29748831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-29T13:00:45.152Z","updated_at":"2026-02-23T21:09:29.064Z","avatar_url":"https://github.com/astamuse.png","language":"Java","funding_links":[],"categories":["开发框架"],"sub_categories":[],"readme":"## News\r\n\r\n- 2016-11-17, 1.2-M2 is released.\r\n- 2016-04-13, 1.2-M1 with some essential enhancements is released.\r\n- 2016-01-22, [asta4d-ide](https://github.com/astamuse/asta4d-ide) is release to accelerate our development with asta4d. \r\n- 2015-12-25, 1.1 official release \"1.1-Xmas\" is released. \r\n- 2015-12-17, the scala extension for asta4d [asta4d-scala](https://github.com/astamuse/asta4d-scala) is released. \r\n- 2015-10-27, the 1.1-b3 with minor bug fixes is released.\r\n- 2015-09-07, the 1.1-b2 with minor bug fixes is released.\r\n- 2015-07-23, the 1.1-b1 with better Java 8 support is released.\r\n- 2015-02-14, the first official release \"1.0-Valentines\" is released at the Valentine's day!\r\n\r\n## Quick start\r\n\r\n**NOTE: There are some breaking changes related to form flow and url initialization in the recent release of 1.2-M1. The user guide will be modified in the next release, thus there may be some unmatched contents in the document if you use the newest 1.2-M1 instead of the previous stable version 1.1-Xmas.**\r\n\r\n[documents](http://astamuse.github.io/asta4d/1.1-Xmas/)\r\n\r\n[Online Sample](http://asta4dsample-xzer.rhcloud.com/)\r\n\r\nThere is a maven archetype for asta4d. If you want to start with the archetype, you have to [install Maven 3](http://maven.apache.org/download.cgi) at first. After installed Maven 3, create  the sample project by the following command:\r\n\r\n```batch\r\nmvn archetype:generate                       \\\r\n    -DarchetypeGroupId=com.astamuse          \\\r\n    -DarchetypeArtifactId=asta4d-archetype   \\\r\n    -DarchetypeVersion=1.1-Xmas        \\\r\n    -DgroupId=\u003cyour.groupid\u003e                 \\\r\n    -DartifactId=\u003cyour-artifactId\u003e\r\n```\r\n\r\nor simply follow the wizard by filtered list:\r\n\r\n```batch\r\nmvn archetype:generate -DarchetypeGroupId=com.astamuse -DarchetypeArtifactId=asta4d-archetype -DarchetypeVersion=1.1-Xmas\r\n```\r\n\r\n*The 1.1-Xmas with better Java 8 support is recommended for new projects, if you cannot use Java 8, use 1.0-Valentines instead.*\r\n\r\nAfter the archetype is created, enter the folder which has a \"pom.xml\" file, run the following command:\r\n\r\n```batch\r\nmvn jetty:run\r\n```\r\n \r\nThen you can access the sample project by http://localhost:8080, there are source samples shown, it is a good start from reading the samples.\r\nAfter you confirm the sample project is OK, you can add your own url mapping rules to /src/main/java/.../.../UrlRules.java,\r\nand also you can add your own html template files to /src/main/webapp.\r\n\r\nReading the [Best Practice](http://astamuse.github.io/asta4d/1.1-Xmas/userguide/index.html#chapter-best-practice) before writing your own code is recommended.\r\n\r\n## What is Asta4D\r\n\r\nAsta4D is a view first web application framework which is friendly to designers and flexible to developers. Asta4D affords high productivity than traditional MVC architecture by \"View First\" architecture. It also allows front-end engineers and back-end engineers work independently without interference by separating rendering logic from template files.\r\n\r\nAsta4D is inspired by [lift](http://liftweb.net/)  which is a famous scala web application framework and it is developed by astamuse company Ltd. locating at Tokyo Japan. We are concentrating on global innovation support and developing Asta4D for our own services. Currently, Asta4D is driving our new service development.\r\n\r\n## Why Asta4D\r\nIn the past decade, plenty of Java based web application frameworks are generated. Especially the MVC \r\narchitecture and JSP tag libs (or other traditional template technologies) that has greatly released our \r\nproductivity. But unfortunately, we are still suffering from the following situations:\r\n\r\n1. The designers or front-end engineers are keeping complaining the mixed-in dynamic code, as they disturb their efforts of redesigning the page style or structure. And in the mean time, the back-end developers are also complaining that the front-end guys break the working page frequently,  because redesign or the new design is hard to merge due to the huge cost of source refactoring. \r\n1. The developers are complaining about the poor functionalities of template language which they are using and tired from the various magic skills for complex rendering logic.\r\n1. The developers are discontented with the counterproductivity of MVC architecture and desire a more efficient approach.\r\n\r\nThus, we created Asta4D. Currently, Asta4D is driving our service site:[astamuse.com](http://astamuse.com)\r\n\r\n## What does \"Asta4D\" mean\r\n\r\nThe name of Asta4D is from our company's name: astamuse. We explain the \"4D\" as following ways:\r\n\r\n1. For designers\r\n    \r\n    Asta4D consider the design friendliness as the most important factor of itself. We hope web designers can fulfil their maximum potential of creativity without squandering their time on the back-end technologies which they could never be adept at.\r\n\r\n1. For developers\r\n    \r\n    We hope Asta4D can help developers to achieve their work more easily. Developers would never be afflicted with complex rendering logic because they can use powerful Java language to do whatever they want since the rendering has been split from template files. View first also releases developers from the cumbersome MVC architecture, now they have more time to have a cup of coffee.\r\n\r\n1. 4 dimension\r\n    \r\n    We believe that Asta4D can act as a wormhole that connects the front-end and the back-end. We can move quicker by Asta4D just like we are going through the 4 dimensional space.\r\n\r\n## How Asta4D helps us\r\n\r\nAsta4D is our solution to combat those issues. Thanks to lift, from where we learn a lot. We designed Asta4D complying with the following points:\r\n\r\n1. Separate template and rendering logic\r\n    \r\n    Asta4D affords front-end engineers a friendly environment by separating rendering logic from template files which are pure html files. At the mean time, back-end engineers can use the powerful Java language to implement the rendering logic without being suffering from the \"poor and sometimes magic\" template languages.\r\n\r\n    There is no dynamic code in template file. An Asta4D template file is always a pure HTML file which can be easily maintained by front-end developers, it is very design friendly and we can reduce the workload for source refactoring by over 90%.\r\n\r\n\r\n    ```html\r\n    \u003csection\u003e\r\n        \u003carticle\u003e\r\n            \u003cdiv afd:render=\"SimpleSnippet\"\u003edummy text\u003c/div\u003e\r\n            \u003cafd:snippet render=\"SimpleSnippet:setProfile\"\u003e\r\n                \u003cp id=\"name\"\u003ename:\u003cspan\u003edummy name\u003c/span\u003e\u003c/p\u003e\r\n                \u003cp id=\"age\"\u003eage:\u003cspan\u003e0\u003c/span\u003e\u003c/p\u003e\r\n            \u003c/afd:snippet\u003e\r\n        \u003c/article\u003e\r\n    \u003c/section\u003e\r\n    ```\r\n\r\n    In the snippet class, we use traditional CSS selector to reference rendering target, amazing and powerful.\r\n    \r\n    \r\n    ```java\r\n    public class SimpleSnippet {\r\n    \r\n        public Renderer render(String name) {\r\n            if (StringUtils.isEmpty(name)) {\r\n                name = \"Asta4D\";\r\n            }\r\n            return Renderer.create(\"div\", name);\r\n        }\r\n    \r\n        public Renderer setProfile() {\r\n            Renderer render = Renderer.create();\r\n            render.add(\"p#name span\", \"asta4d\");\r\n            render.add(\"p#age span\", 20);\r\n            return render;\r\n        }\r\n    }\r\n    ```\r\n\r\n1. Testable Rendering logic\r\n\r\n    All of the rendering logic of Asta4D is testable and you can simply test them by write simple junit cases, which can replace over than half of selenium tests.\r\n\r\n    ```java\r\n        // prepare test target\r\n        Renderer render = Renderer.create();\r\n        render.add(\"#someIdForInt\", 12345);\r\n    \r\n        // perform test\r\n        RendererTester tester = RendererTester.forRenderer(render);\r\n        Assert.assertEquals(tester.get(\"#someIdForInt\"), 12345);\r\n    \r\n    ```\r\n    \r\n    Rendering for list data can be performed as well\r\n    \r\n    ```java\r\n        // prepare test target\r\n        Renderer render = Renderer.create();\r\n        render.add(\"#someIdForInt\", Arrays.asList(123, 456, 789));\r\n    \r\n        // perform test\r\n        RendererTester tester = RendererTester.forRenderer(render);\r\n        Assert.assertEquals(tester.getAsList(\"#someIdForInt\"), Arrays.asList(123, 456, 789));\r\n    \r\n    ```\r\n    \r\n    [Further samples for test](https://github.com/astamuse/asta4d/blob/develop/asta4d-core/src/test/java/com/astamuse/asta4d/test/unit/RenderTesterTest.java)\r\n\r\n1. High security of being immune from cross-site(XSS/CSRF)\r\n    \r\n    Asta4D is, by nature, immune from cross-site(XSS/CSRF) problems. You do not need to take care of cross-site any more. All the rendered value would be escaped by default and your clients have no chance to put malicious contents to your server.\r\n\r\n1. View first\r\n    \r\n    Asta4D also affords higher productivity than traditional MVC architecture by View First mechanism. And it is also easier to change than MVC architecture.\r\n\r\n    A controller is not necessary for request dispatch. All the requests cound be dispatched by a sort of predefined URL matching rules and could be forwarded to template files directly, which is called as view first.\r\n    \r\n    ```java\r\n    rules.add(\"/app/\", \"/templates/index.html\");\r\n    ```\r\n\r\n1. Isolate side effect with request handler\r\n    \r\n    Asta4D imports the conception of \"side-effect\" from functional programming languages and separating the \"side-effect\" by request handlers, which afford more flexibility on page rendering because the view layer is side-effect free now. Therefore Asta4D allows parallel page rendering in multiple threads as a built-in feature.\r\n\r\n\t[See details about side effect](http://astamuse.github.io/asta4d/userguide/#chapter-side-effect)\r\n\r\n1. Advanced MVC\r\n\t\r\n\tAsta4D also affords a evolved MVC architecture which is more clarified for the duty of each application layer than the traditional MVC architecture.\r\n\r\n\tBy traditional MVC architecture, we often have to expand the transaction from the controller layer across to the view layer to combat the lazy load issue, which ugly structure is essentially caused by the tangled controller which holds various unrelated duties.\r\n  \r\n\tIt is also strange that we have to modify our controller's implementation at every time we change the page appearance at view layer. Such situation could not satisfy us since the layers are not uncoupled really.\r\n  \r\n\tWe would say that the traditional controller is indeed a tangled magic container for most logics, a controller will unfortunately be coupled to most layers in the system even our initial purpose of MVC is to uncouple our logics. By contrast, Asta4D allows developers to really uncouple all the tangled logics easily. Basically we could split the traditional controller's duty to following parts:\r\n\t\r\n\t-\trequest handler\r\n      \r\n\t\tWhich takes the responsibilities of all the operations with side-effect.\r\n\r\n\t-\tresult matching in url rule\r\n\r\n\t\tWhich dispatches the request to different views according to the result from request handler\r\n\r\n\t-\tsnippet class\r\n\r\n\t\tWhich has the responsibility to render data to the page and also holds the obligation of preparing all the necessary data for page rendering.\r\n\r\n\tBy above architecture, we could perfectly uncouple our logics by clarifying the obligation of each layer.\r\n\r\n1. Built-in form flow mechanism\r\n\r\n    Asta4D treat all the form processes as flow and afford a well defined architecture for various form processes. Asta4D gives developers the possibility of concentrating on their real business logics rather than technic issues. Basically, developers only need to implement an init method and an update method for a form process.\r\n\r\n    ```java\r\n    public class SingleInputFormHandler extends OneStepFormHandler\u003cPersonForm\u003e {\r\n    \r\n        @Override\r\n        protected PersonForm createInitForm() throws Exception {\r\n            ...\r\n        }\r\n    \r\n        @Override\r\n        protected void updateForm(PersonForm form) {\r\n            ...\r\n        }\r\n    \r\n    }\r\n    ```\r\n## Roadmap\r\n\r\n- 1.1.x (maintainance)\r\n\r\n    bugfix\r\n\r\n- 1.2 (developing)\r\n\r\n    no plain yet\r\n\r\n\r\n\r\n## LICENSE\r\n\r\nApache License, Version 2.0\r\n\r\n    Copyright 2012 astamuse company,Ltd.\r\n\r\n    Licensed under the Apache License, Version 2.0 (the \"License\");\r\n    you may not use this file except in compliance with the License.\r\n    You may obtain a copy of the License at\r\n\r\n        http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n    Unless required by applicable law or agreed to in writing, software\r\n    distributed under the License is distributed on an \"AS IS\" BASIS,\r\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n    See the License for the specific language governing permissions and\r\n    limitations under the License.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastamuse%2Fasta4d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastamuse%2Fasta4d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastamuse%2Fasta4d/lists"}