You can also try this: http://www.onjava.com/pub/a/onjava/excerpt/progjakstruts_14/index4.html
There are definitions examples there. Leandro. --- Shinobu Kawai <[EMAIL PROTECTED]> escreveu: > > Hi Andy, > > > I am (still!) trying to set up Tiles in my Struts > app. > > I am hoping to use Tiles definitions, but can't > find any usable (working) > > simple examples to build from. Even the one at > Cedric Dumoulin's site > > doesn't use this (best practice?) feature. > > I have tried a 'cut n shut' from the stuff bundled > with Struts to no avail. > They don't? Have you checked out the "Tutorial Live > Examples"? It uses > definitions, in a step-by-step way, too. > > > > As far as I can work out, to get Tiles working > (with Struts already > > configured), you need to: > > > > Add the following to web.xml: > > > > <servlet> etc... > > <init-param> > > <param-name>definitions-config</param-name> > > > <param-value>/WEB-INF/tiles-defs.xml</param-value> > > </init-param> > > </servlet> > Actually, you don't need this here; the one in the > plug-in declaration > does fine. > > > Add the following to struts-config.xml: > > > > <action path="/login" forward="fulluser"/> > > > > <plug-in > className="org.apache.struts.tiles.TilesPlugin" > > > <set-property property="definitions-config" > value="/WEB-INF/tiles-defs.xml > > /> > > </plug-in> > > > > > > I have the following in my tiles defs.xml file: > Unless it's a typo, rename it to "tiles-defs.xml". > ;) > > > Then I invoke the action forward in a jsp file > with the following: > > > > <html:link page="/do/login">Login</html:link> > > > > and get this... > > > > java.lang.NullPointerException > > > org.apache.struts.util.RequestUtils.pageURL(RequestUtils.java:1532) > > > org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:487) > > > org.apache.struts.taglib.html.RewriteTag.doStartTag(RewriteTag.java:99) > > > org.apache.strutsel.taglib.html.ELRewriteTag.doStartTag(ELRewriteTag.java:291) > > > org.apache.jsp.index_jsp._jspx_meth_html_rewrite_0(index_jsp.java:110) > > > org.apache.jsp.index_jsp._jspService(index_jsp.java:69) > > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) > > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > > > > All the webapp/tiles/*.jsp files are where they > should be and the Struts > > stuff alone works OK. > Are you saying that it works if you change > <action path="/login" forward="fulluser"/> > to <action path="/login" forward="something.jsp"/> ? > I'm pretty > uncomfortable with the "/do" prefixing the "/login" > in your html:link > tag (not that I've tried it). > > Best regards, > -- Shinobu Kawai > > -- > Shinobu Kawai <[EMAIL PROTECTED], > [EMAIL PROTECTED]> > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > _______________________________________________________ Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! http://br.acesso.yahoo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]