普通网友 2012-12-13 11:38
浏览 165
已采纳

求正则,求方案------过滤非正规渠道访问文件。

比如以下为有效链接,除此以为均为无效链接。应该使用正则过滤还是有更好的方案?
/project/navi
/project/navi/default_3B.htm
/project/navi/library_not_exist.jsp
/project/navi/navi.jsp
/project/navi/navi_temp.jsp
/project/navi/others.jsp
/project/admin
/project/admin/blank.html
/project/admin/admin.jsp
/project/admin/details.jsp
/project/admin/userList.jsp
/project/bookmark
/project/bookmark/add_bookmark.jsp
/project/bookmark/add_success.jsp
/project/bookmark/bookmark.jsp
/project/bookmark/mark_edit.jsp
/project/note
/project/note/add_note.jsp
/project/note/add_success.jsp
/project/note/details.jsp
/project/note/feedback.jsp
/project/note/notes.jsp
/project/note/notesfile_error.jsp
/project/note/notes_edit.jsp
/project/note/notes_upload.jsp
/project/note/topicNoteDetail.jsp
/project/note/topicNoteEdit.jsp
/project/note/topic_note.jsp
/project/search
/project/search/advance_search_result.jsp
/project/search/adv_search_home.jsp
/project/search/adv_search_lib.jsp
/project/search/home_search_result.jsp
/project/search/index_not_exist.jsp
/project/search/keyword.jsp
/project/search/lib_search_result.jsp
/project/home
/project/home/details.jsp
/project/home/FFInvalid.jsp
/project/home/index.jsp
/project/home/lib_not_exist.jsp
/project/home/login.jsp
/project/common
/project/common/error.jsp
/project/common/header.jsp
/project/common/i18nLib.jsp
/project/ua
/project/ua/moreResults.jsp
/project/ua/navi.jsp
/project/ua/related.jsp
/project/ua/search.jsp
/project/ua/toc.jsp
/project/ua/tocContent.jsp
/project/ua/tocTop.jsp
/project/ua/top.jsp
/project/ua/ua.jsp
/project/ua/ua_navi.jsp
/project/upgrade
/project/upgrade/dbUpgradeWelcome.jsp

  • 写回答

1条回答 默认 最新

  • jinnianshilongnian 2012-12-13 11:59
    关注

    AntPathMatcher即可,适合做路径映射

    一般可以把这些配置在properties文件中,然后读取判断

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Mac虚拟机安装Windows,Windows中用idea跑项目,报错process finished with exit code -1073741819(0xc0000005) 如何解决?
  • ¥15 关于python爬虫返回js数据结构的处理
  • ¥15 ubuntu所用stm32标准库开发烧录没反映
  • ¥15 运维工程师(在职人员回答)
  • ¥15 Kmeans的趋势分析有会的吗
  • ¥20 R语言单细胞测序 对seurat对象进行标准化时出现问题
  • ¥15 请问如何在matlab里使用raven工具?
  • ¥100 关于ios手游充值到一定金额,再点充值提示公众号的问题。
  • ¥15 求一个stm32串口控制程序
  • ¥20 Windows 驱动开发版本疑问相关