Can anyone tell me how to use Sitemesh. I have created a layout page and header and footer. Header and Footer are included from separate pages as static <%@include >. Now I want the middle part "content" to vary keeping header and footer same. How should be the struts.xml and what will be the contents of Layout to include child pages. How will the actions and other links in the pages be so as to have the entire site with same interface.
using sitemesh with struts2
1.1k Views Asked by Akhil K Nambiar At
1
There are 1 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in APACHE
- .htaccess redirect 403 error files to 404 error document
- RestApi server code is not workinng
- Convert Apache VirtualHost to nginx Server Block for Dynamic Subdomains
- Looking the Method that MANUALLY INSTALL PHP on OSX Yosemite
- Premature end of script on VPS
- Rasterization with Javascript looks different on Apache server
- Vagrant - Ansible error installing Apache
- Can't use subdomain in Chrome using Apache (XAMPP)
- Django webapp (on an Apache2 server) hangs indefintely when importing nltk in views.py
- Redirect keystone app to sub directory using htaccess
- How can I integrate Solr5.1.0 with Nutch1.10
- Disconnect Client connected to cgi application
- Solr ping taking time during full import
- How to redirect an incoming request to specific serverName to different server in apache2?
- What is the correct way to link Django Flatpages?
Related Questions in STRUTS2
- Struts2 jqGrid DatePicker in Column Filter
- Struts exclude pattern with spring
- Hiding param of struts.xml values in Struts 2
- Struts2 - passing data from jsp form fields with same name to action class
- Using a dash in Struts 2 action name
- window.open vs form.submit
- Struts 2: How to add dynamically inputs in jsp from the action?
- How to perform XML Validation when using ModelDriven?
- Restriction on number of opened tabs
- Struts2 properties in JS
- Node.js with struts Possible?
- Scope attribute migration from Struts1 to Struts2
- Onchange in Struts2 textfield
- Iterate over hashmap of string and list in Struts2 itreator
- struts dialog box not taking jsp scriplet
Related Questions in SITEMESH
- Spring Servlet and Spring security filter chain Url Patterns
- Cannot execute body onload function in <body> from Sitemesh
- Problem excluding pages with siteMesh Struts2 Tomcat 6
- Render a page in grails without html and body tag
- Does the Grails undocumented method ifPageProperty actually work?
- Spring Framework Error Controller with Freemarker
- Grails Layouts - Kind of a Nested Layout Problem, Conditional Content
- Spring security 3.1 sitemesh not decorating page
- grails eclipse - Unknown tag(r:require)
- Sitemesh: decorator.xml using .properties file
- sitemesh 3 safe to use in production?
- Getting started with Grails Resources Plugin
- How to use sitemesh effectively in webapplication
- Sitemesh spring:message not recognized in template
- How to deal with zTree under Spring MVC and sitemesh?
Related Questions in OPENSYMPHONY
- OS Workflow Replacement
- Integrating OSworkflow with Spring and Hibernate
- XML Catalog is not seeing by project
- How to manipulate Prestashop 1.7.x currency exchange rate using a fixed variable?
- configuration of a cronTrigger (with opensymphony quartz)
- Is OSCache under development or it has been discontinued?
- Display data containing accented character from string using utf-8 encoding in Java
- Tracking down the caller of a method [called through an invocation]
- Simulating running an HTTP request on a Struts action
- Struts ActionProxy: how to set a method?
- Setting StrutsSpringObjectFactory as my current ObjectFactory
- Struts2 JSON Parameter Mystery
- Get the current user inside jira workflow validator
- Symphony CMS File Upload Fatal Error
- How to find memory leak with com.opensymphony.oscache on legacy java application
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Here's a minimal example. http://www.benmccann.com/blog/sitemesh-tutorial-with-examples/
In the philosophy of sitemesh, following the 'decorator' pattern, your 'raw' (undecorated) view should be unaware that it's going to be 'decorated' (here, to be 'decorated' can mean 'to be added some common styles in the head, and some common menu div in the body...'). This extreme decoupling is the beauty of Sitemesh.
More specifically, your Struts2 views code (in your case, the JSP that outputs the result of each action) should be just a full html page (
<html><head>...</head><body>...</body></html>, but without those 'common' elements.Sitemesh will catch the raw HTML pages and add the common fragments. This is specified by a 'decorator' (you can have more than one), in your case it would probably be a jsp page (as in the example) and it might itself have some jsp
<%@include >inside.