Michael Young 16 Years Ago That's pretty cool. Traditional taglibs can be quite painful for the simpler tasks (such as macros like these). For the more complex tasks, such as dealing with nested content between the tags, the pain is more bearable. Please sign in to reply. Reply as... Cancel
Ray Auge 16 Years Ago Good job Brett!This looks very interesting. Please sign in to reply. Reply as... Cancel
Sebastián Gurin 16 Years Ago great work. I had a similar problem than you: two portlets, one extending some of the other pages, but both sharing several jsps. Now I can mantin common jsps only in one portlet... and I learned tagfiles! thank you Please sign in to reply. Reply as... Cancel Sebastián Gurin Sebastián Gurin 16 Years Ago nevermind my last post. I couldn't solve the problem of sharing jsps between portlets... can you point me on how you make it? thanks in advance and excuse my poor english. great article about filetags, anyway... Please sign in to reply. Reply as... Cancel Brett Swaim Sebastián Gurin 16 Years Ago Hey Sabastian,Using tagfiles will work to share a common jsp between 2 pages. You could also create one and do a simple <%@ include="filenamehere.jsp" %> to include a common file (this is done everywhere in Liferay). Your best bet would be to post a question in the public messageboards about this and shoot me a link so I can answetr it there. I want to try to keep threads in the blogs related to the subject at hand.Thanks!!Brett Please sign in to reply. Reply as... Cancel Sebastián Gurin Brett Swaim 16 Years Ago Brett: thanks for the reply. I have posted my problem here: http://www.liferay.com/web/guest/community/forums/message_boards/message/718805I was able to resolve it configuring struts-path for the second portlet to point to the original portlet tiles def... but any other idea is welcome. thank you for your help anyway. Please sign in to reply. Reply as... Cancel
Sebastián Gurin Sebastián Gurin 16 Years Ago nevermind my last post. I couldn't solve the problem of sharing jsps between portlets... can you point me on how you make it? thanks in advance and excuse my poor english. great article about filetags, anyway... Please sign in to reply. Reply as... Cancel Brett Swaim Sebastián Gurin 16 Years Ago Hey Sabastian,Using tagfiles will work to share a common jsp between 2 pages. You could also create one and do a simple <%@ include="filenamehere.jsp" %> to include a common file (this is done everywhere in Liferay). Your best bet would be to post a question in the public messageboards about this and shoot me a link so I can answetr it there. I want to try to keep threads in the blogs related to the subject at hand.Thanks!!Brett Please sign in to reply. Reply as... Cancel Sebastián Gurin Brett Swaim 16 Years Ago Brett: thanks for the reply. I have posted my problem here: http://www.liferay.com/web/guest/community/forums/message_boards/message/718805I was able to resolve it configuring struts-path for the second portlet to point to the original portlet tiles def... but any other idea is welcome. thank you for your help anyway. Please sign in to reply. Reply as... Cancel
Brett Swaim Sebastián Gurin 16 Years Ago Hey Sabastian,Using tagfiles will work to share a common jsp between 2 pages. You could also create one and do a simple <%@ include="filenamehere.jsp" %> to include a common file (this is done everywhere in Liferay). Your best bet would be to post a question in the public messageboards about this and shoot me a link so I can answetr it there. I want to try to keep threads in the blogs related to the subject at hand.Thanks!!Brett Please sign in to reply. Reply as... Cancel Sebastián Gurin Brett Swaim 16 Years Ago Brett: thanks for the reply. I have posted my problem here: http://www.liferay.com/web/guest/community/forums/message_boards/message/718805I was able to resolve it configuring struts-path for the second portlet to point to the original portlet tiles def... but any other idea is welcome. thank you for your help anyway. Please sign in to reply. Reply as... Cancel
Sebastián Gurin Brett Swaim 16 Years Ago Brett: thanks for the reply. I have posted my problem here: http://www.liferay.com/web/guest/community/forums/message_boards/message/718805I was able to resolve it configuring struts-path for the second portlet to point to the original portlet tiles def... but any other idea is welcome. thank you for your help anyway. Please sign in to reply. Reply as... Cancel
lajos papp 16 Years Ago great job!i have the same passion, to eliminate duplicated code. just a small note: i think you made a small typo in you second code box. you wrote <hello-world:hello /> but probably meant <showMore:hello/> Please sign in to reply. Reply as... Cancel Brett Swaim lajos papp 16 Years Ago Thanks for the heads up, I've adjusted the example.Brett Please sign in to reply. Reply as... Cancel
Brett Swaim lajos papp 16 Years Ago Thanks for the heads up, I've adjusted the example.Brett Please sign in to reply. Reply as... Cancel
Sebastián Gurin 16 Years Ago what about "var" <portlet:actionURL> attribute? can it be simulated by your <showMore:hello> custom tag ? Please sign in to reply. Reply as... Cancel Sebastián Gurin Sebastián Gurin 16 Years Ago I got it. in your init.tag add:<%@attribute name="javaVar" rtexprvalue="false" required="true" %><%@ variable name-from-attribute="javaVar" variable-class="java.lang.Object" alias="var" scope="AT_END"%>in your hello.tag you must pass var attribute to <portlet:actionURL and <portlet:renderURL like: <portlet:actionURL windowState="<%=windowState%>" var="var">then in the caller jsp you can get the url like:<showMore:hello struts_path="/portlet_a/view" maximized="true" actionUrl="true" javaVar="var1"/><p>${var1}</p>another sugestion is to set the portlet path inside the tag file so the user don't hardcode the portlet struts path in its jsp. Inside the tag file you can obtain the portlet struts path with String portletStrutsPath = PortletLocalServiceFactory.getImpl().getPortletById(company.getCompanyId(), portletName).getStrutsPath()So the user can write <showMore:hello struts_path="view" ...instead of<showMore:hello struts_path="/portlet_a/view" ....hope you can understand my bad englishcheers Please sign in to reply. Reply as... Cancel Brett Swaim Sebastián Gurin 16 Years Ago Very nice! Please sign in to reply. Reply as... Cancel Thiago Leão Moreira Brett Swaim 13 Years Ago Really nice article! I didn't know about tagfiles! One more thing learned... Please sign in to reply. Reply as... Cancel
Sebastián Gurin Sebastián Gurin 16 Years Ago I got it. in your init.tag add:<%@attribute name="javaVar" rtexprvalue="false" required="true" %><%@ variable name-from-attribute="javaVar" variable-class="java.lang.Object" alias="var" scope="AT_END"%>in your hello.tag you must pass var attribute to <portlet:actionURL and <portlet:renderURL like: <portlet:actionURL windowState="<%=windowState%>" var="var">then in the caller jsp you can get the url like:<showMore:hello struts_path="/portlet_a/view" maximized="true" actionUrl="true" javaVar="var1"/><p>${var1}</p>another sugestion is to set the portlet path inside the tag file so the user don't hardcode the portlet struts path in its jsp. Inside the tag file you can obtain the portlet struts path with String portletStrutsPath = PortletLocalServiceFactory.getImpl().getPortletById(company.getCompanyId(), portletName).getStrutsPath()So the user can write <showMore:hello struts_path="view" ...instead of<showMore:hello struts_path="/portlet_a/view" ....hope you can understand my bad englishcheers Please sign in to reply. Reply as... Cancel Brett Swaim Sebastián Gurin 16 Years Ago Very nice! Please sign in to reply. Reply as... Cancel Thiago Leão Moreira Brett Swaim 13 Years Ago Really nice article! I didn't know about tagfiles! One more thing learned... Please sign in to reply. Reply as... Cancel
Brett Swaim Sebastián Gurin 16 Years Ago Very nice! Please sign in to reply. Reply as... Cancel Thiago Leão Moreira Brett Swaim 13 Years Ago Really nice article! I didn't know about tagfiles! One more thing learned... Please sign in to reply. Reply as... Cancel
Thiago Leão Moreira Brett Swaim 13 Years Ago Really nice article! I didn't know about tagfiles! One more thing learned... Please sign in to reply. Reply as... Cancel