struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "rubensgama" <rub...@softsite.com.br>
Subject HTML LINK TAG
Date Tue, 13 May 2003 13:02:56 GMT
In this example:


<html:link page="pageName" name="actionFormName" property="hashMap"
scope="request">LINK</html:link>



The HashMap values are encoded using the following method of the class
org.apache.struts.util.RequestUtils:

public static String encodeURL(String url) 
{
	// default to old version
      String encodedURL = URLEncoder.encode(url);
      Class encoderClass = URLEncoder.class;

        try 
	  {
            // get version of encode method with two String args
            Class[] args = new Class[] { String.class, String.class };
            Method encode = encoderClass.getMethod("encode", args);

            // encode url with new 1.4 method and UTF-8 encoding
            encodedURL = (String) encode.invoke(null, new Object[] {
url, "UTF-8" });

        } catch (IllegalAccessException e) {
            log.debug("Could not find Java 1.4 encode method.  Using
deprecated version.", e);
        } catch (InvocationTargetException e) {
            log.debug("Could not find Java 1.4 encode method. Using
deprecated version.", e);
        } catch (NoSuchMethodException e) {
            log.debug("Could not find Java 1.4 encode method.  Using
deprecated version.", e);
        }

        return encodedURL;
    }


and what can I do if I donĀ“t want to use 'UTF-8' encoding?


Thanks in advance!
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/1/2003
 


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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/1/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/1/2003
 


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


Mime
View raw message