我目前的配置是
class model {
private String name;
private String id;
private String url;
}
mListView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Object obj = mListView.getAdapter().getItem(position);
function(objct.getkey());
}
});
private void function(String uid){
mdatabaseReference.child("hamza").orderByKey().equalTo(uid).addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot postsnapshot :dataSnapshot.getChildren()) {
String key = postsnapshot.getKey();
dataSnapshot.getRef().removeValue();
}
}
匹配
server{
listen 80;
server_name some.com;
location /{
root /var/www;
index index.html;
}
}
- &gt; /
/var/www/index.html
- &gt; /container
我希望位置匹配不会附加到根目录。所以匹配将是
/var/www/container/index.html
- &gt; /
/var/www/index.html
- &gt; /container
无论位置如何,它都是相同的,我将动态处理渲染。
答案 0 :(得分:2)
通常的方法是使用try_files
提供默认URI:
server{
listen 80;
server_name some.com;
root /var/www;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
有关详细信息,请参阅this document。