📄 shorturlconstructor.txt
字号:
ShortURLConstructor replaces all wiki pages with a reference to the /wiki/ -URL, with a special parameter which tells which action is to be taken. For example, {{{/Edit.jsp?page=WikiPage}}} gets replaced with {{{/wiki/WikiPage?do=Edit}}}.
ShortURLConstructor will attempt to guess your wiki location from your {{jspwiki.baseURL}} -setting, but if it gets it wrong, you can use the {{jspwiki.shortURLConstructor.prefix}} -setting to point at a different location.
For example, if you changed the path mapping for the WikiServlet in web.xml to /mywiki/* you might do the following:
{{{
jspwiki.baseURL = http://example.com/
jspwiki.urlConstructor = ShortURLConstructor
jspwiki.shortURLConstructor.prefix = /mywiki/
}}}
All relative URLs would look like "/mywiki/Foobar" and all absolute URLs would look like "http://example.com/mywiki/Foobar".
!Note
You should be understand that users can bypass any restrictions in {{web.xml}} if you're using this URLConstructor. All access to the wiki is controlled through the /wiki/ -servlet. If you want to limit user access to certain functionalities, you should use the [ShortViewURLConstructor].
!Troubleshooting
If you get a 404 error when you're using this, check that your {{web.xml}} contains the following lines:
{{{
<servlet>
<servlet-name>WikiServlet</servlet-name>
<servlet-class>com.ecyrd.jspwiki.WikiServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>WikiServlet</servlet-name>
<url-pattern>/wiki/*</url-pattern>
</servlet-mapping>
}}}
----
Back to [URLConstructors].
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -