sitemesh

Using maven for a dynamic web project

五迷三道 提交于 2019-12-20 06:36:37
问题 I'm newbie to maven and i'm used to create dynamic web project in eclipse with traditionnal jars. I downloaded maven and installed it on my Windows8 system as indicated on the documentation and as listed on Kepler doc too you don't have to install any maven plugin on eclipse because it's already installed. so when i test it by adding some dependecies like Hibernate it's ok it works until i added the Struts2 & Sitemesh framework when i was forced to add the jars to the lib folder to make it

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

ぃ、小莉子 提交于 2019-12-19 02:05:41
问题 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? 回答1: I had the same issue and solved my problem

sitemesh and spring MVC decorator pattern problems

北慕城南 提交于 2019-12-18 17:55:33
问题 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

Is it possible to decorate more than once in Sitemesh?

醉酒当歌 提交于 2019-12-18 15:35:31
问题 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 回答1: To answer my own question. Yes it is possible: Using my own example, this is decorator b being decorated by decorator a

Struts 2 + Sitemesh 3 integration - NPE in FreemarkerDecoratorServlet

一个人想着一个人 提交于 2019-12-12 11:10:53
问题 I am using Struts 2 (version 2.3.14.3) together with Sitemesh 3 (version 3.0-alpha-2) and I am getting a NullPointerException under cerain circumstances. First, here is my struts2 / sitemesh configuration from web.xml: <filter-mapping> <filter-name>struts-prepare</filter-name> <url-pattern>*.do</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> <filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>*.do</url-pattern> <dispatcher

Dynamic content in all page in Spring MVC

守給你的承諾、 提交于 2019-12-12 00:48:45
问题 I am developing my site in Spring MVC with Sitemesh. Dynamic content is changed oon every page, Menu and Footer I can include in template definition. But there comes a problem. On every site below the dynamic content there should be a news list with loaded some news from my DB. I created my @Controller and it loads 5 latest news, but how to add this on my template? What request mapping should implement my news controller? 回答1: I don't kwow how Sitemesh works, but I solved problems like that

Sitemesh does not decorate returned views

落花浮王杯 提交于 2019-12-11 04:06:08
问题 I have tried to set up a simple sitemesh decorated page, but am running into a wall now. First, my setup: #decorators.xml <?xml version="1.0" encoding="UTF-8"?> <decorators> <decorator name="basicLayout" page="/WEB-INF/views/layout.jsp"> <pattern>*</pattern> </decorator> </decorators> Nothing special here #web.xml <filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class> </filter> <filter-mapping> <filter-name>sitemesh</filter

What alternatives exist to Sitemesh to help layout JSP/JSTL page footers/headers in a Spring MVC app?

☆樱花仙子☆ 提交于 2019-12-10 15:06:40
问题 I've tried excluding certain pages from my Sitemesh decorator but it doesn't seem to follow its own logic: <decorators> <excludes> <pattern>/register</pattern> </excludes> </decorators> What alternatives exist to Sitemesh that could serve as a drop-in replacement in a Spring MVC app that uses mainly plain JSP/JSTL? 回答1: Have you tried tiles (http://tiles.apache.org/)? I have used it with spring mvc (but freemarker and not jsp).. 来源: https://stackoverflow.com/questions/5849706/what

Why does calling the security authentication property `principal.displayName` in a decorator throw an exception?

梦想与她 提交于 2019-12-10 11:22:39
问题 Is there a reason why calling the security authentication property principal.displayName in a decorator would cause a problem? I'm setting it as a variable in a sitemesh decorator: <c:set var="displayName"> <sec:authentication property="principal.displayName" /> </c:set> But it generates this exception: java.lang.RuntimeException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Invalid property 'principal.displayName' o f bean class [org.springframework.security.authentication

siteMesh + Spring 3.0 + Exclude pattern

一个人想着一个人 提交于 2019-12-08 04:32:36
问题 I would like to have all the requests decorated except my welcome page. This is the default page I display when only my application context is in the url with no other path elements. http://hostname:8080/MyApp/ -> This should not be decorated. This should show my Welcome page. How do I exclude this? http://hostname:8080/MyApp/user -> This gets decorated now with below config I have the following decorators.xml. <!-- Any urls that are excluded will never be decorated by Sitemesh --> <excludes>