sitemesh / sitemesh2 Goto Github PK
View Code? Open in Web Editor NEWSiteMesh 2: Official repository
Home Page: http://sitemesh.github.io/sitemesh2/
License: Other
SiteMesh 2: Official repository
Home Page: http://sitemesh.github.io/sitemesh2/
License: Other
The site mesh decorator is applied for for generic URL pattern like,
<decorator name="wfc_template" page="wfc.jsp">
<pattern>/wf*</pattern>
</decorator>
But the decorator is not applied for specific URL like,
<decorator name="newUI_template" page="newwfc.jsp">
<pattern>/wf/xxx-flow*</pattern>
</decorator>
it seems patterns are not understood by the sitemesh when they contains special characters. In this case it is "-" hyphen between the "xxx" and "flow"
Hi guys,
Why hasn't Sitemesh 2.5 been published on Maven Central? I can't find it!
As titled, com.opensymphony.module.sitemesh.filter.PageResponseWrapper should be reset-able. Now it does not implementing the .resetBuffer() and .reset(), causing the header/ content cannot be reset.
Hello, I'm using sitemesh for decoration of web page but error page is not decorated by stiemesh. I'm using sitemesh 2.4.2.jar.
Please help.
Thanks.
Hi, I see this is coming back to life. I had hard-forked this over at https://github.com/hazendaz/sitemesh2. I used Maven for it and applied nearly everything that was at issue and subsequently released jakarta. I didn't do the same with sitemesh3 as I couldn't ever get it working for my needs. I auto licensed, auto formatted, and did a heavy cleanup clearing any coding issues in general. Its clearly not in a state to merge back but wanted to note this in case that is a consideration. I see this went gradle but its still early...
At the moment, I have it released both as javaEE and jakartaEE
JavaEE -> https://search.maven.org/artifact/com.github.hazendaz/sitemesh/2.5.1/jar
JakartaEE -> https://search.maven.org/artifact/com.github.hazendaz/sitemesh/2.6.0-M1/jar
The javaEE fork is used live in production already. The jarkartaEE while available and others might be using it, I have not released psi-probe on that yet as I ran into some considerations separately with more tomcat work to be done. Hence its marking as M1. It does however work.
see #19
Fixed closing.
The Github project is missing the tags for the previous releases. Could you please add them?
Thank you.
The old wiki isn't in a very good state - not many people know it exists.
Go through all the content at http://wiki.opensymphony.com/pages/listpages-dirview.action?key=SM.
Noticed Sitemesh 2/3 has become active again.
What is the suggested path for new users of sitemesh: 2 or 3?
What caused the project to become active again?
Just Curious.
I have a spring boot application with a sitemesh filter being added. When I start the application however, It says that the decorators.xml file could not be found.
Here is the error:
com.opensymphony.module.sitemesh.factory.FactoryException: Cannot construct Factory : com.opensymphony.module.sitemesh.factory.DefaultFactory: java.lang.IllegalStateException: Cannot load excludes configuration file "/WEB-INF/decorators.xml" as specified in "sitemesh.xml" or "sitemesh-default.xml"
at com.opensymphony.module.sitemesh.Factory.getInstance(Factory.java:51)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.initContentProcessor(SiteMeshFilter.java:108)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:54)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1736)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1695)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:722)
I further noticed that if I change the path to the decorators in my sitemesh.xml, the error would remain unchanged, hence showing that the sitemesh.xml isn't being found as well.
I tried adding
filter.addInitParameter("contextConfigLocation", "classpath:/WEB-INF/sitemesh.xml");
however nothing changed
sitemesh.xml and decorators.xml are both located in my WEB-INF directory, which is in the root of my executable jar file
Here is my bean declaration:
@Bean
public FilterRegistrationBean sitemeshFilter(){
FilterRegistrationBean filter = new FilterRegistrationBean();
filter.setName("sitemesh");
filter.setFilter(new SiteMeshFilter());
filter.addUrlPatterns("*.html");
filter.addInitParameter("decorators-file", "/WEB-INF/deco222rators.xml");
filter.addInitParameter("contextConfigLocation", "classpath:/WEB-INF/sitemesh.xml");
return filter;
}
Here is the maven build plugin used to create the executable jar
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>my.configuration.javaClass</mainClass>
</configuration>
<version>1.1.9.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
Note: the error comes up when I try to access a web page, not during startup.
Sitemesh version: opensymphony:sitemesh:jar:2.5
Question on stack overflow available here
Edit
I debugged into the code and, while running from the jar located here :
C:\my\project\target\__fake.jar
while giving
servletContext.setInitParameter("sitemesh.configfile", "classpath:/WEB-INF/sitemesh.xml");
In DefaultFactory(line 72) it is resolving configFilePath to
C:\my\project\src\main\webapp\classpath:\WEB-INF\sitemesh.xml
I find this contains the following problems:
This is done using ApplicationContextFacade
's getRealPath
method
Due to this
Factory (line49) sets instance to null which causes the exception to be thrown in the line after.
Sitemesh uses the deprecated ".toURL" method to get streams to read files, which warns that special and illegal URL characters are not escaped. I'd like to use the special character '#' in the war name, so that tomcat deploys it to a subfolder, but after converting the path to the sitemesh.xml file to an URL, it's interpreted as an anchor, and it can't load the config files.
The solution is just to replace the call to .toUrl in the file objects to the suggested in the deprecated comment: "toURI().toURL()".
If im running on jdk 1.6 class TextEncoder.encode(...) always call method get13Buffer()
....
if (JDK14) {
return get14Buffer(data, encoding);
}
return get13Buffer(data, encoding);
....
Read through all issues in http://jira.opensymphony.com/browse/SIM
Seeing as SM2 is being put into essential-bugfixes-only maintenance mode, many of these can be purged.
Hi @codeconsole, do you have any plans to support Jakarta EE 9๏ผ
I can help, and release a Jakarta version for SiteMesh 2.
Grace framework 2023 will support SiteMesh 2.x and 3.x.
Jdk upgrade to 1.8, but NullPointerException occurs when jump to jsp page.
Can you tell me sitemesh-2.4.2 can be compatible on java 1.8?
Hello, I'm using the asynchronous servlet using spring but the view is not decorated by sitemesh 2.4.2.jar.
Thanks.
Hello,
I had integrated sitemesh 2.4.2 in my web app.
I am decorating pages using meta tag (PageDecoratorMapper) on JSPs. In one of page I came across strange problem. In HTML I have button tag as follow:
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">ร</button>
Due to this line my page keeps loading. Taking more than 1.5 minute to complete processing. Now if I change this line to:
<input type="button" class="close" data-dismiss="modal" aria-hidden="true" value="x"></input>
same page loads in fraction of second. Strange thing is that I am not decorating this page with meta tag. It should not be considered by sitemesh filter. Following is my theme.jsp for reference:
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<decorator:usePage id="origPage" />
<!--<![endif]-->
<head>
<%@ include file="ccmrHeadInclude.jsp" %>
<decorator:head />
</head>
<body>
<% String showHeaders = origPage.getProperty("meta.showHeaders")==null?"true":origPage.getProperty("meta.showHeaders");
System.out.println("Inside decorator");
if(showHeaders.equalsIgnoreCase("true")){ %>
<%@ include file="ccmrTopNavigation.jsp" %>
<jsp:include page="ccmrSubNavigation.jsp"></jsp:include>
<%}%>
<decorator:body />
<%@ include file="ccmrFooter.jsp" %>
</body>
<%@ include file="ccmrJSInclude.jsp" %>
<decorator:getProperty property="page.pageScript" />
</html>
Currently it's running on the creaky old hard to access opensymphony.com server. Merge it with the www.sitemesh.org website that runs on AppEngine.
Old: http://www.opensymphony.com/sitemesh
New: http://www.sitemesh.org/sitemesh2
Source for www.sitemesh.org: http://github.com/sitemesh/sitemesh
We are getting large stack traces in our logs whenever a client connection is closed while the server is processing. This can easily be reproduced by simply hitting reload in the browser several times.
The stack trace starts with this:
org.eclipse.jetty.io.RuntimeIOException: org.eclipse.jetty.io.EofException
at org.eclipse.jetty.server.ResponseWriter.isOpen(ResponseWriter.java:133)
at org.eclipse.jetty.server.ResponseWriter.write(ResponseWriter.java:202)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:112)
at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:329)
at java.base/java.io.Writer.write(Writer.java:249)
at com.opensymphony.module.sitemesh.parser.FastPage.writeBody(FastPage.java:48)
at com.opensymphony.sitemesh.compatability.HTMLPage2Content.writeBody(HTMLPage2Content.java:31)
at com.opensymphony.sitemesh.compatability.Content2HTMLPage.writeBody(Content2HTMLPage.java:44)
at com.opensymphony.module.sitemesh.taglib.decorator.BodyTag.doEndTag(BodyTag.java:26)
...
We tracked this down to the com.opensymphony.module.sitemesh.taglib.AbstractTag class's trace method.
The com.opensymphony.module.sitemesh.taglib.decorator.BodyTag is catching the exception and then calling trace which prints the stack trace in a way which can not be disabled.
In this particular case, connections being closed is completely normal and we would really like a way to disable these messages.
We would of course want to see actual problems.
There are valid use-cases that may result in the sitemesh filter running twice (or more) in the context of a single request. One simple example of this involves using JSP pages to render HTML e-mail content. A request that dispatches such an e-mail can retrieve the rendered JSP contents as a string by including it (and wrapping the HttpServletResponse appropriately). Thus it can be desirable to have multiple runs of the sitemesh filter, one for the response that is ultimately sent to the client/browser, and one for each e-mail composed in this manner (because using sitemesh to decorate the e-mails would be extremely convenient).
I think there are a couple of simple ways to support this:
Old: https://sitemesh.dev.java.net/servlets/SummarizeList?listName=users
New: http://groups.google.com/group/sitemesh2-users
Old: https://sitemesh.dev.java.net/servlets/SummarizeList?listName=dev
New: http://groups.google.com/group/sitemesh-team
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.