>>>>> "Alex" == Alex McLintock <[EMAIL PROTECTED]> writes:

    Alex> I am trying to insert a struts value into a parameter in a URL. However I 
need
    Alex> to URL encode the value because else characters like " " will confuse 
Netscape.

    Alex> Is there a "proper" way of doing this in Struts?

    Alex> I am currently doing something like this....

    Alex> ....
    Alex> <%@ page import="java.net.URLEncoder" %>
    Alex> ....

    Alex>          <a href="listDocument.do?action=List&title=<%=URLEncoder.encode(((
    Alex>          MetadataValueForm )title).getValue()) %>">

    Alex>                  <bean:write name="title" property="value"/>
    Alex>          </a>

    Alex> But I am not happy about it....I want as little java in the jsp template as
    Alex> possible.

explore the "<html:link>" tag.  Use the attributes which specify a Map to add
the attributes.  It will URLEncode the entire generated URL.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to