You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jacob Wilson <st...@yahoo.com> on 2005/11/01 21:28:27 UTC

Problem with image display in WAS environment

Hi All-

 

I have a problem with image display in Websphere environment. It works fine in tomcat. I would appreciate if somebody could help me out here...

 

Details...

 

I am trying to call an action class and the forwarded jsp has    

<img src="images/g.gif" >

 

I have the images folder in the root directory. The image does not get displayed for some reason...

 

In the log, it says, 

 

[11/1/05 14:42:07:566 EST] 7ce4a126 RequestProces E org.apache.struts.action.RequestProcessor  Invalid path /images/g.gif was requested

 

 

I dont know from where it is appending the leading slash...

 

Kindly let me know...

 

Thanks

J


		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

Re: Peculiar error with ....

Posted by Murray Collingwood <mu...@focus-computing.com.au>.
The NAME attribute doesn't work in html:form, it is replaced by the ID attribute.

Cheers
mc

On 2 Nov 2005 at 14:32, Dave Newton wrote:

> Jacob Wilson wrote:
> 
> >I have a problem with my jsps after migrating my application from tomcat to 
Websphere. I use the struts-html taglibs in my jsps. When I use the normal html form 
tag like below, everything looks fine and the page gets displayed without problems.
> > 
> ><form method="post" action="myPage.do" name="FormName"> 
> > 
> >When I use the struts-html taglib like below, the jsp that shows up on the browser is 
totally empty....
> > 
> ><html:form method="post" action="myPage.do" name="FormName"> 
> > 
> >I had made sure that the action is present in struts-config.xml. Also, when I say 
action="myPage" in the form tag does not work.
> >  
> >
> I am suspicious of the "name" attribute. Or at least I am now that I 
> figured out what the difference between the two JSP chunks actually was.
> 
> I've never used "name" in html:form (I didn't even know you could); 
> "name" is created by html:form using the "action" attribute and the 
> "name" attribute in the action's <action...> configuration.
> 
> But you didn't include any struts config info, so who knows.
> 
> Dave
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.12.7/154 - Release Date: 1/11/2005
> 



FOCUS Computing - web design
Mob: 0415 24 26 24
murray@focus-computing.com.au
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.12.7/154 - Release Date: 1/11/2005


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


Re: Peculiar error with ....

Posted by Jacob Wilson <st...@yahoo.com>.
thanks for the response Murray.... I have this working in tomcat and Borland. For writing this mail, I copy pasted only the required stuff (also changed names!!) - hence left out the myPage action mapping. I am not new to struts and have been working on it for quite a while....
 
My subject line clearly says its peculiar coz, it works on tomcat, it works on Borland. When I  migrated my application to WAS, I am ending up with this error....
 
Never have seen something like this before. I lost my patience debugging what I have left out and have started trial and errors by having some attributes in the <html:form> and some not.
 
Wanting not to waste anymore time, am checking with you guys if you have had anything like this before.
 
Thanks
Jacob



Murray Collingwood <mu...@focus-computing.com.au> wrote:
The clue is....you haven't read the manual.

You are creating a target in your JSP called "myPage". Your struts-config doesn't 
define this target anywhere. It needs to be in your action-mappings. Also, because the 
target includes a form you need to specify the "NAME" attribute to identify a form-bean 
entry which ties it all back to your pojo. I'll bet your totally lost now and just wishing 
somebody would tell you what to write.... (been there, done that).

There are lots of example Struts apps around that work. Download one of these and 
use it for reference. I started with a forum example from John Topley, it seemed to be 
well written and even looking back now I think it was pretty good. You will find it at:
http://www.sitepoint.com/article/struts-first-steps

Cheers
mc

On 2 Nov 2005 at 12:12, Jacob Wilson wrote:

> Hi Dave -
> 
> Even without the name attribute it is the same !!!
> 
> 
> 
> Here is my struts-config
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> path="/myRoles.do" scope="request" type="com.ui.actions.MyPage"/>
> 
> 
> 
> 

> 
> 

> 

> INF/validation.xml" property="pathnames" />
> 

> 
> 
> 
> Any clues???
> 
> Thanks
> Jacob
> 
> Dave Newton wrote:
> Jacob Wilson wrote:
> 
> >I have a problem with my jsps after migrating my application from tomcat to 
Websphere. I use the struts-html taglibs in my jsps. When I use the normal html form 
tag like below, everything looks fine and the page gets displayed without problems.
> > 
> >
> > 
> >When I use the struts-html taglib like below, the jsp that shows up on the browser is 
totally empty....
> > 
> > 
> > 
> >I had made sure that the action is present in struts-config.xml. Also, when I say 
action="myPage" in the form tag does not work.
> > 
> >
> I am suspicious of the "name" attribute. Or at least I am now that I 
> figured out what the difference between the two JSP chunks actually was.
> 
> I've never used "name" in html:form (I didn't even know you could); 
> "name" is created by html:form using the "action" attribute and the 
> "name" attribute in the action's configuration.
> 
> But you didn't include any struts config info, so who knows.
> 
> Dave
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! FareChase - Search multiple travel sites in one click. 



FOCUS Computing - web design
Mob: 0415 24 26 24
murray@focus-computing.com.au
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.12.7/154 - Release Date: 1/11/2005


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


		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

Re: Peculiar error with ....

Posted by Murray Collingwood <mu...@focus-computing.com.au>.
The clue is....you haven't read the manual.

You are creating a target in your JSP called "myPage".  Your struts-config doesn't 
define this target anywhere.  It needs to be in your action-mappings.  Also, because the 
target includes a form you need to specify the "NAME" attribute to identify a form-bean 
entry which ties it all back to your pojo.  I'll bet your totally lost now and just wishing 
somebody would tell you what to write.... (been there, done that).

There are lots of example Struts apps around that work.  Download one of these and 
use it for reference.  I started with a forum example from John Topley, it seemed to be 
well written and even looking back now I think it was pretty good.  You will find it at:
http://www.sitepoint.com/article/struts-first-steps

Cheers
mc

On 2 Nov 2005 at 12:12, Jacob Wilson wrote:

> Hi Dave -
>  
> Even without the name attribute it is the same !!!
>  
> <html:form method="post" action="myPage"> 
>  
> Here is my struts-config
>  
> <struts-config>
>   <form-beans>
>     <form-bean name="RoleForm" type="com.ui.forms.FormnnName" />
>   </form-beans>
>   <global-forwards>
>     <forward name="error" path="/iam_error.jsp" />
>     <forward name="invalidUser" path="/iam_invalid_user.jsp" />
>   </global-forwards>
>   <action-mappings>
>      <action input="/iam_admin_role_my_roles.jsp" name="FormName" 
path="/myRoles.do" scope="request" type="com.ui.actions.MyPage"/>
> </action-mappings>
>   <!-- Message Resources -->
>   <message-resources parameter="ApplicationResources" null="false"/>
>   <plug-in className="org.apache.struts.tiles.TilesPlugin">
>     <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
>   </plug-in>
>   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
>     <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-
INF/validation.xml" />
>   </plug-in>
> </struts-config>
>  
>  
> Any clues???
>  
> Thanks
> Jacob
> 
> Dave Newton <ne...@pingsite.com> wrote:
> Jacob Wilson wrote:
> 
> >I have a problem with my jsps after migrating my application from tomcat to 
Websphere. I use the struts-html taglibs in my jsps. When I use the normal html form 
tag like below, everything looks fine and the page gets displayed without problems.
> > 
> >
> > 
> >When I use the struts-html taglib like below, the jsp that shows up on the browser is 
totally empty....
> > 
> > 
> > 
> >I had made sure that the action is present in struts-config.xml. Also, when I say 
action="myPage" in the form tag does not work.
> > 
> >
> I am suspicious of the "name" attribute. Or at least I am now that I 
> figured out what the difference between the two JSP chunks actually was.
> 
> I've never used "name" in html:form (I didn't even know you could); 
> "name" is created by html:form using the "action" attribute and the 
> "name" attribute in the action's configuration.
> 
> But you didn't include any struts config info, so who knows.
> 
> Dave
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> 
> 		
> ---------------------------------
>  Yahoo! FareChase - Search multiple travel sites in one click.  



FOCUS Computing - web design
Mob: 0415 24 26 24
murray@focus-computing.com.au
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.12.7/154 - Release Date: 1/11/2005


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


Re: Peculiar error with ....

Posted by Jacob Wilson <st...@yahoo.com>.
Yes. I dont have the .do when I run on tomcat or Borland. With WAS, it is not getting the action without the .do - Maybe, I guess somewhere a configuration needs to be done to have the server accept without .do 

Dave Newton <ne...@pingsite.com> wrote:Jacob Wilson wrote:

> 
> 
>Here is my struts-config
> 
> 
> 
> 
> 
> 
>
> 
>Any clues???
> 
>
form-bean name: RoleForm
action name: FormName

I don't use extension mapping usually, but are you supposed to put the 
".do" in the path attribute in the mapping? I don't recall having even 
done that.

Dave



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



		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

Re: Peculiar error with ....

Posted by Dave Newton <ne...@pingsite.com>.
Jacob Wilson wrote:

><html:form method="post" action="myPage"> 
> 
>Here is my struts-config
> 
>  <form-beans>
>    <form-bean name="RoleForm" type="com.ui.forms.FormnnName" />
>  </form-beans>
>  <action-mappings>
>     <action input="/iam_admin_role_my_roles.jsp" name="FormName" path="/myRoles.do" scope="request" type="com.ui.actions.MyPage"/>
></action-mappings>
> 
>Any clues???
>  
>
form-bean name: RoleForm
action name: FormName

I don't use extension mapping usually, but are you supposed to put the 
".do" in the path attribute in the mapping? I don't recall having even 
done that.

Dave



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


Re: Peculiar error with ....

Posted by Jacob Wilson <st...@yahoo.com>.
Hi Dave -
 
Even without the name attribute it is the same !!!
 
<html:form method="post" action="myPage"> 
 
Here is my struts-config
 
<struts-config>
  <form-beans>
    <form-bean name="RoleForm" type="com.ui.forms.FormnnName" />
  </form-beans>
  <global-forwards>
    <forward name="error" path="/iam_error.jsp" />
    <forward name="invalidUser" path="/iam_invalid_user.jsp" />
  </global-forwards>
  <action-mappings>
     <action input="/iam_admin_role_my_roles.jsp" name="FormName" path="/myRoles.do" scope="request" type="com.ui.actions.MyPage"/>
</action-mappings>
  <!-- Message Resources -->
  <message-resources parameter="ApplicationResources" null="false"/>
  <plug-in className="org.apache.struts.tiles.TilesPlugin">
    <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
  </plug-in>
  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
  </plug-in>
</struts-config>
 
 
Any clues???
 
Thanks
Jacob

Dave Newton <ne...@pingsite.com> wrote:
Jacob Wilson wrote:

>I have a problem with my jsps after migrating my application from tomcat to Websphere. I use the struts-html taglibs in my jsps. When I use the normal html form tag like below, everything looks fine and the page gets displayed without problems.
> 
>
> 
>When I use the struts-html taglib like below, the jsp that shows up on the browser is totally empty....
> 
> 
> 
>I had made sure that the action is present in struts-config.xml. Also, when I say action="myPage" in the form tag does not work.
> 
>
I am suspicious of the "name" attribute. Or at least I am now that I 
figured out what the difference between the two JSP chunks actually was.

I've never used "name" in html:form (I didn't even know you could); 
"name" is created by html:form using the "action" attribute and the 
"name" attribute in the action's configuration.

But you didn't include any struts config info, so who knows.

Dave



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




		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

Re: Peculiar error with ....

Posted by Dave Newton <ne...@pingsite.com>.
Jacob Wilson wrote:

>I have a problem with my jsps after migrating my application from tomcat to Websphere. I use the struts-html taglibs in my jsps. When I use the normal html form tag like below, everything looks fine and the page gets displayed without problems.
> 
><form method="post" action="myPage.do" name="FormName"> 
> 
>When I use the struts-html taglib like below, the jsp that shows up on the browser is totally empty....
> 
><html:form method="post" action="myPage.do" name="FormName"> 
> 
>I had made sure that the action is present in struts-config.xml. Also, when I say action="myPage" in the form tag does not work.
>  
>
I am suspicious of the "name" attribute. Or at least I am now that I 
figured out what the difference between the two JSP chunks actually was.

I've never used "name" in html:form (I didn't even know you could); 
"name" is created by html:form using the "action" attribute and the 
"name" attribute in the action's <action...> configuration.

But you didn't include any struts config info, so who knows.

Dave



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


Peculiar error with ....

Posted by Jacob Wilson <st...@yahoo.com>.
Hello All -
 
I have a problem with my jsps after migrating my application from tomcat to Websphere. I use the struts-html taglibs in my jsps. When I use the normal html form tag like below, everything looks fine and the page gets displayed without problems.
 
<%@ page language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ page import ="com.cisco.m2s.iam.utils.*"%>
<%String rowColor = "";%>
<bean:define id="pageForm" value="MY_PAGE" toScope="request"/>
<tiles:insert  page="/iamtemplate.jsp">
<tiles:put name="title" value="Welcome to My Page"/>
<tiles:put name="content">
<form method="post" action="myPage.do" name="FormName"> 
<table>
 <tr>
  <td>
   Displaying my page....
  </td>
 </tr>
</table>
</form>
</tiles:put>
</tiles:insert> 
 
When I use the struts-html taglib like below, the jsp that shows up on the browser is totally empty....
 
<%@ page language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ page import ="com.cisco.m2s.iam.utils.*"%>
<%String rowColor = "";%>
<bean:define id="pageForm" value="MY_PAGE" toScope="request"/>
<tiles:insert  page="/iamtemplate.jsp">
<tiles:put name="title" value="Welcome to My Page"/>
<tiles:put name="content">
<html:form method="post" action="myPage.do" name="FormName"> 
<table>
 <tr>
  <td>
   Displaying my page....
  </td>
 </tr>
</table>
</html:form>
</tiles:put>
</tiles:insert>
 
I had made sure that the action is present in struts-config.xml. Also, when I say action="myPage" in the form tag does not work.
 
This seems very strange!!! Has anybody faced a similar problem? Am I missing something? Please do let me know as to why this happens.
 
Thanks
Jacob




		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

Re: Problem with image display in WAS environment

Posted by Deepa Khetan <de...@gmail.com>.
In WS you need to specify the entire path of the image, as in,
/<project-name>/images/g.gif .. I faced this problem and it works fine if i
give the entire path


 On 11/2/05, Jacob Wilson <st...@yahoo.com> wrote:
>
>
> Hi All-
>
>
>
> I have a problem with image display in Websphere environment. It works
> fine in tomcat. I would appreciate if somebody could help me out here...
>
>
>
> Details...
>
>
>
> I am trying to call an action class and the forwarded jsp has
>
> <img src="images/g.gif" >
>
>
>
> I have the images folder in the root directory. The image does not get
> displayed for some reason...
>
>
>
> In the log, it says,
>
>
>
> [11/1/05 14:42:07:566 EST] 7ce4a126 RequestProces E
> org.apache.struts.action.RequestProcessor Invalid path /images/g.gif was
> requested
>
>
>
>
>
> I dont know from where it is appending the leading slash...
>
>
>
> Kindly let me know...
>
>
>
> Thanks
>
> J
>
>
>
> ---------------------------------
> Yahoo! FareChase - Search multiple travel sites in one click.
>

Re: Problem with image display in WAS environment

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
What is ActionServlet mapped to?  Based on the log output, ActionServlet
is being hit to serve the GIF... is this what you intend?  I suspect not. 
Although, even if I'm right, I can't explain why it works in Tomcat but
not WS...

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

On Tue, November 1, 2005 3:28 pm, Jacob Wilson said:
>
> Hi All-
>
>
>
> I have a problem with image display in Websphere environment. It works
> fine in tomcat. I would appreciate if somebody could help me out here...
>
>
>
> Details...
>
>
>
> I am trying to call an action class and the forwarded jsp has
>
> <img src="images/g.gif" >
>
>
>
> I have the images folder in the root directory. The image does not get
> displayed for some reason...
>
>
>
> In the log, it says,
>
>
>
> [11/1/05 14:42:07:566 EST] 7ce4a126 RequestProces E
> org.apache.struts.action.RequestProcessor  Invalid path /images/g.gif was
> requested
>
>
>
>
>
> I dont know from where it is appending the leading slash...
>
>
>
> Kindly let me know...
>
>
>
> Thanks
>
> J
>
>
>
> ---------------------------------
>  Yahoo! FareChase - Search multiple travel sites in one click.


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