MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ssquire
Post subject: Change default page for Spring CRUD Scaffolding  PostPosted: Oct 10, 2011 - 07:30 PM
Registered Member
Registered Member


Joined: Aug 09, 2010
Posts: 89

How do I change the default page that displays after adding Spring CRUD Scaffolding?
 
 View user's profile Send private message  
Reply with quote Back to top
cconway
Post subject:   PostPosted: Oct 17, 2011 - 08:46 PM



Joined: Apr 04, 2011
Posts: 196

Sorry for the delayed response. The scaffolded app uses sitemesh to "construct" pages. Sitemesh is configured in the decorators.xml file. In there you'll find this section that configures the default page:

<decorator name="main" page="main.jsp">
<pattern>/*</pattern>
</decorator>

If you want to use a completely different page, just change that configuration in decorators.xml. If you want to continue to use the decorated pages but just want different content, then edit the main.jsp page. More specifically, if you look in the body of main.jsp you'll see where the page includes the other sitemesh components like header.jsp and footer.jsp. The "dashboard.jsp" that's being included is the section that contains the list of scaffolded objects.

_________________
Cindy
MyEclipse for Spring Support
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
rss245b
Post subject: Change default page for Spring CRUD Scaffolding  PostPosted: May 27, 2012 - 08:16 PM
Registered Member
Registered Member


Joined: May 03, 2010
Posts: 45

Okay so decorators.xml is the file that sets up sitemesh, but does the
<filter> definition tell the app to start with sitemesh? What says load sitemesh first and bring up its pages? Where is that defined in the web.xml file???
 
 View user's profile Send private message  
Reply with quote Back to top
cconway
Post subject:   PostPosted: Jun 01, 2012 - 11:37 AM



Joined: Apr 04, 2011
Posts: 196

There is a filter and a filter-mapping in web.xml that together cause every page to have sitemesh applied:

Code:
    <filter>
          <description>generated-sitemesh-filter</description>
          <filter-name>Sitemesh Filter</filter-name>
          <filter-class>
               com.opensymphony.module.sitemesh.filter.PageFilter
          </filter-class>
     </filter>

     <filter-mapping>
          <filter-name>Sitemesh Filter</filter-name>
          <url-pattern>/*</url-pattern>
     </filter-mapping>

_________________
Cindy
MyEclipse for Spring Support
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
rss245b
Post subject: Change default page for Spring CRUD Scaffolding  PostPosted: Jun 01, 2012 - 02:55 PM
Registered Member
Registered Member


Joined: May 03, 2010
Posts: 45

So can you explain how exactly this filter is applied in the case of /pages/menu.jsp page
The browser shows http://host.domain.com:8080/TheOffice/
for the first page
It sounds like the servlet first loads the filter along with it and all pages processed through the controller e.g
a ModelAndView object when rendered first go through the filter specified in the web.xml,
So within the Dispatcher servlet is configurable post processing of SiteMesh's
com.opensymphony.module.sitemesh.filter.PageFilter after rendering the xhtml /html from the JSP page.
Is there also a way to change the Scaffolding code generation to use
SiteMeshFilter object instead of PageFilter. According the the page:
http://www.opensymphony.com/sitemesh/api/com/opensymphony/module/sitemesh/filter/PageFilter.html
the PageFilter object has been deprecated. You may want to provide an option for this in future ME4S releases.

Also a tutorial on how SiteMesh works would be a really good idea.
Thus far I have not found a lot about how SiteMeshFilter object works.

I would really appreciate a brief run through of the steps needed to render the menu.jsp page as a good starting point though!
 
 View user's profile Send private message  
Reply with quote Back to top
cconway
Post subject:   PostPosted: Jun 03, 2012 - 02:15 PM



Joined: Apr 04, 2011
Posts: 196

Sitemesh is a technology that is documented outside of MyEclipse for Spring. While we do try to answer as many questions as possible, it is really outside of the scope of the MyEclipse for Spring support to field detailed questions about the workings of the app server and the individual technologies such as sitemesh, hibernate, JSP, etc.

Please refer to the documentation for the individual technologies to understand their inner workings.

_________________
Cindy
MyEclipse for Spring Support
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits