You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Cheshire <ch...@gmail.com> on 2006/08/28 23:52:51 UTC

problem with html:link tag

I am trying to use html:link to "fix" a URL so that it has the context
path on it, but when the value of the page parameter requires quotes
inside it (to specify a string value to a function) then the page
won't compile.

I have this link in td in the page :

<html:link page="${bgdlr:loadPendingOrdersLink(sortOrders["DAYS_UNTIL_CONFIRMED"],
0, (sessionInfo.pendingOrdersSortOrder eq
sortOrders["DAYS_UNTIL_CONFIRMED"] ? not
sessionInfo.pendingOrdersSortedAscending : true))}"
styleClass="copywhite">remaining</html:link>

If it is just a straight <a href=""> tag it works fine, but when it is
like this I get the following compilation error :

org.apache.jasper.JasperException:  equal symbol expected
/WEB-INF/jspf/orderStackPanel.jspf(21,197)

(The line above is line 21, character 197 is the D in the end of the
first instance of DAYS_UNTIL_CONFIRMED.

sortOrders is an application scope map of SortOrder objects (my class)
keyed by String.

sessionInfo is my own class.

bgdlr:loadPendingOrders is a function I have in a tag library that
builds the appropriate URL (without the context path where the web app
might be installed).

I have a lot of instances of this type of URL building, which is why I
have put them in a custom tag library.

I am using Netbeans 5.5 to develop the web-app, and it is being
deployed on Sun Java Application Server 9, and both give that error. I
initially had the web-app deployed with an empty context path, but now
I need to change that, so  I am building the hrefs now using the
html:link tag instead of specifying an href directly.

Any ideas?

Thanks

Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: problem with html:link tag

Posted by Chris Cheshire <ch...@gmail.com>.
Doh. I also discovered using single quotes around the page= value
works too (not to mention the Netbeans editor correctly
syntax-highlights the line properly this way).

Thanks Michael :)


On 8/28/06, Michael Jouravlev <jm...@gmail.com> wrote:
> Escaping the quotation symbols inside the string usually helps.
>
> On 8/28/06, Chris Cheshire <ch...@gmail.com> wrote:
> > I am trying to use html:link to "fix" a URL so that it has the context
> > path on it, but when the value of the page parameter requires quotes
> > inside it (to specify a string value to a function) then the page
> > won't compile.
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: problem with html:link tag

Posted by Michael Jouravlev <jm...@gmail.com>.
Escaping the quotation symbols inside the string usually helps.

On 8/28/06, Chris Cheshire <ch...@gmail.com> wrote:
> I am trying to use html:link to "fix" a URL so that it has the context
> path on it, but when the value of the page parameter requires quotes
> inside it (to specify a string value to a function) then the page
> won't compile.
>
> I have this link in td in the page :
>
> <html:link page="${bgdlr:loadPendingOrdersLink(sortOrders["DAYS_UNTIL_CONFIRMED"],
> 0, (sessionInfo.pendingOrdersSortOrder eq
> sortOrders["DAYS_UNTIL_CONFIRMED"] ? not
> sessionInfo.pendingOrdersSortedAscending : true))}"
> styleClass="copywhite">remaining</html:link>
>
> If it is just a straight <a href=""> tag it works fine, but when it is
> like this I get the following compilation error :
>
> org.apache.jasper.JasperException:  equal symbol expected
> /WEB-INF/jspf/orderStackPanel.jspf(21,197)
>
> (The line above is line 21, character 197 is the D in the end of the
> first instance of DAYS_UNTIL_CONFIRMED.
>
> sortOrders is an application scope map of SortOrder objects (my class)
> keyed by String.
>
> sessionInfo is my own class.
>
> bgdlr:loadPendingOrders is a function I have in a tag library that
> builds the appropriate URL (without the context path where the web app
> might be installed).
>
> I have a lot of instances of this type of URL building, which is why I
> have put them in a custom tag library.
>
> I am using Netbeans 5.5 to develop the web-app, and it is being
> deployed on Sun Java Application Server 9, and both give that error. I
> initially had the web-app deployed with an empty context path, but now
> I need to change that, so  I am building the hrefs now using the
> html:link tag instead of specifying an href directly.
>
> Any ideas?
>
> Thanks
>
> Chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org