You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by sommeralex <al...@gmail.com> on 2012/02/17 19:36:37 UTC

retrieving image paths of uploaded images

Hi, 

I am dynamically uploading files/images with tapestry, and storing them in a
path named /usercontent/username/type/files(..) at the top of my project. 

/target
/.settings
/src
/usercontent

but the image is not shown within a tapestry page:

<ul id="sortable">
<li t:type="loop" source="fileElements" value="fileElement"
id="${fileElement.id}">   ${fileElement.path}  ${fileElement.name}     </li>
</ul>

my tapestry page editAnimation takes two activation contexts (username, and
name of animation gallery so here: sommeralex and maria)

http://localhost:8080/editanimation/sommeralex/maria

the full path of the image which is now shown is:

http://localhost:8080/editanimation/sommeralex/usercontent/sommeralex/animations/maria/image.png

i guess that this has something todo with assets.. but i have no idea how to
get the real path to show my image. 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/retrieving-image-paths-of-uploaded-images-tp5493508p5493508.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: retrieving image paths of uploaded images

Posted by sommeralex <al...@gmail.com>.
i am now storing everyting in layout

and can refer to my image by

src="/layout/usercontent/sommeralex/animations/maria/images-Autumn1600x1200.jpg"

but  i am not sure if this is the best approach.

2012/2/17 sommeralex [via Tapestry] <
ml-node+s1045711n5493524h86@n5.nabble.com>

> just with file.getPath()
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://tapestry.1045711.n5.nabble.com/retrieving-image-paths-of-uploaded-images-tp5493508p5493524.html
>  To unsubscribe from retrieving image paths of uploaded images, click here<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5493508&code=YWxleGFuZGVyLnNvbW1lckBnbWFpbC5jb218NTQ5MzUwOHwxMDUzMzQxMzM4>
> .
> NAML<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://tapestry.1045711.n5.nabble.com/retrieving-image-paths-of-uploaded-images-tp5493508p5493553.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: retrieving image paths of uploaded images

Posted by sommeralex <al...@gmail.com>.
Hi Robert,

Thanks for the quick reply. I put the files no in the webapp folder. And
things are easier now :0)

missunderstanding: the path below is "shown" as the image path if am
clicking on the image, but the image itself is not shown, therfore: the
path cant be resolved.

http://localhost:8080/editanimation/sommeralex/usercontent/sommeralex/animations/maria/image.png"


i'm doing it no within the webapp folder and it works.

thanks!

2012/2/17 robertdzeigler [via Tapestry] <
ml-node+s1045711n5493556h78@n5.nabble.com>

> 1) if they are at the top of the project they aren't (readily) accessible
> to the web app. To make them more accessible, try putting usercontent in
> src/main/webapp. That will put usercontent into the context path and make
> your life simpler
>
> 2) In your original e-mail, you state:
>
> "the full path of the image which is now shown is:
>
>
> http://localhost:8080/editanimation/sommeralex/usercontent/sommeralex/animations/maria/image.png"
>
>
> How is that url being generated? Are you creating it by hand? Are you
> trying to include the image as an asset? It's not obvious from the snippet
> of template you posted and your description where/how you're
> seeing/generating the above url.
>
> Robert
>
> On Feb 17, 2012, at 2/1712:44 PM , sommeralex wrote:
>
> > just with file.getPath()
> >
> > --
> > View this message in context:
> http://tapestry.1045711.n5.nabble.com/retrieving-image-paths-of-uploaded-images-tp5493508p5493524.html
>
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5493556&i=0>
> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5493556&i=1>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5493556&i=2>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5493556&i=3>
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://tapestry.1045711.n5.nabble.com/retrieving-image-paths-of-uploaded-images-tp5493508p5493556.html
>  To unsubscribe from retrieving image paths of uploaded images, click here<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5493508&code=YWxleGFuZGVyLnNvbW1lckBnbWFpbC5jb218NTQ5MzUwOHwxMDUzMzQxMzM4>
> .
> NAML<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://tapestry.1045711.n5.nabble.com/retrieving-image-paths-of-uploaded-images-tp5493508p5493564.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: retrieving image paths of uploaded images

Posted by Robert Zeigler <ro...@roxanemy.com>.
1) if they are at the top of the project they aren't (readily) accessible to the web app. To make them more accessible, try putting usercontent in src/main/webapp. That will put usercontent into the context path and make your life simpler

2) In your original e-mail, you state: 

"the full path of the image which is now shown is:

http://localhost:8080/editanimation/sommeralex/usercontent/sommeralex/animations/maria/image.png"

How is that url being generated? Are you creating it by hand? Are you trying to include the image as an asset? It's not obvious from the snippet of template you posted and your description where/how you're seeing/generating the above url.

Robert

On Feb 17, 2012, at 2/1712:44 PM , sommeralex wrote:

> just with file.getPath()
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/retrieving-image-paths-of-uploaded-images-tp5493508p5493524.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


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


Re: retrieving image paths of uploaded images

Posted by sommeralex <al...@gmail.com>.
just with file.getPath()

--
View this message in context: http://tapestry.1045711.n5.nabble.com/retrieving-image-paths-of-uploaded-images-tp5493508p5493524.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: retrieving image paths of uploaded images

Posted by Robert Zeigler <ro...@roxanemy.com>.
I think you need a bit more info. Like, how are you generating the image path?

Robert

On Feb 17, 2012, at 2/1712:36 PM , sommeralex wrote:

> Hi, 
> 
> I am dynamically uploading files/images with tapestry, and storing them in a
> path named /usercontent/username/type/files(..) at the top of my project. 
> 
> /target
> /.settings
> /src
> /usercontent
> 
> but the image is not shown within a tapestry page:
> 
> <ul id="sortable">
> <li t:type="loop" source="fileElements" value="fileElement"
> id="${fileElement.id}">   ${fileElement.path}  ${fileElement.name}     </li>
> </ul>
> 
> my tapestry page editAnimation takes two activation contexts (username, and
> name of animation gallery so here: sommeralex and maria)
> 
> http://localhost:8080/editanimation/sommeralex/maria
> 
> the full path of the image which is now shown is:
> 
> http://localhost:8080/editanimation/sommeralex/usercontent/sommeralex/animations/maria/image.png
> 
> i guess that this has something todo with assets.. but i have no idea how to
> get the real path to show my image. 
> 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/retrieving-image-paths-of-uploaded-images-tp5493508p5493508.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


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