You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Markus Joschko (JIRA)" <ta...@jakarta.apache.org> on 2005/07/27 16:14:33 UTC

[jira] Created: (TAPESTRY-445) ContextAssetFactory assembles wrong filename for assets

ContextAssetFactory assembles wrong filename for assets
-------------------------------------------------------

         Key: TAPESTRY-445
         URL: http://issues.apache.org/jira/browse/TAPESTRY-445
     Project: Tapestry
        Type: Bug
  Components: Framework  
    Versions: 4.0    
 Environment: tested with beta-3
    Reporter: Markus Joschko


I tried to added a javascript file to the body using the followoing lines in the component:

  @Asset("context:/scripts/prototype.js")
 public abstract IAsset getPrototypeJsFile();

 protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) {
		super.renderComponent(writer, cycle);
    		PageRenderSupport renderSupport = TapestryUtils.getPageRenderSupport(cycle,this);
    		renderSupport.addExternalScript(getPrototypeJsFile().getResourceLocation());
    }

 This rendered HTML code looks like 
 <script language="JavaScript" type="text/javascript" src="/scripts/prototype.js/scripts/prototype.js"></script>
which is obvious wrong because the name is doubled and the context path is missing.


I think the error is caused by the ContextAssetFactory. The createAsset method should IMO look like

  public IAsset createAsset(Resource resource, Location location)
    {
        return new ContextAsset(_contextPath, resource, location);
    }

instead of 

   public IAsset createAsset(Resource resource, Location location)
    {
        return new ContextAsset(resource.getPath(), resource, location);
    }

Could you please apply this as it is annoying to not have javascript files ;-)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Assigned: (TAPESTRY-445) ContextAssetFactory assembles wrong filename for assets

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-445?page=all ]

Howard M. Lewis Ship reassigned TAPESTRY-445:
---------------------------------------------

    Assign To: Howard M. Lewis Ship

> ContextAssetFactory assembles wrong filename for assets
> -------------------------------------------------------
>
>          Key: TAPESTRY-445
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-445
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: tested with beta-3
>     Reporter: Markus Joschko
>     Assignee: Howard M. Lewis Ship

>
> I tried to added a javascript file to the body using the followoing lines in the component:
>   @Asset("context:/scripts/prototype.js")
>  public abstract IAsset getPrototypeJsFile();
>  protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) {
> 		super.renderComponent(writer, cycle);
>     		PageRenderSupport renderSupport = TapestryUtils.getPageRenderSupport(cycle,this);
>     		renderSupport.addExternalScript(getPrototypeJsFile().getResourceLocation());
>     }
>  This rendered HTML code looks like 
>  <script language="JavaScript" type="text/javascript" src="/scripts/prototype.js/scripts/prototype.js"></script>
> which is obvious wrong because the name is doubled and the context path is missing.
> I think the error is caused by the ContextAssetFactory. The createAsset method should IMO look like
>   public IAsset createAsset(Resource resource, Location location)
>     {
>         return new ContextAsset(_contextPath, resource, location);
>     }
> instead of 
>    public IAsset createAsset(Resource resource, Location location)
>     {
>         return new ContextAsset(resource.getPath(), resource, location);
>     }
> Could you please apply this as it is annoying to not have javascript files ;-)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Closed: (TAPESTRY-445) ContextAssetFactory assembles wrong filename for assets

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-445?page=all ]
     
Howard M. Lewis Ship closed TAPESTRY-445:
-----------------------------------------

    Fix Version: 4.0
     Resolution: Fixed

> ContextAssetFactory assembles wrong filename for assets
> -------------------------------------------------------
>
>          Key: TAPESTRY-445
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-445
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: tested with beta-3
>     Reporter: Markus Joschko
>     Assignee: Howard M. Lewis Ship
>      Fix For: 4.0

>
> I tried to added a javascript file to the body using the followoing lines in the component:
>   @Asset("context:/scripts/prototype.js")
>  public abstract IAsset getPrototypeJsFile();
>  protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) {
> 		super.renderComponent(writer, cycle);
>     		PageRenderSupport renderSupport = TapestryUtils.getPageRenderSupport(cycle,this);
>     		renderSupport.addExternalScript(getPrototypeJsFile().getResourceLocation());
>     }
>  This rendered HTML code looks like 
>  <script language="JavaScript" type="text/javascript" src="/scripts/prototype.js/scripts/prototype.js"></script>
> which is obvious wrong because the name is doubled and the context path is missing.
> I think the error is caused by the ContextAssetFactory. The createAsset method should IMO look like
>   public IAsset createAsset(Resource resource, Location location)
>     {
>         return new ContextAsset(_contextPath, resource, location);
>     }
> instead of 
>    public IAsset createAsset(Resource resource, Location location)
>     {
>         return new ContextAsset(resource.getPath(), resource, location);
>     }
> Could you please apply this as it is annoying to not have javascript files ;-)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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