Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-2396

ActionLink not render url properly when page has been put into sub package

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 5.0.12
    • None
    • Core Components
    • None
    • tomcat 5, Tapestry 5.0.11

    Description

      In my application I want to split my pages into sub folder.It seems action link have problem with this approach.
      For example, I put my page into test package and have an action link to change the locale. After first time I click the link(http://127.0.0.1:8080/Neo/test/Index.changelocale),the page refreshed and show the proper locale, but the link has been changed to http://127.0.0.1:8080/Neo/test/test/Index.changelocale. Click again, the link changed back to http://127.0.0.1:8080/Neo/test/Index.changelocale, who ever met this prolem?Pls help.

      Sample java code:
      package com.elite.neo.pages.test;

      import java.sql.Connection;
      import java.sql.SQLException;
      import java.util.Date;
      import java.util.Locale;

      import javax.sql.DataSource;

      import org.apache.tapestry.annotations.Persist;
      import org.apache.tapestry.annotations.Service;
      import org.apache.tapestry.ioc.annotations.Inject;
      import org.apache.tapestry.services.PersistentLocale;
      public class Index {
      @Inject
      private PersistentLocale persistentLocale;
      @Inject
      private Locale currentLocale;
      public Date getCurrentTime()

      { return new Date(); }

      public void onActionFromChangeLocale(){
      if(currentLocale.equals(Locale.CHINESE))

      { persistentLocale.set(Locale.ENGLISH); }

      else

      { persistentLocale.set(Locale.CHINESE); }

      }
      }
      Sample tml:
      <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
      <head>
      <title>test</title>
      </head>
      <body>
      <h1>Tapestry Start Page</h1>
      <p> This is the start page for this application, a good place
      to start your modifications.
      Just to prove this is live: </p>
      中文
      <p> The current date and time is: <span t:type="textoutput" t:value="${currentTime}">now</span>. <span t:type="TextOutput" t:value="message:greeting">中文</span>.</p>
      <p> [<t:pagelink t:page="test/Index">refresh</t:pagelink>] </p>

      <p><span t:type="actionlink" t:id="changeLocale">change locale</span> </p>
      </body>
      </html>

      Attachments

        1. Neo.rar
          6 kB
          maxyu

        Activity

          People

            hlship Howard Lewis Ship
            maxyu maxyu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: