You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by dominik tarnawczyk <dt...@gmail.com> on 2006/08/25 09:42:11 UTC
Tapestry portlet Locale problem
Hello,
I have a question about writing portlets in Tapestry. I'm writting portlets
to GridSphere. I wrote simple HelloWorld portlet. I'm trying to change
Locale of portlet. I use Locale loc = new Locale(); as well as Locale locale
= getEngine().getLocale(); as well as some code from JSFs. And it is working
while I'm logout from portat, change language and login again. But in the
portal (if I'm login into it) there is an option to change language too and
when I'm using it my tapestry portlet doesn't change its locale. It reacts
only when I'm login/out from portal when Tapestry page is reloading. How to
change Locale 'dynamically' ?
Here is my class:
public abstract class View extends BasePage
implements PageBeginRenderListener
{
@InjectObject("service:tapestry.globals.PortletWebRequest")
public abstract PortletWebRequest getRequest();
public PortletRequest preq;
public String loc;
private String greetingSubject;
private Date currentDateTime;
private DateFormat currentDateTimeFormat;
public void pageBeginRender(PageEvent event){
preq = (PortletRequest) getRequest();
//it's ftom JSFs
Map userInfo = (Map)preq.getAttribute(PortletRequest.USER_INFO);
loc =(String) userInfo.get("user.locale");
if (loc == null){
loc =preq.getLocale().toString();
}
}
public String getTimeDate(){
currentDateTime = new Date();
Locale locale = new Locale(loc);
//Locale locale = getEngine().getLocale();
currentDateTimeFormat = DateFormat.getDateTimeInstance(DateFormat.LONG,
DateFormat.SHORT, locale);
String date = currentDateTimeFormat.format(currentDateTime);
return date;
}
public String getGreetingSubject() {
return greetingSubject;
}
public void setGreetingSubject(String greetingSubject) {
this.greetingSubject = greetingSubject;
}
}
Thanks,
Dominik
--
View this message in context: http://www.nabble.com/Tapestry-portlet-Locale-problem-tf2163269.html#a5978891
Sent from the Tapestry - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
tacos maven artifact on ibiblio
Posted by Denis McCarthy <dm...@annadaletech.com>.
Hi,
I could have sworn that tacos had a maven artifact on ibiblio a week or
two ago at http://www.ibiblio.org/maven2/net/sf/tacos. It no longer
seems to be available, thus causing a fresh maven build of my project
some problems. Does anyone know why it might have been removed, or am I
smoking crack and dreaming that it was ever available?
Thanks
Denis
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org