tapestry5.0 ÏÂÔر¾ÎÄ

background-color: expression(( this.sectionRowIndex % 2 == 0) ? \}

.userName,.operation,.birthday,.role{ text-align: center; vertical-align: middle; }

16:55

? ä¯ÀÀ (629) ? ÆÀÂÛ (0)

? ·ÖÀà: Tapestry/Wicket/JSF2

?

2009-02-11 ËõÂÔÏÔʾ

Tapestry5×Ô¶¨Òå×é¼þ

¹Ø¼ü×Ö: tapestry5 Ò»¡¢ÆÕͨ×é¼þ 1.javaÎļþ

package com.logcd.tapestry5.myapp.components;

import java.util.ArrayList; import java.util.List;

import org.apache.tapestry5.ComponentResources; import org.apache.tapestry5.annotations.Parameter; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.ioc.annotations.Inject;

public class NavBar { @Parameter(defaultPrefix = \ private String pages; @Inject private ComponentResources resources; @Property private Page _pageAttr; public List getPageNames() {

List pageList = new ArrayList(); String[] pageArr = pages.split(\ for(int i=0;i

(_pageAttr.name.equalsIgnoreCase(resources.getPageName())) return \ return null; } public class Page{ private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } private String url; } }

2.NavBar.tml

xmlns:t=\

page=\

3.Ò³ÃæʹÓÃ

¶þ¡¢²¼¾ÖÄ£°å×é¼þ 1.javaÎļþ

package com.logcd.tapestry5.myapp.components;

import org.apache.tapestry5.annotations.IncludeStylesheet; //Óà \ǰ׺£¬Èç¹û´æ´¢ÔÚÓ¦ÓóÌÐò(webapp)µÄĿ¼

//ÓÃ\ǰ׺£¬Èç¹û´æ´¢ÔÚÓ¦ÓóÌÐòµÄclasspath·¾¶Ï @IncludeStylesheet(\public class Layout { }

2.tmlÎļþ

Tapestry 5 Demo Application

Tapestry 5 Demo

style=\Ê×Ò³]