¡@

Home 

java Programming Glossary: fn

How to avoid using scriptlets in my JSP page?

http://stackoverflow.com/questions/2188706/how-to-avoid-using-scriptlets-in-my-jsp-page

c @ taglib uri http java.sun.com jsp jstl functions prefix fn html head title My Events decorator title title link href pageContext.request.contextPath.. rel stylesheet type text css head body div class tabs a fn contains pageContext.request.requestURI ' events ' 'class selected.. events Listing.action Events a a fn contains pageContext.request.requestURI ' people ' 'class selected..

XSS prevention in Java

http://stackoverflow.com/questions/2658922/xss-prevention-in-java

XSS can be prevented in JSP by using JSTL c out tag or fn escapeXml EL function when re displaying user controlled input.. value bean.userControlledValue p p input name foo value fn escapeXml param.foo p This will escape characters which may..

How to avoid Java Code in JSP-Files?

http://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files

create functions yourself . Here's an example how JSTL fn escapeXml is useful to prevent XSS attacks . @ taglib uri http.. . @ taglib uri http java.sun.com jsp jstl functions prefix fn ... input type text name foo value fn escapeXml param.foo Note.. functions prefix fn ... input type text name foo value fn escapeXml param.foo Note that the XSS sensitivity is in no way..

Browser can't access/find relative resources like CSS, images and links when calling a Servlet which forwards to a JSP

http://stackoverflow.com/questions/3655316/browser-cant-access-find-relative-resources-like-css-images-and-links-when-cal

c uri http java.sun.com jsp jstl core @taglib prefix fn uri http java.sun.com jsp jstl functions c set var req value.. c set var url req.requestURL c set ... head base href fn substring url 0 fn length url fn length uri req.contextPath.. req.requestURL c set ... head base href fn substring url 0 fn length url fn length uri req.contextPath link rel stylesheet..

How to use relative paths without including the context root name?

http://stackoverflow.com/questions/4764405/how-to-use-relative-paths-without-including-the-context-root-name

c uri http java.sun.com jsp jstl core @ taglib prefix fn uri http java.sun.com jsp jstl functions ... head c set var.. set var url pageContext.request.requestURL c set base href fn substring url 0 fn length url fn length pageContext.request.requestURI.. c set base href fn substring url 0 fn length url fn length pageContext.request.requestURI pageContext.request.contextPath..

How get the base URL?

http://stackoverflow.com/questions/6878275/how-get-the-base-url

note this requires EL 2.2 otherwise you'd better use JSTL fn substring see also this answer This should end up in the generated..