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

                 Key: TAPESTRY-2396
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2396
             Project: Tapestry
          Issue Type: Bug
          Components: Core Components
    Affects Versions: 5.1
         Environment: tomcat 5, Tapestry 5.1.1
            Reporter: maxyu


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>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to