{"id":17004864,"url":"https://github.com/clickermonkey/jayjax","last_synced_at":"2025-03-22T10:39:24.481Z","repository":{"id":14007890,"uuid":"16709367","full_name":"ClickerMonkey/Jayjax","owner":"ClickerMonkey","description":"The easiest way to call your Java code from JavaScript or form submits. Minimal configuration, create a public API, upload files, and automatic object serialization.","archived":false,"fork":false,"pushed_at":"2014-02-21T19:36:02.000Z","size":912,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-27T10:23:15.531Z","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":"osl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ClickerMonkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-10T21:07:16.000Z","updated_at":"2014-02-21T19:36:03.000Z","dependencies_parsed_at":"2022-08-28T20:50:52.212Z","dependency_job_id":null,"html_url":"https://github.com/ClickerMonkey/Jayjax","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickerMonkey%2FJayjax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickerMonkey%2FJayjax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickerMonkey%2FJayjax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClickerMonkey%2FJayjax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClickerMonkey","download_url":"https://codeload.github.com/ClickerMonkey/Jayjax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244945597,"owners_count":20536295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-10-14T04:44:38.571Z","updated_at":"2025-03-22T10:39:24.450Z","avatar_url":"https://github.com/ClickerMonkey.png","language":"Java","readme":"jayjax\n======\n\nThe easiest way to call your Java code from JavaScript or form submits. \n\n**Features**\n- Minimal configuration.\n- Expose your methods for API calls. i.e. `GET /user/profile/123414`\n- Generates JavaScript for making asynchronous calls to defined methods.\n- Automatic serialization of objects, no configuration or coding required.\n- Single \u0026 Multiple File uploading.\n- Controller scopes. One instance per request, session, thread, or application.\n- Regular Expressions in actions for pretty URLs. i.e. `/user/(.+)`\n- Pass special variables with $variableName. i.e. `$request`, `$response`, `$session`, `$cookie[0]`, `$session[user]`, etc.\n- Validator invoked before method with all available information.\n- Add your own converters when the default isn't sufficient.\n- Only allow function calls on secure connections.\n\n## Example\n\n#### Configuration (WEB-INF/jayjax.xml)\n```xml\n\u003ccontroller class=\"com.company.MyController\" name=\"MyController\" javascript=\"true\"\u003e\n  \u003cfunction action=\"/user/(\\d+)\" method=\"GET\" invoke=\"getUser(#1)\" /\u003e\n  \u003cfunction action=\"/blog/post\" method=\"POST|GET\" invoke=\"post($session[user],title,description)\" /\u003e\n  \u003cfunction action=\"/user/profile/update\" method=\"POST\" invoke=\"update($session[user],name,picture)\" /\u003e\n\u003c/controller\u003e\n```\n#### Java\n```java\npublic class MyController {\n    public User getUser(long userId) {\n        // ...\n    }\n    public long post(User user, String title, String description) {\n        // ...\n    }\n    public boolean update(User user, String name, Part picture) {\n        // ...\n    }\n}\n```\n#### JavaScript\n```html\n\u003cscript src=\"/js/MyController.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  MyController.getUser(332, {\n    success: function(user,status,xhr) {\n      // process user\n    }\n  });\n  MyController.post('Title', 'Description', {\n    success: function(postId,status,xhr) {\n      // success!\n    }\n  });\n\u003c/script\u003e\n```\n#### HTML\n```html\n\u003c!-- MyController.post --\u003e\n\u003cform action=\"/jj/blog/post\" method=\"POST\"\u003e\n    \u003cinput type=\"text\" name=\"title\"\u003e\n    \u003ctextarea name=\"description\"\u003e\u003c/textarea\u003e\n    \u003cbutton type=\"submit\"\u003eSubmit Blog Post\u003c/button\u003e\n\u003c/form\u003e\n\u003c!-- MyController.update --\u003e\n\u003cform action=\"/jj/user/profile/update\" method=\"POST\" enctype=\"multipart/form-data\"\u003e\n    \u003cinput type=\"text\" name=\"name\"\u003e\n    \u003cinput type=\"file\" name=\"picture\"\u003e\n    \u003cbutton type=\"submit\"\u003eUpdate Name and Picture\u003c/button\u003e\n\u003c/form\u003e\n```\n#### Configuration (WEB-INF/web.xml)\n```xml\n\u003cservlet\u003e\n    \u003cservlet-name\u003ejayjax\u003c/servlet-name\u003e\n    \u003cservlet-class\u003eorg.magnos.jayjax.FunctionServlet\u003c/servlet-class\u003e\n    \u003cmultipart-config\u003e\n        \u003cmax-file-size\u003e52428800\u003c/max-file-size\u003e\n        \u003cmax-request-size\u003e52428800\u003c/max-request-size\u003e\n        \u003cfile-size-threshold\u003e0\u003c/file-size-threshold\u003e\n    \u003c/multipart-config\u003e\n\u003c/servlet\u003e\n\u003cservlet-mapping\u003e\n    \u003cservlet-name\u003ejayjax\u003c/servlet-name\u003e\n    \u003curl-pattern\u003e/jj/*\u003c/url-pattern\u003e\n\u003c/servlet-mapping\u003e\n\u003cservlet\u003e\n    \u003cservlet-name\u003ejayjax javascript\u003c/servlet-name\u003e\n    \u003cservlet-class\u003eorg.magnos.jayjax.JavascriptServlet\u003c/servlet-class\u003e\n\u003c/servlet\u003e\n\u003cservlet-mapping\u003e\n    \u003cservlet-name\u003ejayjax javascript\u003c/servlet-name\u003e\n    \u003curl-pattern\u003e/js/*\u003c/url-pattern\u003e\n\u003c/servlet-mapping\u003e\n```\n\n#### TODO\n- Add basic validators\n  - Non-null arguments\n  - Validator list\n  - Authorization (OpenAuth?)\n- Testing\n  - Test ALL special variables\n- Type Annotation to use generic classes as in-parameters (can only be used as out since type information is not available)\n- Decide\n  - What to do about circular references\n- Performance\n  - Stress Test\n- Add JSON-RPC server over TCP and HTTP\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclickermonkey%2Fjayjax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclickermonkey%2Fjayjax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclickermonkey%2Fjayjax/lists"}