Michael Young Vor 16 Jahren 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. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Ray Auge Vor 16 Jahren Good job Brett!This looks very interesting. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Sebastián Gurin Vor 16 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Sebastián Gurin Sebastián Gurin Vor 16 Jahren 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... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Brett Swaim Sebastián Gurin Vor 16 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Sebastián Gurin Brett Swaim Vor 16 Jahren 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. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Sebastián Gurin Sebastián Gurin Vor 16 Jahren 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... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Brett Swaim Sebastián Gurin Vor 16 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Sebastián Gurin Brett Swaim Vor 16 Jahren 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. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Brett Swaim Sebastián Gurin Vor 16 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Sebastián Gurin Brett Swaim Vor 16 Jahren 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. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Sebastián Gurin Brett Swaim Vor 16 Jahren 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. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
lajos papp Vor 16 Jahren 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/> Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Brett Swaim lajos papp Vor 16 Jahren Thanks for the heads up, I've adjusted the example.Brett Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Brett Swaim lajos papp Vor 16 Jahren Thanks for the heads up, I've adjusted the example.Brett Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Sebastián Gurin Vor 15 Jahren what about "var" <portlet:actionURL> attribute? can it be simulated by your <showMore:hello> custom tag ? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Sebastián Gurin Sebastián Gurin Vor 15 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Brett Swaim Sebastián Gurin Vor 15 Jahren Very nice! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Thiago Leão Moreira Brett Swaim Vor 13 Jahren Really nice article! I didn't know about tagfiles! One more thing learned... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Sebastián Gurin Sebastián Gurin Vor 15 Jahren 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 Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Brett Swaim Sebastián Gurin Vor 15 Jahren Very nice! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Thiago Leão Moreira Brett Swaim Vor 13 Jahren Really nice article! I didn't know about tagfiles! One more thing learned... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Brett Swaim Sebastián Gurin Vor 15 Jahren Very nice! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Thiago Leão Moreira Brett Swaim Vor 13 Jahren Really nice article! I didn't know about tagfiles! One more thing learned... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Thiago Leão Moreira Brett Swaim Vor 13 Jahren Really nice article! I didn't know about tagfiles! One more thing learned... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen