This content has been marked as final.
Show 3 replies
-
1. Re: Portlet tag interpretation sequence
louise_za Jul 12, 2006 3:22 AM (in response to louise_za)In the above code excerpt I forgot to add the return statement in the getChildren method. The code should look as follows:
public String getChildren(String id) { String children; children = "\t<portlet:actionURL windowState=\"normal\" portletMode=\"view\" var=\"actionUrl\">\n" + "\t\t<portlet:param name=\"id\" value=\"" + id + "\"/>\n" + "\t</portlet:actionURL>\n" + "<script>\n" + "\t <a href=\"<%=actionUrl>\">The link</a>"; return children; }
The actual value of the string returned looks as follows, for example:<portlet:actionURL windowState="normal" portletMode="view" var="actionUrl"> <portlet:param name="id" value="1009"/> </portlet:actionURL> <script> tree.add(1,' ESM Results','_self', '<%= actionUrl %>','', '', '');
In the above problem the javascript elements work fine. It is the <portlet:ActionURL> tag that does not get generated. The actionUrl variable is passed as is in a text form and not as the actual action URL.
So, when someone clicks on the link they get the HTTP400 - Bad Request error because the link is built to look like this:http://10.0.0.198:8080/portal/portal/default/<%=actionUrl%>
-
2. Re: Portlet tag interpretation sequence
louise_za Jul 12, 2006 3:24 AM (in response to louise_za)Is there a specific point during the compilation of a jsp when all the portlet specific variables/tags are interpreted and converted into their actual values?
Any help will be much appreciated. -
3. Re: Portlet tag interpretation sequence
louise_za Jul 12, 2006 3:33 AM (in response to louise_za)Sorry, made another mistake...what happens when you don't want to post all your code and there is no edit button!
The code exerpt above detailing the actual value of the string returned should be:<portlet:actionURL windowState="normal" portletMode="view" var="actionUrl"> <portlet:param name="id" value="1009"/> </portlet:actionURL> <script> <a href="<%=actionUrl%>">The link</a>
Anyway, the gist is still the same :)