You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Peter Thomas (JIRA)" <ji...@apache.org> on 2007/04/02 11:13:32 UTC

[jira] Created: (WICKET-444) src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it

src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it
-----------------------------------------------------------------------------------------------------

                 Key: WICKET-444
                 URL: https://issues.apache.org/jira/browse/WICKET-444
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3
            Reporter: Peter Thomas


I'm using wicket-1.3.0-incubating-SNAPSHOT.jar Sun, 01 Apr 2007 19:21:01 GMT

Wicket appears to pre-process and modify the value of the SRC attribute in most cases (e.g. IMG tags) so that at run time, the path is absolute path.  This works fine for IMG tags.  So with wicket filter mapped to /app/* and static files in /resources :

The following HTML: <img src="resources/system-search.png"/>

becomes at runtime: <img src="/jtrac/resources/system-search.png">

Problem: 

Ever since 1.3 I noticed that fixing of the SRC attribute was not happening for <input type=image"/> tags.  I worked around this by prepending "../" - but obviously this is not a good idea.  For example this is what I am using which works:

<input type="image" wicket:id="deallocate" src="../resources/remove.png"/>

What prompted me to raise this JIRA now is that I just switched to the latest SNAPSHOT and I find that any IMG tag that has a "wicket:message" attribute also does not get the SRC value "fixed".  This used to work in 1.2.X

I have a feeling this is related to the changes made as per https://issues.apache.org/jira/browse/WICKET-440

So to summarize, wicket does not change SRC values to absolute paths for the following tags:

a) any tag with a wicket:message attribute present
b) any <input type="image"/> tag


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


[jira] Updated: (WICKET-444) src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it

Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-444?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alastair Maw updated WICKET-444:
--------------------------------

    Fix Version/s:     (was: 1.3.0-rc1)
                   1.3.0-beta2

> src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-444
>                 URL: https://issues.apache.org/jira/browse/WICKET-444
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: trunk
>            Reporter: Peter Thomas
>         Assigned To: Alastair Maw
>             Fix For: 1.3.0-beta2
>
>
> I'm using wicket-1.3.0-incubating-SNAPSHOT.jar Sun, 01 Apr 2007 19:21:01 GMT
> Wicket appears to pre-process and modify the value of the SRC attribute in most cases (e.g. IMG tags) so that at run time, the path is absolute path.  This works fine for IMG tags.  So with wicket filter mapped to /app/* and static files in /resources :
> The following HTML: <img src="resources/system-search.png"/>
> becomes at runtime: <img src="/jtrac/resources/system-search.png">
> Problem: 
> Ever since 1.3 I noticed that fixing of the SRC attribute was not happening for <input type=image"/> tags.  I worked around this by prepending "../" - but obviously this is not a good idea.  For example this is what I am using which works:
> <input type="image" wicket:id="deallocate" src="../resources/remove.png"/>
> What prompted me to raise this JIRA now is that I just switched to the latest SNAPSHOT and I find that any IMG tag that has a "wicket:message" attribute also does not get the SRC value "fixed".  This used to work in 1.2.X
> I have a feeling this is related to the changes made as per https://issues.apache.org/jira/browse/WICKET-440
> So to summarize, wicket does not change SRC values to absolute paths for the following tags:
> a) any tag with a wicket:message attribute present
> b) any <input type="image"/> tag

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


[jira] Reopened: (WICKET-444) src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it

Posted by "Peter Thomas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-444?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Thomas reopened WICKET-444:
---------------------------------


Matej - I think this came back in the latest SNAPSHOT.  For img tags having a wicket:message attribute I have to use the relative path "../resources/foo.gif" and this was working fine in last weeks SNAPSHOT.

> src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-444
>                 URL: https://issues.apache.org/jira/browse/WICKET-444
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3
>            Reporter: Peter Thomas
>             Fix For: 1.3
>
>
> I'm using wicket-1.3.0-incubating-SNAPSHOT.jar Sun, 01 Apr 2007 19:21:01 GMT
> Wicket appears to pre-process and modify the value of the SRC attribute in most cases (e.g. IMG tags) so that at run time, the path is absolute path.  This works fine for IMG tags.  So with wicket filter mapped to /app/* and static files in /resources :
> The following HTML: <img src="resources/system-search.png"/>
> becomes at runtime: <img src="/jtrac/resources/system-search.png">
> Problem: 
> Ever since 1.3 I noticed that fixing of the SRC attribute was not happening for <input type=image"/> tags.  I worked around this by prepending "../" - but obviously this is not a good idea.  For example this is what I am using which works:
> <input type="image" wicket:id="deallocate" src="../resources/remove.png"/>
> What prompted me to raise this JIRA now is that I just switched to the latest SNAPSHOT and I find that any IMG tag that has a "wicket:message" attribute also does not get the SRC value "fixed".  This used to work in 1.2.X
> I have a feeling this is related to the changes made as per https://issues.apache.org/jira/browse/WICKET-440
> So to summarize, wicket does not change SRC values to absolute paths for the following tags:
> a) any tag with a wicket:message attribute present
> b) any <input type="image"/> tag

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


[jira] Assigned: (WICKET-444) src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it

Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-444?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alastair Maw reassigned WICKET-444:
-----------------------------------

    Assignee: Alastair Maw

> src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-444
>                 URL: https://issues.apache.org/jira/browse/WICKET-444
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: trunk
>            Reporter: Peter Thomas
>         Assigned To: Alastair Maw
>             Fix For: trunk
>
>
> I'm using wicket-1.3.0-incubating-SNAPSHOT.jar Sun, 01 Apr 2007 19:21:01 GMT
> Wicket appears to pre-process and modify the value of the SRC attribute in most cases (e.g. IMG tags) so that at run time, the path is absolute path.  This works fine for IMG tags.  So with wicket filter mapped to /app/* and static files in /resources :
> The following HTML: <img src="resources/system-search.png"/>
> becomes at runtime: <img src="/jtrac/resources/system-search.png">
> Problem: 
> Ever since 1.3 I noticed that fixing of the SRC attribute was not happening for <input type=image"/> tags.  I worked around this by prepending "../" - but obviously this is not a good idea.  For example this is what I am using which works:
> <input type="image" wicket:id="deallocate" src="../resources/remove.png"/>
> What prompted me to raise this JIRA now is that I just switched to the latest SNAPSHOT and I find that any IMG tag that has a "wicket:message" attribute also does not get the SRC value "fixed".  This used to work in 1.2.X
> I have a feeling this is related to the changes made as per https://issues.apache.org/jira/browse/WICKET-440
> So to summarize, wicket does not change SRC values to absolute paths for the following tags:
> a) any tag with a wicket:message attribute present
> b) any <input type="image"/> tag

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


[jira] Resolved: (WICKET-444) src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it

Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-444?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alastair Maw resolved WICKET-444.
---------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: trunk)
                   1.3.0-rc1

> src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-444
>                 URL: https://issues.apache.org/jira/browse/WICKET-444
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: trunk
>            Reporter: Peter Thomas
>         Assigned To: Alastair Maw
>             Fix For: 1.3.0-rc1
>
>
> I'm using wicket-1.3.0-incubating-SNAPSHOT.jar Sun, 01 Apr 2007 19:21:01 GMT
> Wicket appears to pre-process and modify the value of the SRC attribute in most cases (e.g. IMG tags) so that at run time, the path is absolute path.  This works fine for IMG tags.  So with wicket filter mapped to /app/* and static files in /resources :
> The following HTML: <img src="resources/system-search.png"/>
> becomes at runtime: <img src="/jtrac/resources/system-search.png">
> Problem: 
> Ever since 1.3 I noticed that fixing of the SRC attribute was not happening for <input type=image"/> tags.  I worked around this by prepending "../" - but obviously this is not a good idea.  For example this is what I am using which works:
> <input type="image" wicket:id="deallocate" src="../resources/remove.png"/>
> What prompted me to raise this JIRA now is that I just switched to the latest SNAPSHOT and I find that any IMG tag that has a "wicket:message" attribute also does not get the SRC value "fixed".  This used to work in 1.2.X
> I have a feeling this is related to the changes made as per https://issues.apache.org/jira/browse/WICKET-440
> So to summarize, wicket does not change SRC values to absolute paths for the following tags:
> a) any tag with a wicket:message attribute present
> b) any <input type="image"/> tag

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


[jira] Resolved: (WICKET-444) src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-444?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juergen Donnerstag resolved WICKET-444.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3

I've added a junit test case to the lastest 1.3 snapshot to validate your information.

Wicket prepends the context path to certain attributes (see PrependContextPathHandler). Wicket does not translate relative paths into absolute paths. It simply prepends the context path.

Any tag which has any wicket attribute (wicket:id, wicket:message) gets ignored by PrependContextPathHandler since the assumption is, a component will be attached to it. This is true for wicket:message tags as well, with the difference, that the component is created and attached automatically

My junit test shows that your observation b) is not correct for the reason given above (no wicket:id, no wicket:message).

But you are right, this is a change in the behavior between 1.2.x and 1.3 which has to do with WicketMessageTagHandler which has been re-implemented. I fixed it.


> src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-444
>                 URL: https://issues.apache.org/jira/browse/WICKET-444
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3
>            Reporter: Peter Thomas
>             Fix For: 1.3
>
>
> I'm using wicket-1.3.0-incubating-SNAPSHOT.jar Sun, 01 Apr 2007 19:21:01 GMT
> Wicket appears to pre-process and modify the value of the SRC attribute in most cases (e.g. IMG tags) so that at run time, the path is absolute path.  This works fine for IMG tags.  So with wicket filter mapped to /app/* and static files in /resources :
> The following HTML: <img src="resources/system-search.png"/>
> becomes at runtime: <img src="/jtrac/resources/system-search.png">
> Problem: 
> Ever since 1.3 I noticed that fixing of the SRC attribute was not happening for <input type=image"/> tags.  I worked around this by prepending "../" - but obviously this is not a good idea.  For example this is what I am using which works:
> <input type="image" wicket:id="deallocate" src="../resources/remove.png"/>
> What prompted me to raise this JIRA now is that I just switched to the latest SNAPSHOT and I find that any IMG tag that has a "wicket:message" attribute also does not get the SRC value "fixed".  This used to work in 1.2.X
> I have a feeling this is related to the changes made as per https://issues.apache.org/jira/browse/WICKET-440
> So to summarize, wicket does not change SRC values to absolute paths for the following tags:
> a) any tag with a wicket:message attribute present
> b) any <input type="image"/> tag

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


[jira] Closed: (WICKET-444) src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it

Posted by "Peter Thomas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-444?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Thomas closed WICKET-444.
-------------------------------


thanks, message attributes work as expected now.

> src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-444
>                 URL: https://issues.apache.org/jira/browse/WICKET-444
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3
>            Reporter: Peter Thomas
>             Fix For: 1.3
>
>
> I'm using wicket-1.3.0-incubating-SNAPSHOT.jar Sun, 01 Apr 2007 19:21:01 GMT
> Wicket appears to pre-process and modify the value of the SRC attribute in most cases (e.g. IMG tags) so that at run time, the path is absolute path.  This works fine for IMG tags.  So with wicket filter mapped to /app/* and static files in /resources :
> The following HTML: <img src="resources/system-search.png"/>
> becomes at runtime: <img src="/jtrac/resources/system-search.png">
> Problem: 
> Ever since 1.3 I noticed that fixing of the SRC attribute was not happening for <input type=image"/> tags.  I worked around this by prepending "../" - but obviously this is not a good idea.  For example this is what I am using which works:
> <input type="image" wicket:id="deallocate" src="../resources/remove.png"/>
> What prompted me to raise this JIRA now is that I just switched to the latest SNAPSHOT and I find that any IMG tag that has a "wicket:message" attribute also does not get the SRC value "fixed".  This used to work in 1.2.X
> I have a feeling this is related to the changes made as per https://issues.apache.org/jira/browse/WICKET-440
> So to summarize, wicket does not change SRC values to absolute paths for the following tags:
> a) any tag with a wicket:message attribute present
> b) any <input type="image"/> tag

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


[jira] Commented: (WICKET-444) src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it

Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498760 ] 

Alastair Maw commented on WICKET-444:
-------------------------------------

An update on this...

Wicket now prepends your paths to make them relative to the context root, so we don't use the context path any more. It will only do this on standard HTML tags that are NOT already Wicket components I.e. if you put a wicket:id attribute in, it won't prepend things for you.

In your example here:
<input type="image" wicket:id="deallocate" src="../resources/remove.png"/> 

To make this work, you want to be using an ImageButton component, and provide a ResourceReference for that image in the constructor.

A separate issue is that <img> tags with a wicket:message attribute don't get their src attribute prefixed. It's related, but different. See WICKET-590 for details.

> src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-444
>                 URL: https://issues.apache.org/jira/browse/WICKET-444
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: trunk
>            Reporter: Peter Thomas
>         Assigned To: Alastair Maw
>             Fix For: 1.3.0-beta2
>
>
> I'm using wicket-1.3.0-incubating-SNAPSHOT.jar Sun, 01 Apr 2007 19:21:01 GMT
> Wicket appears to pre-process and modify the value of the SRC attribute in most cases (e.g. IMG tags) so that at run time, the path is absolute path.  This works fine for IMG tags.  So with wicket filter mapped to /app/* and static files in /resources :
> The following HTML: <img src="resources/system-search.png"/>
> becomes at runtime: <img src="/jtrac/resources/system-search.png">
> Problem: 
> Ever since 1.3 I noticed that fixing of the SRC attribute was not happening for <input type=image"/> tags.  I worked around this by prepending "../" - but obviously this is not a good idea.  For example this is what I am using which works:
> <input type="image" wicket:id="deallocate" src="../resources/remove.png"/>
> What prompted me to raise this JIRA now is that I just switched to the latest SNAPSHOT and I find that any IMG tag that has a "wicket:message" attribute also does not get the SRC value "fixed".  This used to work in 1.2.X
> I have a feeling this is related to the changes made as per https://issues.apache.org/jira/browse/WICKET-440
> So to summarize, wicket does not change SRC values to absolute paths for the following tags:
> a) any tag with a wicket:message attribute present
> b) any <input type="image"/> tag

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


[jira] Commented: (WICKET-444) src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it

Posted by "Peter Thomas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12501939 ] 

Peter Thomas commented on WICKET-444:
-------------------------------------

Al - I really liked the fact that previously you could switch between <input type-="submit"/> and <input type="image"/> in the markup without *any* changes to the Java code.

It used to work fine earlier - and I'm just wondering if it is too much to ask to have Wicket work this way.  I can certainly explore the ImageButton component, but so far I've been very productive using resources relative to context-path root, and am also guessing that the alternative would be a little more intimidating for someone new to wicket.

Do let me know!



> src attribute path not processed by wicket for INPUT type=image and any IMG with wicket:message in it
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-444
>                 URL: https://issues.apache.org/jira/browse/WICKET-444
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: trunk
>            Reporter: Peter Thomas
>            Assignee: Alastair Maw
>             Fix For: 1.3.0-beta2
>
>
> I'm using wicket-1.3.0-incubating-SNAPSHOT.jar Sun, 01 Apr 2007 19:21:01 GMT
> Wicket appears to pre-process and modify the value of the SRC attribute in most cases (e.g. IMG tags) so that at run time, the path is absolute path.  This works fine for IMG tags.  So with wicket filter mapped to /app/* and static files in /resources :
> The following HTML: <img src="resources/system-search.png"/>
> becomes at runtime: <img src="/jtrac/resources/system-search.png">
> Problem: 
> Ever since 1.3 I noticed that fixing of the SRC attribute was not happening for <input type=image"/> tags.  I worked around this by prepending "../" - but obviously this is not a good idea.  For example this is what I am using which works:
> <input type="image" wicket:id="deallocate" src="../resources/remove.png"/>
> What prompted me to raise this JIRA now is that I just switched to the latest SNAPSHOT and I find that any IMG tag that has a "wicket:message" attribute also does not get the SRC value "fixed".  This used to work in 1.2.X
> I have a feeling this is related to the changes made as per https://issues.apache.org/jira/browse/WICKET-440
> So to summarize, wicket does not change SRC values to absolute paths for the following tags:
> a) any tag with a wicket:message attribute present
> b) any <input type="image"/> tag

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