本文整理汇总了Java中org.osgl.mvc.annotation.GetAction类的典型用法代码示例。如果您正苦于以下问题:Java GetAction类的具体用法?Java GetAction怎么用?Java GetAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GetAction类属于org.osgl.mvc.annotation包,在下文中一共展示了GetAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: home
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@GetAction
public void home(@Context AppJobManager jobManager) {
String engine = "rythm";
jobManager.now(new Runnable() {
@Override
public void run() {
System.out.println("home entry invoked");
}
});
jobManager.delay(new Runnable() {
@Override
public void run() {
System.out.println("delayed log");
}
}, "5s");
Controller.Util.render(engine);
}
示例2: size
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@GetAction("/size")
public void size(@Size(max = 5) String text, @Size(min = 2) List<H.Format> list) {
if (context.hasViolation()) {
renderText("Error(s): \n%s", context.violationMessage());
}
renderText("size success with %s and %s", text, $.toString2(list));
}
示例3: notNull
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@GetAction("/notNull")
public Result notNull(@NotNull H.Format fmt) {
if (context.hasViolation()) {
return text("Error(s): \n%s", context.violationMessage());
}
return text("not null success with %s", fmt);
}
示例4: digits
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@GetAction("/digits")
public void digits(@Digits(integer = 4, fraction = 2) String str, ActionContext context, @Digits(integer = 3, fraction = 0) Integer num) {
if (context.hasViolation()) {
renderText("Error(s): \n%s", context.violationMessage());
}
renderText("digits success with %s and %s", str, num);
}
示例5: foo
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@GetAction("foo")
public void foo(@Valid Foo x) {
if (context.hasViolation()) {
renderText("Error(s): \n%s", context.violationMessage());
}
renderText("POJO validate success with %s", x);
}
示例6: getFoo
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@Command("foo.show")
@GetAction("/foo/{id}")
@PropertySpec(Foo.DETAIL_VIEW)
@TableView
public Foo getFoo(int id) {
return dispatch(id, $.F.<Foo>identity());
}
示例7: list
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@Command(value = "st.list", help = "list all students")
@GetAction
@TableView
//@PropertySpec(http = "-x", cli = Student.TABLE_VIEW)
public List<Student> list() {
return studentManager.findAll();
}
示例8: show
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@Command(name = "st.show", help = "show information about a student")
@GetAction("/{id}")
@JsonView
public Student show(String id) {
Student student = studentManager.findById(id);
notFoundIfNull(student);
return student;
}
示例9: list
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@GetAction
public Iterable<Product> list(String q) {
if (S.notBlank(q)) {
return dao.findBy("name", Pattern.compile(q, Pattern.CASE_INSENSITIVE));
}
return dao.findAll();
}
示例10: testRemoteFetch
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@GetAction("/rmt")
public String testRemoteFetch(StorageServiceManager ssm) {
String url = "https://propertymanage.atlassian.net/secure/projectavatar?pid=10400&avatarId=11200";
ISObject sobj = new SObjectResolver().resolve(url);
//sobj.setAttribute(ISObject.ATTR_FILE_NAME, "remote_file.png");
IStorageService ss = ssm.storageService("store1");
sobj = ss.put(ss.getKey(), sobj);
return sobj.getUrl();
}
示例11: text
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@GetAction("/txt")
//@NonBlock
//@NoImplicitTemplateVariable
//@SessionFree
public String text() {
return "Hello World";
}
示例12: gh158
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@GetAction("158")
public final void gh158() throws IOException {
try (InputStream is = new FileInputStream("pom.xml")) {
String pom = IO.readContentAsString(is);
throw render(pom);
}
}
示例13: check
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@GetAction("/inject/conf")
public String check() {
if (null == p1) {
return "p1 should not be null";
}
if (p1 != p2 || p2 != p3) {
return "p1 p2 and p3 shall be the same instance";
}
return "success";
}
示例14: testExcel
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@GetAction("/excel/test")
@TemplateContext("report")
public Result testExcel(ActionContext context) {
User user = new User(S.random());
context.param("filename", user.name + ".xls");
return render("user", user);
}
示例15: list
import org.osgl.mvc.annotation.GetAction; //导入依赖的package包/类
@GetAction("/list")
public Iterable<TodoItem> list(String q) {
if (S.notBlank(q)) {
return dao.findBy("desc like", q);
}
return dao.findAll();
}