sitemesh

Servlet page decoration: Do people use Tiles, Sitemesh, or something else?

。_饼干妹妹 提交于 2019-11-30 22:40:20
I've used Tiles and Sitemesh for a number of years and while I personally prefer the Sitemesh style page decoration, I generally don't see a lot of mention of Sitemesh or Tiles on the Internet. Do people use Tiles and/or Sitemesh actively, or are there other libraries that have taken over in this capacity? I use sitemesh since it is less invasive than tiles. However I think that tiles is generally used in conjuction with structs 1.x? We use Sitemesh, but I'm not a fan. We use the apply-decorator feature almost exclusively, in order to wrap one of our standard page layouts around the unique

Accessing the model from a layout view in Grails

£可爱£侵袭症+ 提交于 2019-11-30 21:11:16
I'm using the layout support (sitemesh) in Grails which works fine. I'd like to adjust my layout to have it depend on whether or not a user is logged in or not. My grails-app/views/layouts/main.gsp contains the following code: <g:if test="${user}"> Username: ${user.username} </g:if> However, it appears as if the layout-GSP:s are unable to access the model and hence the user variable (I get a "No session" exception when trying). What would be the recommended way to make my layout depend on whether or not a user is logged in or not? Thanks in advance! I would suggest to use either the request or

How to obtain model attribute or spring's bean in sitemesh decorator?

陌路散爱 提交于 2019-11-30 20:03:06
I am using Spring 3 with sitemesh. I would like to refer to spring context bean in decorator page defined in sitemesh. The problem is that SiteMesh filter is working outside the Spring context, so request object on sitemesh decorator jsp page is native HttpServletRequest and not wrapper with useful functions to access context and etc. Is there a way to somehow configure both spring and sitemesh to have access to Spring context in decorator page? I had the same issue and solved my problem by using a filter. I created an environment filter that I could use for setting environment data for all

Case Sensitive URL

拜拜、爱过 提交于 2019-11-30 18:11:18
问题 I've launched a small website. I have found that I'm getting errors by users and upon investigation see that the urls they are trying to use are all lowercase whereas I've declared them as camelCase. I've no idea why these users should be trying to use all lower case (I can't imagine anyone would actually take the time to change: www.mysite.com/myAction.do to www.mysite.com/myaction.do However I can't think of anyway this would otherwise be changed. Has anyone else experienced this where:

Servlet page decoration: Do people use Tiles, Sitemesh, or something else?

旧街凉风 提交于 2019-11-30 17:59:37
问题 I've used Tiles and Sitemesh for a number of years and while I personally prefer the Sitemesh style page decoration, I generally don't see a lot of mention of Sitemesh or Tiles on the Internet. Do people use Tiles and/or Sitemesh actively, or are there other libraries that have taken over in this capacity? 回答1: I use sitemesh since it is less invasive than tiles. However I think that tiles is generally used in conjuction with structs 1.x? 回答2: We use Sitemesh, but I'm not a fan. We use the

sitemesh简单使用

痴心易碎 提交于 2019-11-30 17:25:46
一、简介 SiteMesh 是一个网页布局和修饰的框架,利用它可以将网页的内容和页面结构分离,以达到页面结构共享的目的。 官网:http://wiki.sitemesh.org/wiki/display/sitemesh/Home 二、配置 1、下载jar包 自行百度吧,这里就不多说明。 2、web.xml配置 <!-- sitemesh 过滤器 注意:如果和其他技术一起使用比如springmvc一定要注意顺序--> <filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class> </filter> <filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> 3、 在WEB-INF/新建一个decorators.xml文件,包含以下内容: <?xml version="1.0" encoding="UTF-8"?> <decorators > <decorator name="front" page="/common/front"> //前台页面母版页

sitemesh and spring MVC decorator pattern problems

本秂侑毒 提交于 2019-11-30 16:12:55
I have sitemesh with spring working, this is the configuration: decorator.xml <?xml version="1.0" encoding="UTF-8"?> <decorators defaultdir="/styles"> <excludes> <pattern>/exclude.jsp</pattern> <pattern>/exclude/*</pattern> </excludes> <decorator page="application/themeManager/theme.jsp" name="dos"> <pattern>/*</pattern> </decorator> </decorators> And this is my web.xml <?xml version="1.0" encoding="ISO-8859-1"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns

Is it possible to decorate more than once in Sitemesh?

筅森魡賤 提交于 2019-11-30 13:31:09
I'm trying to do something like this: For all the requests to /admin/* I need the page to be decorated using the B decorator but also that B decorator has to be included in the content of A decorator which is main application layout. How can I do that with Sitemesh? Is it even possible? Or do I have to repeat the same layout from A in the B decorator? Thanks in advance To answer my own question. Yes it is possible: Using my own example, this is decorator b being decorated by decorator a . <page:applyDecorator name="a"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>

Spring security tags in sitemesh decorator

陌路散爱 提交于 2019-11-30 08:37:29
问题 I want to use a few tags of the spring security tag library inside the decorator file of site-mesh. However content inside these tags is never shown. Can anyone tell me why this is? Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <%@taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="sec" uri="http://www.springframework.org

Accessing the model from a layout view in Grails

痞子三分冷 提交于 2019-11-30 05:43:20
问题 I'm using the layout support (sitemesh) in Grails which works fine. I'd like to adjust my layout to have it depend on whether or not a user is logged in or not. My grails-app/views/layouts/main.gsp contains the following code: <g:if test="${user}"> Username: ${user.username} </g:if> However, it appears as if the layout-GSP:s are unable to access the model and hence the user variable (I get a "No session" exception when trying). What would be the recommended way to make my layout depend on