Michael Young Hace 16 años 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. Por favor identifíquese para votar. Contestar como... Cancelar
Ray Auge Hace 16 años Good job Brett!This looks very interesting. Por favor identifíquese para votar. Contestar como... Cancelar
Sebastián Gurin Hace 16 años 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 Por favor identifíquese para votar. Contestar como... Cancelar Sebastián Gurin Sebastián Gurin Hace 16 años 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... Por favor identifíquese para votar. Contestar como... Cancelar Brett Swaim Sebastián Gurin Hace 16 años 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 Por favor identifíquese para votar. Contestar como... Cancelar Sebastián Gurin Brett Swaim Hace 16 años 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. Por favor identifíquese para votar. Contestar como... Cancelar
Sebastián Gurin Sebastián Gurin Hace 16 años 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... Por favor identifíquese para votar. Contestar como... Cancelar Brett Swaim Sebastián Gurin Hace 16 años 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 Por favor identifíquese para votar. Contestar como... Cancelar Sebastián Gurin Brett Swaim Hace 16 años 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. Por favor identifíquese para votar. Contestar como... Cancelar
Brett Swaim Sebastián Gurin Hace 16 años 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 Por favor identifíquese para votar. Contestar como... Cancelar Sebastián Gurin Brett Swaim Hace 16 años 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. Por favor identifíquese para votar. Contestar como... Cancelar
Sebastián Gurin Brett Swaim Hace 16 años 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. Por favor identifíquese para votar. Contestar como... Cancelar
lajos papp Hace 16 años 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/> Por favor identifíquese para votar. Contestar como... Cancelar Brett Swaim lajos papp Hace 16 años Thanks for the heads up, I've adjusted the example.Brett Por favor identifíquese para votar. Contestar como... Cancelar
Brett Swaim lajos papp Hace 16 años Thanks for the heads up, I've adjusted the example.Brett Por favor identifíquese para votar. Contestar como... Cancelar
Sebastián Gurin Hace 16 años what about "var" <portlet:actionURL> attribute? can it be simulated by your <showMore:hello> custom tag ? Por favor identifíquese para votar. Contestar como... Cancelar Sebastián Gurin Sebastián Gurin Hace 16 años 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 Por favor identifíquese para votar. Contestar como... Cancelar Brett Swaim Sebastián Gurin Hace 16 años Very nice! Por favor identifíquese para votar. Contestar como... Cancelar Thiago Leão Moreira Brett Swaim Hace 13 años Really nice article! I didn't know about tagfiles! One more thing learned... Por favor identifíquese para votar. Contestar como... Cancelar
Sebastián Gurin Sebastián Gurin Hace 16 años 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 Por favor identifíquese para votar. Contestar como... Cancelar Brett Swaim Sebastián Gurin Hace 16 años Very nice! Por favor identifíquese para votar. Contestar como... Cancelar Thiago Leão Moreira Brett Swaim Hace 13 años Really nice article! I didn't know about tagfiles! One more thing learned... Por favor identifíquese para votar. Contestar como... Cancelar
Brett Swaim Sebastián Gurin Hace 16 años Very nice! Por favor identifíquese para votar. Contestar como... Cancelar Thiago Leão Moreira Brett Swaim Hace 13 años Really nice article! I didn't know about tagfiles! One more thing learned... Por favor identifíquese para votar. Contestar como... Cancelar
Thiago Leão Moreira Brett Swaim Hace 13 años Really nice article! I didn't know about tagfiles! One more thing learned... Por favor identifíquese para votar. Contestar como... Cancelar