/impl/conf/WEB-INF/web.xml |
---|
62,11 → 62,11 |
<filter-name>RelativePathFilter</filter-name> |
<url-pattern>/*</url-pattern> |
</filter-mapping> |
<!--<filter-mapping>--> |
<!--<filter-name>UrlStatFilter</filter-name>--> |
<!--<url-pattern>/*</url-pattern>--> |
<!--</filter-mapping>--> |
<filter-mapping> |
<filter-name>UrlStatFilter</filter-name> |
<url-pattern>/*</url-pattern> |
</filter-mapping> |
<filter-mapping> |
<filter-name>AdminFilter</filter-name> |
<url-pattern>/admin/*</url-pattern> |
</filter-mapping> |
/impl/conf/app.properties |
---|
139,6 → 139,23 |
url.stat.ignore.prefix.6=/js/ |
url.stat.ignore.prefix.7=/auth/ |
#GENERIC FILTER IGNORE UserSessionFilter and CookieFilter |
filter.ignore.extension.1=.js |
filter.ignore.extension.2=.css |
filter.ignore.extension.3=.jpg |
filter.ignore.extension.4=.gif |
filter.ignore.extension.5=.png |
filter.ignore.extension.6=.tif |
filter.ignore.extension.7=.bmp |
filter.ignore.extension.8=.swf |
filter.ignore.prefix.1=/statUnits.jsp |
filter.ignore.prefix.2=/units.jsp |
filter.ignore.prefix.3=/js |
filter.ignore.prefix.4=/css |
#See java.text.SimpleDateFormat |
urlstat.chart.week.days=EEE dd-MMM |
urlstat.chart.month.days=EEE dd-MMM |
/impl/src/java/jomm/dao/impl/AbstractDao.java |
---|
559,7 → 559,6 |
{ |
try |
{ |
for (CLAZZ obj: objs) |
{ |
evictAndDelete(obj); |
/impl/src/java/pt/estgp/estgweb/Globals.java |
---|
55,6 → 55,9 |
public static final List<String> URL_STAT_IGNORE_EXTENSIONS = ConfigProperties.getListValues("url.stat.ignore.extension"); |
public static final List<String> URL_STAT_IGNORE_PREFIXS = ConfigProperties.getListValues("url.stat.ignore.prefix"); |
public static final List<String> FILTER_IGNORE_EXTENSIONS = ConfigProperties.getListValues("filter.ignore.extension"); |
public static final List<String> FILTER_IGNORE_PREFIXS = ConfigProperties.getListValues("filter.ignore.prefix"); |
public static final String SITE_URL = ConfigProperties.getProperty("site.url"); |
public static final String INTRANET_MESSAGES_PREFIX = "intranet."; |
/impl/src/java/pt/estgp/estgweb/domain/UserSessionImpl.java |
---|
133,7 → 133,8 |
public void clearObjectsWithOpenTransaction() |
{ |
clearObjects(); |
DaoFactory.getSessionObjectDaoImpl().evictAndDelete(removeList); |
if(removeList != null && removeList.size() > 0) |
DaoFactory.getSessionObjectDaoImpl().evictAndDelete(removeList); |
} |
/impl/src/java/pt/estgp/estgweb/web/filters/CookieFilter.java |
---|
1,11 → 1,13 |
package pt.estgp.estgweb.web.filters; |
import pt.estgp.estgweb.web.utils.RequestUtils; |
import pt.estgp.estgweb.Globals; |
import javax.servlet.*; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
import java.io.IOException; |
import java.util.List; |
/** |
* |
15,6 → 17,9 |
public class CookieFilter implements Filter |
{ |
public static final List<String> FILTER_IGNORE_EXTENSIONS = Globals.FILTER_IGNORE_EXTENSIONS; |
public static final List<String> FILTER_IGNORE_PREFIXS = Globals.FILTER_IGNORE_PREFIXS; |
public CookieFilter() |
{ |
} |
35,6 → 40,33 |
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
throws IOException, ServletException |
{ |
HttpServletRequest hrequest = (HttpServletRequest) request; |
String relativePath = hrequest.getServletPath(); |
if (relativePath == null) |
relativePath = ""; |
if (hrequest.getPathInfo() != null && hrequest.getPathInfo().length() > 0) |
{ |
relativePath += hrequest.getPathInfo(); |
} |
for (String ignore : FILTER_IGNORE_EXTENSIONS) |
{ |
if (relativePath.endsWith(ignore)) |
{ |
chain.doFilter(request, response); |
return; |
} |
} |
for (String ignore : FILTER_IGNORE_PREFIXS) |
{ |
if (relativePath.startsWith(ignore)) |
{ |
chain.doFilter(request, response); |
return; |
} |
} |
if(RequestUtils.existRequester((HttpServletRequest)request,(HttpServletResponse)response)) |
{ |
chain.doFilter(request, response); |
/impl/src/java/pt/estgp/estgweb/web/filters/UserSessionFilter.java |
---|
11,6 → 11,7 |
import javax.servlet.http.HttpServletResponse; |
import java.io.IOException; |
import java.util.Locale; |
import java.util.List; |
/** |
* |
20,6 → 21,10 |
public class UserSessionFilter implements Filter |
{ |
public static final List<String> FILTER_IGNORE_EXTENSIONS = Globals.FILTER_IGNORE_EXTENSIONS; |
public static final List<String> FILTER_IGNORE_PREFIXS = Globals.FILTER_IGNORE_PREFIXS; |
private static Logger logger = Logger.getLogger(UserSessionFilter.class); |
45,7 → 50,34 |
{ |
HttpServletRequest hrequest = (HttpServletRequest) request; |
String relativePath = hrequest.getServletPath(); |
if (relativePath == null) |
relativePath = ""; |
if (hrequest.getPathInfo() != null && hrequest.getPathInfo().length() > 0) |
{ |
relativePath += hrequest.getPathInfo(); |
} |
for (String ignore : FILTER_IGNORE_EXTENSIONS) |
{ |
if (relativePath.endsWith(ignore)) |
{ |
chain.doFilter(request, response); |
return; |
} |
} |
for (String ignore : FILTER_IGNORE_PREFIXS) |
{ |
if (relativePath.startsWith(ignore)) |
{ |
chain.doFilter(request, response); |
return; |
} |
} |
String path =((HttpServletRequest)request).getServletPath(); |
if(((HttpServletRequest)request).getServletPath().indexOf("errorNoCookies.do")>=0 || !hrequest.isRequestedSessionIdFromCookie()) |
chain.doFilter(request,response); |
try |
/impl/src/web/layout/header.jsp |
---|
1,8 → 1,3 |
<%@ page import="java.util.Locale" %> |
<%@ page import="org.apache.struts.Globals" %> |
<%@ page import="pt.estgp.estgweb.web.UserSessionProxy" %> |
<%@ page import="pt.estgp.estgweb.domain.UserSession" %> |
<%@ page import="pt.estgp.estgweb.domain.UserSessionImpl" %> |
<%@ page contentType="text/html; charset=UTF-8" language="java"%> |
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
12,7 → 7,7 |
<table width="100%"> |
<tr> |
<td> |
<img src="<%=request.getContextPath()%>/imgs/top.jpg"/> |
<img alt="estg" src="<%=request.getContextPath()%>/imgs/top.jpg"/> |
</td> |
</tr> |
</table> |
/impl/src/web/layout/footer.jsp |
---|
16,7 → 16,7 |
<td align="center" width="33%"> |
<div id="license"> |
<ul class="copyRightLink"> |
<li>Copyright © <a href="http://www.estgp.com">ESTG</a> 2008</li> |
<li>Copyright © <a href="http://www.estgp.pt">ESTG</a> 2008</li> |
<!--<li>Contact ESTG Webmaster at (webmaster [AT] estgp [DOT] pt)</li>--> |
</ul> |
</div> |
/impl/src/web/user/ftpclient/ftpclient.jsp |
---|
7,21 → 7,32 |
<%@ page contentType="text/html;charset=UTF-8" language="java" %> |
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
<% |
List<IFile> iFiles = (List<IFile>) request.getAttribute("files"); |
List<NavPlace> navPlaces = (List<NavPlace>) request.getAttribute("NavPlaces"); |
if(navPlaces == null || iFiles == null) |
{ |
%> |
<div class="statusERROR">Problemas de comunicação com o Servidor FTP</div> |
<% |
} |
else |
{ |
%> |
<div id="topnav"> |
<ul> |
<% |
NavPlace upDir = null; |
List<IFile> iFiles = (List<IFile>) request.getAttribute("files"); |
List<NavPlace> navPlaces = (List<NavPlace>) request.getAttribute("NavPlaces"); |
NavPlace rootPlace = new NavPlace("../","nav.place.root"); |
String root = "../"; |
if (navPlaces.size() > 1) //if there is only one will be null because is the actual place |
if (navPlaces != null && navPlaces.size() > 1) //if there is only one will be null because is the actual place |
{ |
root += navPlaces.get(0).getUrl(); |
} |
if(navPlaces.size() > 0) |
if(navPlaces != null && navPlaces.size() > 0) |
{ |
upDir = rootPlace; |
%> |
32,6 → 43,11 |
</li> |
<% |
} |
else if(navPlaces == null) |
{ |
%> |
<% |
} |
else |
{ |
%> |
202,4 → 218,5 |
<% |
} |
} |
%> |