request.setAttribute("test", "i'm a seahorse");
<h2>${test}</h2>
<h2></h2>
--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.
Hi Winfield,this should work. Are you sure you are hitting the component code? Could it be that what you are running is out of sync with what you are seeing in the code?
this should work. Are you sure you are hitting the component code? Could it be that what you are running is out of sync with what you are seeing in the code?
[INFO] [talledLocalContainer] An error occurred at line: 4 in the jsp file: /WEB-INF/jsp/SampleCaps.jsp
[INFO] [talledLocalContainer] title cannot be resolved to a variable
[INFO] [talledLocalContainer] 1: <%@ include file="/WEB-INF/jspf/htmlTags.jspf" %>
[INFO] [talledLocalContainer] 2: <%--@elvariable id="document" type="com.eastbanctech.paintnite.beans.SampleCapsDocument"--%>
[INFO] [talledLocalContainer] 3:
[INFO] [talledLocalContainer] 4: <% System.out.println((String) title); %>
so, the question here is: is your component pointing to template through hst:template property [2]?
You received this message because you are subscribed to a topic in the Google Groups "Hippo Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hippo-community/ZmWCJ1IPe9w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hippo-communi...@googlegroups.com.
Thanks for the feedback, gents:this should work. Are you sure you are hitting the component code? Could it be that what you are running is out of sync with what you are seeing in the code?The component code is definitely running, because any debug logging I put in the component gets printed to console and breakpoints set there freeze execution before the page is rendered. Perhaps it's possible that more than one component is executing, but that would seem to imply that there are multiple request objects as well.I attempted to log the value of my string attribute, title, inside the JSP:[INFO] [talledLocalContainer] An error occurred at line: 4 in the jsp file: /WEB-INF/jsp/SampleCaps.jsp
[INFO] [talledLocalContainer] title cannot be resolved to a variable
[INFO] [talledLocalContainer] 1: <%@ include file="/WEB-INF/jspf/htmlTags.jspf" %>
[INFO] [talledLocalContainer] 2: <%--@elvariable id="document" type="com.eastbanctech.paintnite.beans.SampleCapsDocument"--%>
[INFO] [talledLocalContainer] 3:
[INFO] [talledLocalContainer] 4: <% System.out.println((String) title); %>
So the template really does seem to be totally unaware of my attributes. Is there a way to check the relativecontentpath/pathinfo from the template without passing that information in from the component?so, the question here is: is your component pointing to template through hst:template property [2]?Yes:
request.setAttribute("test", "i'm a seahorse");
/hst:hst/hst:configurations/paintnite/hst:templates/SampleCaps
Bert, I may be confused here, because you excerpted the code where I set the title attribute exactly that way:request.setAttribute("test", "i'm a seahorse");
Additionally, the SampleCaps/main childnode has the hst:template property set to:/hst:hst/hst:configurations/paintnite/hst:templates/SampleCapsAaaaand here's where I realized my mistake: hst:componentclassname was a property of hst:pages/SampleCaps, not hst:pages/SampleCaps/main. Facepalm forever.So, this does lead me to a couple questions:
- Since the component was being invoked in both cases, why is it that adding attributes to request is only effective when the component is called for the SampleCaps/main child node?
- Is the request object not a singleton?