Announcement Announcement Module
No announcement yet.
How to add other jsp pages Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to add other jsp pages

    How can I add other jsp pages to the generated project?

  • #2
    Hi, don“t take me too seriously since im not a Roo expert

    I think you could do it the same way you add pages to any tiles project, simply put the pages having in consideration the spring view resolution of spring mvc wich runs under the covers.

    The view resolver is:

    <bean class="org.springframework.js.ajax.AjaxUrlBasedVie wResolver" id="tilesViewResolver">
    <property name="viewClass" value="org.springframework.web.servlet.view.tiles2 .TilesView"/>

    That means that when the controller return a modelandview the view to show is the tiles definition wich name match the name of the modelandview view.

    For example from the vote example roo generates this view.xml

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN" "">
    <definition extends="default" name="choice/list">
    <put-attribute name="body" value="/WEB-INF/views/choice/list.jspx"/>
    <definition extends="default" name="choice/show">
    <put-attribute name="body" value="/WEB-INF/views/choice/show.jspx"/>
    <definition extends="default" name="choice/create">
    <put-attribute name="body" value="/WEB-INF/views/choice/create.jspx"/>
    <definition extends="default" name="choice/update">
    <put-attribute name="body" value="/WEB-INF/views/choice/update.jspx"/>

    So if the controller returns choice/list the first tile definition will be displayed, so to show your pages simply create new tiles definitions with the content you want and return from your controllers the apropiate name.

    Of course you can edit the existing definitions to add your jsp instead of the generated ones.

    All tiles stuff is not in RC1, but in the current trunk of Roo, so i guess it will be available in RC2

    Regards, Raśl


    • #3
      Yes that is correct, the next release of Roo will contain a host of new features on the front-end with Tiles integration being one of them. But even with the current version of Roo you can create your own jsps by just dripping them into the correct folders. The best start is to generate a Web project and take a look at the conventions being used in the generated jsps.

      Again, please note that the folder structure and the technologies being used will change with the next release of Spring Roo so it may pay to wait a little for that release or build from trunk.



      • #4
        Stefan, when is the next release expected?


        • #5

          Roo is dependent on Spring Framework where we need to fix a few bugs first before we can make the next release. So at this stage it is a little hard to tell when exactly we can cut a new release. It should, however, not be more than a few weeks.