Search in sources :

Example 1 with Mapping

use of org.noear.solon.annotation.Mapping in project solon by noear.

the class ViewController method dock.

@Mapping("/demo2/view")
public ModelAndView dock() {
    ModelAndView model = new ModelAndView("dock.ftl");
    model.put("title", "dock");
    model.put("msg", "你好 world! in XController");
    return model;
}
Also used : ModelAndView(org.noear.solon.core.handle.ModelAndView) Mapping(org.noear.solon.annotation.Mapping)

Example 2 with Mapping

use of org.noear.solon.annotation.Mapping in project solon by noear.

the class DownController method down3.

@Mapping("f4")
public void down3(Context ctx) throws IOException {
    String filePath = Utils.getResource("static/debug.htm").getFile();
    File file = new File(filePath);
    ctx.outputAsFile(file);
}
Also used : DownloadedFile(org.noear.solon.core.handle.DownloadedFile) File(java.io.File) Mapping(org.noear.solon.annotation.Mapping)

Example 3 with Mapping

use of org.noear.solon.annotation.Mapping in project solon by noear.

the class BeetlView method view.

@Mapping("/demo9/view/beetl")
public ModelAndView view() {
    ModelAndView model = new ModelAndView("beetl.htm");
    model.put("title", "dock");
    model.put("msg", "你好 world! in XController");
    return model;
}
Also used : ModelAndView(org.noear.solon.core.handle.ModelAndView) Mapping(org.noear.solon.annotation.Mapping)

Example 4 with Mapping

use of org.noear.solon.annotation.Mapping in project solon by noear.

the class FreemarkerView method view.

@Mapping("/demo9/view/ftl")
public ModelAndView view() {
    ModelAndView model = new ModelAndView("freemarker.ftl");
    model.put("title", "dock");
    model.put("msg", "你好 world!");
    return model;
}
Also used : ModelAndView(org.noear.solon.core.handle.ModelAndView) Mapping(org.noear.solon.annotation.Mapping)

Example 5 with Mapping

use of org.noear.solon.annotation.Mapping in project solon by noear.

the class test method setVal.

@Mapping("/demob/session/setval")
public void setVal(Context ctx) {
    ctx.sessionSet("v1", new Date());
    ctx.sessionSet("v2", "我是字符串");
    ctx.sessionSet("v3", 121212l);
}
Also used : Date(java.util.Date) Mapping(org.noear.solon.annotation.Mapping)

Aggregations

Mapping (org.noear.solon.annotation.Mapping)152 ArrayList (java.util.ArrayList)23 ModelAndView (org.noear.solon.core.handle.ModelAndView)23 ConfigModel (wateradmin.models.water_cfg.ConfigModel)22 AuthPermissions (org.noear.solon.auth.annotation.AuthPermissions)19 JSONObject (com.alibaba.fastjson.JSONObject)9 Post (org.noear.solon.annotation.Post)9 Date (java.util.Date)8 ONode (org.noear.snack.ONode)8 JakartaRequestAdapter (com.fujieid.jap.http.adapter.jakarta.JakartaRequestAdapter)6 NotEmpty (org.noear.solon.validation.annotation.NotEmpty)6 ViewModel (wateradmin.viewModels.ViewModel)6 Properties (java.util.Properties)5 DataItem (org.noear.weed.DataItem)5 TagCountsModel (wateradmin.models.TagCountsModel)5 ServiceModel (wateradmin.models.water_reg.ServiceModel)5 ConfigModel (xwater.models.view.water_cfg.ConfigModel)5 SQLException (java.sql.SQLException)4 LinkedHashMap (java.util.LinkedHashMap)4 Get (org.noear.solon.annotation.Get)4