You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2011/01/04 12:27:47 UTC

[jira] Updated: (WW-3524) When bean contains a property of type URL the json writer is trying to connect to the URL and retreive the contents rather than returning just the URL as a string

     [ https://issues.apache.org/jira/browse/WW-3524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart updated WW-3524:
------------------------------

    Fix Version/s: 2.2.2
         Assignee: Maurizio Cucchiara  (was: Lukasz Lenart)

I think you'll do it the best

> When bean contains a property of type URL the json writer is trying to connect to the URL and retreive the contents rather than returning just the URL as a string 
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3524
>                 URL: https://issues.apache.org/jira/browse/WW-3524
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.1.6
>         Environment: java 1.6 running under windows or linux
>            Reporter: matthew cooper
>            Assignee: Maurizio Cucchiara
>             Fix For: 2.2.2
>
>         Attachments: WW-3524-2.patch, WW-3524.patch
>
>
> When a bean being serialized into a JSON string contains a member of type URL the JSONWriter identifys the URL itself as a bean type, this recusrivly looks at all the properties of the URL object and reteives the reader methods for each one which it invokes and repeats the process based on the returned object. 
> The URL class contains a bunch of properties including content which has the getContent method as the reader.
> when this method is invoked the URL class will make the HTTP request and return the html content, if the URL is not valid it will thrown an exception. 
> THe following is a list of the properties and the associated reader methods from the URL class 
> Property name authority
> Accessor method is public java.lang.String java.net.URL.getAuthority()
>   
> Property name content
> Accessor method is public final java.lang.Object java.net.URL.getContent() throws java.io.IOException
>  
> Property name defaultPort
> Accessor method is public int java.net.URL.getDefaultPort()
>  
> Property name file
> Accessor method is public java.lang.String java.net.URL.getFile()
>  
> Property name host
> Accessor method is public java.lang.String java.net.URL.getHost()
>  
> Property name path
> Accessor method is public java.lang.String java.net.URL.getPath()
>  
> Property name port
> Accessor method is public int java.net.URL.getPort()
>  
> Property name protocol
> Accessor method is public java.lang.String java.net.URL.getProtocol()
>  
> Property name query
> Accessor method is public java.lang.String java.net.URL.getQuery()
>  
> Property name ref
> Accessor method is public java.lang.String java.net.URL.getRef()
>  
> Property name userInfo
> Accessor method is public java.lang.String java.net.URL.getUserInfo()
> i think the JSONWriter needs a special case for the URL object as you would not want the getContent method being invoked.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.