chaoxihailing / demo

It can work with mysql, but not complete login
0 stars 0 forks source link

restful 路径变量问题 #5

Open chaoxihailing opened 7 years ago

chaoxihailing commented 7 years ago

如果有多个路径变量,例如'section/${sectionName}/list',到'section/${sectionName}/subject/${subjectName}',可以它们不是同一个表单提交的,所以解决

觉得有俩个解决思路:1. 将‘section/${sectionName}/subject/${subjectName}’存放在session

chaoxihailing commented 7 years ago

关于rest风格,在现实生活中的应用,比如论坛,理想中的rest风格的URL很好,比如说可以明确资源的信息,但是在现实实现却有点不现实,比如rest风格的URL‘/section/${sectionName}/subject/${subjectName/list}’,看似实现了面向资源的URL,但是如果‘${sectionName}’是中文的话,难道要写中文到URL?,还有要额外保证‘sectionName’的唯一性,如果使用自增长主键的话可以很简单的实现唯一性,和避免中文。看一下知乎,就是这种写法,还有小密圈。