Write Sling Servlet using a resource type and selector
@SlingServlet(
resourceTypes = "geometrixx/components/homepage",
selectors = "data",
extensions = "html",
methods = {"GET", "POST"},
metatype =true)
public class SimpleServlet extends SlingSafeMethodsServlet {
...
}
要注意的是, 提交POST 请求的时候, 一定要在URL里面添加_jcr_content, 比如:
http://localhost:4502/content/geometrixx/en/_jcr_content.data.html ,否则servlet不会捕获POST请求
详细参考 http://www.aemcq5tutorials.com/tutorials/sling-servlet-in-aem/#sling_servlet_using_selector
Write Sling Servlet using a resource type and selector的更多相关文章
- Ambari源代码分析之Resource.Type与ResourceProvider相应关系
前面提到.每一种Resource都相应一个ResourceProvider,以下给出其相应关系: Resource.Type ResourceProvider Workflow WorkflowRes ...
- VS2010编译以前版本工程时 ERROR CVT1100:duplicate resource,type:MANIFEST解决办法
1.将 Resource Files 里面的 *.exe.manifest 文件删除 2.右键选择 *.rc 文件,选择 view code,查找并删除所有引用 *.exe.manifest 文件的代 ...
- system.stat[resource,<type>]
系统信息. 整型或者浮点型 ent - 该分区有权接收的处理器单元数(float) kthr, - 关于内核线程状态的信息: r - 平均可运行内核线程数(float) b - 虚拟内存管理器等待队列 ...
- PWC6199:Generated servlet error:Only a type can be imported. org.apache.jasper.tagplugins.jstl.core.ForEach resolves to a package
<%@ import="org.apache.jasper.tagplugins.jstl.core.ForEach"%> 去掉这条语句,就不报错了.所以问题就出在这里 ...
- Servlet追忆篇:那些年一起学习的Servlet
title: servlet notebook: javaWEB tags:servlet --- Servlet是什么? Servlet是JavaWeb的三大组件之一. 作用类似银行前台接待: 接收 ...
- 《JavaWeb从入门到改行》那些年一起学习的Servlet
目录 获取ServletContext : ServletContext接口中的一些方法 application域存取数据功能 代码演示: application域获取项目文件路径 代码演示: API ...
- 深圳宝安图书馆官网错误 HTTP Status 500 - Servlet.init() for servlet spring threw exception
停留了一段时间没有动 打开https://www.balib.cn/balib/category/152 *********************************************** ...
- Spring5:@Autowired注解、@Resource注解和@Service注解
什么是注解 传统的Spring做法是使用.xml文件来对bean进行注入或者是配置aop.事物,这么做有两个缺点: 1.如果所有的内容都配置在.xml文件中,那么.xml文件将会十分庞大:如果按需求分 ...
- Servlet入门笔记
一.一个简单的Servlet 在servlet 3.0之前,下面是基本步骤: 1.新建一个class名为FirstServlet,让它继承javax.servlet.http.HttpServlet: ...
随机推荐
- com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value '��� mysql-installer-community-8.0.15.0
<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> &l ...
- [批处理]使用IncrediBuilder加速自动化测试过程
背景 1.目前单机全部跑完一次测试的时间大概是5个小时 2.7个虚拟机进行分布式执行的时间大概为3.5小时(包含复制.收集日志的时间) 预期 期望通过IncrediBuilder的虚拟进程的功能在单机 ...
- BELLMEN-FORD普通
#include <iostream> using namespace std; int m, n, u[100010], v[100010], w[100010];int check;i ...
- python 文件重命名
将文件夹中的.jsp重命名为.html import os def rename(path): files = os.listdir(path) for file in files: dir = os ...
- mount挂载相关参数详解
mount [ -t 设备类型 ] [ -o 扩展参数 ] dev dir -t:指定mount挂载设备类型,常见的类型有nfs.ntfs.vfat.iso9660等: is09 ...
- 基于ROS完成寻迹运动
安装opencv功能包: $ sudo apt-get install ros-indigo-version-opencv libopencv-dev python-opencv 检测指示线: #! ...
- GHSpro多数据库连接
GHSpro多数据库连接 文章 1 数据连接 XXX.Application.Web -> XmlConfig -> database.config <connectionStrin ...
- ORA-00338
dg环境从库报错:ORA-00338: log 5 of thread 1 is more recent than control fileORA-00312: online log 5 thread ...
- Mac 虚拟打印机PDFWriter on Sierra
之前就装过PdfWriter,第一次装的时候失败了,后来在app store 装了PDF Printer,好像挺好用的,但是升级有点贵.又回去研究了一下PDFWriter. 和PDFWriter在so ...
- 纯CSS3完成选项卡,不要js完成的选项卡
我爱撸码,撸码使我感到快乐!大家好,我是Counter.今天就来敲一敲,选项卡,注意哦,不是一般利用js完成的选项卡,今天是纯用HTML和CSS来完成的,这怎么可能?那你不用js的点击事件,怎么处理? ...