1.1 --- a/java/nekurak.net-web/web/WEB-INF/web.xml Tue Jan 25 20:28:32 2011 +0100
1.2 +++ b/java/nekurak.net-web/web/WEB-INF/web.xml Tue Jan 25 22:03:46 2011 +0100
1.3 @@ -1,112 +1,120 @@
1.4 <?xml version="1.0" encoding="UTF-8"?>
1.5 <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
1.6 - <session-config>
1.7 - <session-timeout>30</session-timeout>
1.8 - </session-config>
1.9 - <welcome-file-list>
1.10 - <welcome-file>index.jsp</welcome-file>
1.11 - </welcome-file-list>
1.12 + <session-config>
1.13 + <session-timeout>30</session-timeout>
1.14 + </session-config>
1.15 + <welcome-file-list>
1.16 + <welcome-file>index.jsp</welcome-file>
1.17 + </welcome-file-list>
1.18 <!-- <chybovéStránky> -->
1.19 - <error-page>
1.20 + <error-page>
1.21 <!-- Stránka nenalezena -->
1.22 - <error-code>404</error-code>
1.23 - <location>/WEB-INF/chyby/404.jsp</location>
1.24 - </error-page>
1.25 - <error-page>
1.26 + <error-code>404</error-code>
1.27 + <location>/WEB-INF/chyby/404.jsp</location>
1.28 + </error-page>
1.29 + <error-page>
1.30 <!-- Interní chyba serveru -->
1.31 - <error-code>500</error-code>
1.32 - <location>/WEB-INF/chyby/500.jsp</location>
1.33 - </error-page>
1.34 + <error-code>500</error-code>
1.35 + <location>/WEB-INF/chyby/500.jsp</location>
1.36 + </error-page>
1.37 <!-- </chybovéStránky> -->
1.38 - <listener>
1.39 - <listener-class>cz.frantovo.nekurak.posluchac.OchranaProtiCSRF</listener-class>
1.40 - </listener>
1.41 + <listener>
1.42 + <listener-class>cz.frantovo.nekurak.posluchac.OchranaProtiCSRF</listener-class>
1.43 + </listener>
1.44 <!-- <definiceServletů> -->
1.45 - <servlet>
1.46 - <servlet-name>atom</servlet-name>
1.47 - <jsp-file>/WEB-INF/atom/atom.jsp</jsp-file>
1.48 - </servlet>
1.49 - <servlet>
1.50 - <description>
1.51 + <servlet>
1.52 + <servlet-name>podnik</servlet-name>
1.53 + <servlet-class>cz.frantovo.nekurak.servlet.Podnik</servlet-class>
1.54 + </servlet>
1.55 + <servlet>
1.56 + <servlet-name>atom</servlet-name>
1.57 + <jsp-file>/WEB-INF/atom/atom.jsp</jsp-file>
1.58 + </servlet>
1.59 + <servlet>
1.60 + <description>
1.61 Servlet zpřístupňující fotky umístěné ve zvláštním adresáři
1.62 (data oddělená od aplikace).
1.63 </description>
1.64 - <servlet-name>fotky</servlet-name>
1.65 - <servlet-class>cz.frantovo.nekurak.servlet.Fotky</servlet-class>
1.66 - <init-param>
1.67 - <description>
1.68 + <servlet-name>fotky</servlet-name>
1.69 + <servlet-class>cz.frantovo.nekurak.servlet.Fotky</servlet-class>
1.70 + <init-param>
1.71 + <description>
1.72 Adresář na disku, který obsahuje fotky podniků.
1.73 Musí existovat při startu aplikace.
1.74 </description>
1.75 - <param-name>adresar</param-name>
1.76 - <param-value>/var/www/nekurak.net/fotky</param-value>
1.77 - </init-param>
1.78 - <load-on-startup>1</load-on-startup>
1.79 - </servlet>
1.80 - <servlet>
1.81 - <servlet-name>kaptcha</servlet-name>
1.82 - <servlet-class>com.google.code.kaptcha.servlet.KaptchaServlet</servlet-class>
1.83 - </servlet>
1.84 - <servlet>
1.85 - <description>Veřejné REST API (pak máme ještě jedno soukromé, kde musí být uživatel přihlášený)</description>
1.86 - <servlet-name>REST</servlet-name>
1.87 - <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
1.88 - <load-on-startup>1</load-on-startup>
1.89 - </servlet>
1.90 - <servlet>
1.91 - <description>Odesílání a náhledy komentářů pomocí AJAXu.</description>
1.92 - <servlet-name>komentare</servlet-name>
1.93 - <servlet-class>cz.frantovo.nekurak.servlet.Komentare</servlet-class>
1.94 - </servlet>
1.95 + <param-name>adresar</param-name>
1.96 + <param-value>/var/www/nekurak.net/fotky</param-value>
1.97 + </init-param>
1.98 + <load-on-startup>1</load-on-startup>
1.99 + </servlet>
1.100 + <servlet>
1.101 + <servlet-name>kaptcha</servlet-name>
1.102 + <servlet-class>com.google.code.kaptcha.servlet.KaptchaServlet</servlet-class>
1.103 + </servlet>
1.104 + <servlet>
1.105 + <description>Veřejné REST API (pak máme ještě jedno soukromé, kde musí být uživatel přihlášený)</description>
1.106 + <servlet-name>REST</servlet-name>
1.107 + <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
1.108 + <load-on-startup>1</load-on-startup>
1.109 + </servlet>
1.110 + <servlet>
1.111 + <description>Odesílání a náhledy komentářů pomocí AJAXu.</description>
1.112 + <servlet-name>komentare</servlet-name>
1.113 + <servlet-class>cz.frantovo.nekurak.servlet.Komentare</servlet-class>
1.114 + </servlet>
1.115 <!-- </definiceServletů> -->
1.116 <!-- <mapováníServletů> -->
1.117 - <servlet-mapping>
1.118 - <servlet-name>fotky</servlet-name>
1.119 - <url-pattern>/fotky/*</url-pattern>
1.120 - </servlet-mapping>
1.121 - <servlet-mapping>
1.122 - <servlet-name>atom</servlet-name>
1.123 - <url-pattern>/atom/*</url-pattern>
1.124 - </servlet-mapping>
1.125 - <servlet-mapping>
1.126 - <servlet-name>kaptcha</servlet-name>
1.127 - <url-pattern>/kaptcha.jpg</url-pattern>
1.128 - </servlet-mapping>
1.129 - <servlet-mapping>
1.130 + <servlet-mapping>
1.131 + <servlet-name>podnik</servlet-name>
1.132 + <url-pattern>/podnik/*</url-pattern>
1.133 + </servlet-mapping>
1.134 + <servlet-mapping>
1.135 + <servlet-name>fotky</servlet-name>
1.136 + <url-pattern>/fotky/*</url-pattern>
1.137 + </servlet-mapping>
1.138 + <servlet-mapping>
1.139 + <servlet-name>atom</servlet-name>
1.140 + <url-pattern>/atom/*</url-pattern>
1.141 + </servlet-mapping>
1.142 + <servlet-mapping>
1.143 + <servlet-name>kaptcha</servlet-name>
1.144 + <url-pattern>/kaptcha.jpg</url-pattern>
1.145 + </servlet-mapping>
1.146 + <servlet-mapping>
1.147 <!-- Veřejné REST API -->
1.148 - <servlet-name>REST</servlet-name>
1.149 - <url-pattern>/zdroje/*</url-pattern>
1.150 - </servlet-mapping>
1.151 - <servlet-mapping>
1.152 - <servlet-name>komentare</servlet-name>
1.153 - <url-pattern>/komentare</url-pattern>
1.154 - </servlet-mapping>
1.155 + <servlet-name>REST</servlet-name>
1.156 + <url-pattern>/zdroje/*</url-pattern>
1.157 + </servlet-mapping>
1.158 + <servlet-mapping>
1.159 + <servlet-name>komentare</servlet-name>
1.160 + <url-pattern>/komentare</url-pattern>
1.161 + </servlet-mapping>
1.162 <!-- </mapováníServletů> -->
1.163 - <context-param>
1.164 + <context-param>
1.165 <!-- Pro případ, že chybí hlavička „Accept-language“ v HTTP požadavku -->
1.166 - <param-name>javax.servlet.jsp.jstl.fmt.fallbackLocale</param-name>
1.167 - <param-value>cs</param-value>
1.168 - </context-param>
1.169 + <param-name>javax.servlet.jsp.jstl.fmt.fallbackLocale</param-name>
1.170 + <param-value>cs</param-value>
1.171 + </context-param>
1.172 <!-- <zabezpečení> -->
1.173 - <security-role>
1.174 - <role-name>opravneny</role-name>
1.175 - </security-role>
1.176 - <security-constraint>
1.177 - <web-resource-collection>
1.178 - <web-resource-name>Správa Nekuřák.net</web-resource-name>
1.179 - <url-pattern>/sprava/*</url-pattern>
1.180 - </web-resource-collection>
1.181 - <auth-constraint>
1.182 - <role-name>opravneny</role-name>
1.183 - </auth-constraint>
1.184 - </security-constraint>
1.185 - <login-config>
1.186 - <auth-method>FORM</auth-method>
1.187 - <realm-name>nekurakNET</realm-name>
1.188 - <form-login-config>
1.189 - <form-login-page>/?akce=prihlaseni</form-login-page>
1.190 - <form-error-page>/?akce=prihlaseni&chyba=ano</form-error-page>
1.191 - </form-login-config>
1.192 - </login-config>
1.193 + <security-role>
1.194 + <role-name>opravneny</role-name>
1.195 + </security-role>
1.196 + <security-constraint>
1.197 + <web-resource-collection>
1.198 + <web-resource-name>Správa Nekuřák.net</web-resource-name>
1.199 + <url-pattern>/sprava/*</url-pattern>
1.200 + </web-resource-collection>
1.201 + <auth-constraint>
1.202 + <role-name>opravneny</role-name>
1.203 + </auth-constraint>
1.204 + </security-constraint>
1.205 + <login-config>
1.206 + <auth-method>FORM</auth-method>
1.207 + <realm-name>nekurakNET</realm-name>
1.208 + <form-login-config>
1.209 + <form-login-page>/?akce=prihlaseni</form-login-page>
1.210 + <form-error-page>/?akce=prihlaseni&chyba=ano</form-error-page>
1.211 + </form-login-config>
1.212 + </login-config>
1.213 <!-- </zabezpečení> -->
1.214 </web-app>