0

I have started using struts .I have hanged in a place ,Code is bellow

<st:submit src="getText('image.user.login')"  type="image" height="21" width="44" </st:submit>

when i run this code , getText('image.user.login') message does return any value , But when i replace src="getText('image.user.login')" with value="getText('image.user.login')" than it returns value of "image.user.login" from property file.

What is reason for it , and how can i solve this issue ?

Thanks in advance

Prakash Panjwani
  • 2,540
  • 5
  • 23
  • 34

2 Answers2

0

like this example illustrates in this reference submit reference struts

Render an image submit:

<s:submit type="image" value="%{'Submit'}" label="Submit the form" src="submit.gif"/>

src : Supply an image src for image type submit button. Will have no effect for types input and button.

AND

value : String Preset the value of input element.

this should answer your question if you use src you should assign a path and if you use value you can use a preset value

shareef
  • 9,255
  • 13
  • 58
  • 89
  • thanks , but value key value set in property file is image.user.login=images/login.gif , i just want to pick image path from property file. – Prakash Panjwani Jun 23 '12 at 08:58
  • you should right it like this `src="%{getText('image.user.login')}"` note the percent `%` and braces `{}` i read it on blogs and tutorials like (link)[http://struts.1045723.n5.nabble.com/getText-did-not-return-value-in-s-submit-td3489503.html] – shareef Jun 23 '12 at 09:06
  • how did you make it work by adding percent and brace or not ? – shareef Jun 23 '12 at 11:13
0

try this:

 <st:submit key="image.user.login"/>
Jaiwo99
  • 9,687
  • 3
  • 36
  • 53