You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jitendra Kumar <ji...@hth.bhel.co.in> on 2006/02/06 08:25:53 UTC

RE: [OT] (Problem Solved)Re: Image not getting displayed !

Hi Everyone ! 

The problem has been solved. Thanks everyone for your responses.

Solution: myeclipse ide was not packing the image file while deploying
on to Jboss. It created new image folder and put the image file again in
that and it worked.It was a silly mistake, I should have checked it
earlier. 

Thanks again
Jeet


-----Original Message-----
From: Jitendra Kumar [mailto:jitendrak@hth.bhel.co.in] 
Sent: Monday, February 06, 2006 11:42 AM
To: 'Struts Users Mailing List'
Subject: RE: [OT] Re: Image not getting displayed !


Thanx Max ! (Wow.... Doesn't I sound poetic)

Appreciate your effort to reply to my mail. 

I have used all the possible permutations/combinations for the image
path. So there is no possibility of using a wrong root. I also tried to
type the URL of the image directly to the browser. 

I get this error:

HTTP Status 404 - /CMSystem/Webroot/images/struts-power.gif 
description The requested resource
(/CMSystem/Webroot/images/struts-power.gif) is not available.

Same error comes for all the paths

It seems that there is some other configuration error. Do I need to add
some lines in struts-config ???

Regards,
Jeet


-----Original Message-----
From: Max Cooper [mailto:max@maxcooper.com] 
Sent: Saturday, February 04, 2006 7:11 PM
To: Struts Users Mailing List
Subject: RE: [OT] Re: Image not getting displayed !


There are some useful browser plugins for finding (and correcting, based
on the info they help you obtain) broken image references. For example,
using Firefox with the Web Developer plugin, you can use Find Broken
Images.

1. Type stuff into your browser address bar until you know what the full
URL for the image *should* be.

2. Look at the source of your web page (View Source in browser) with the
broken image reference and see what the img src is. It will probably
start with / (a site-root relative reference). Browsers are completely
unaware of webapp context paths and so will always evaluate the URL
relative to the site root (e.g. http://your.server.com/ and not
http://your.server.com/contextPath/).

3. Do stuff to make #2 look like #1 (or more likely a site-root-relative
version of #1 -- Struts will add the contextPath for you if you use
page="/path/to/image"). :-)

Based on "The context is CMSystem folder" and
"CMSystem/WebRoot/images/", I would expect that you need something like
this:

<html:img page="/WebRoot/images/struts-power.gif"/>

(You might need module="", too, but I can't remember.)

which will become the following plain HTML when the JSP executes:

<img src="/whateverYourContextPathIs/WebRoot/images/struts-power.gif">

(Is CMSystem really the contextPath, or is your app really rooted at
WebRoot? Be careful not to confuse the contextPath with something in
your development file tree -- they aren't the same thing. It seems like
your webapp is probably rooted in WebRoot, in which case
page="/images/..." is what you need.)

-Max

On Fri, 2006-02-03 at 10:23 +0530, Jitendra Kumar wrote:
> I will try to be clearer this time !!
> 
> I am developing a Struts project using myeclipse IDE. In this I have
> developed a JSP page using struts tags. I want to insert a picture on 
> this page. For doing this I have used these two options:
> 
> 1. <html:img src="images/struts-power.gif" />
> 2. <html:img align="" alt="" border="" page="/images/struts-power.gif"

> />
> 
> The directory structure of my application is 
> CMSystem/WebRoot/images/... CMSystem/WebRoot/WEB-INF/...
> 
> The context is CMSystem folder.
> 
> But, none of the above is showing the image on viewing in browser. I
> am using JBOss 3.2.5
> 
> Please let me know what mistake I am doing.
> 
> 
> -----Original Message-----
> From: Dave Newton [mailto:newton@pingsite.com]
> Sent: Thursday, February 02, 2006 8:51 PM
> To: Struts Users Mailing List
> Subject: [OT] Re: Image not getting displayed !
> 
> 
> Jitendra Kumar wrote:
> > I am using <IMG src="images/imagename.gif"></IMG> in myeclipse.
> >
> > In Design view the image is showing by when I view it in browser,
> > the
> > image doesn't show. Please let me know the reason.
> >   
> I'm not sure how this is Struts-related.
> 
> Even if it were, as you have provided essentially zero information
> this will be difficult to diagnose.
> 
> Dave
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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


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


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


Struts and Velocity - example

Posted by Manfred Wolff <wo...@manfred-wolff.de>.
Hi.

Has anyone a "not trivial" example of a struts-velocity page with
iteration of lists. parameter in links etc.  The most things I have
collected in the internet, but it were fine, if I get an example that is
a little bit difficult.

Manfred

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